binomeway/laravel-keep-alive

保持laravel应用程序的更新状态。

dev-main 2023-07-03 04:41 UTC

README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

这里应该是您的描述,限制在一到两段文字。考虑添加一个小例子。

安装

您可以通过composer安装此包

composer require binomeway/laravel-keep-alive

您可以使用以下命令发布配置文件

php artisan vendor:publish --tag="laravel-keep-alive-config"

这是发布配置文件的内容

return [
    /**
     * This represents the latest version of the application
     * Whenever the app requires to run updates, bump this version.
     */
    'version' => '0.0.0',

    'repository' => \BinomeWay\KeepAlive\Repositories\FileRepository::class,

    'install' => [
        RunMigrationsAction::class,
        SummaryAction::class,
    ],

    'updates' => [
        //  '1.0.0' => [Update100::class], // or just the class Update100::class
    ],

];

使用方法

Keep Alive扩展了about命令,显示应用程序版本状态详细信息。

php artisan about

要安装应用程序,请使用app:install

php artisan app:install

要运行更新,请使用app:update

php artisan app:update

扩展

Keep Alive也可以在控制台环境之外使用。

例如,如果您想调用安装或更新函数,可以使用Installer和Updater外观。

use BinomeWay\KeepAlive\Facades;

function someMethod() {
    
    $result = Facades\Installer::run();
    
    // or same with Updater...
    
    $result = Facades\Updater::run();
    
    
    if($result->isSuccessful()) {
        // do something
        echo $result->message();
    }
    
    
}

存储库

为了持久化应用程序的版本,您可以使用默认存储库之一或实现自己的存储库

默认存储库

  • FileRepository(默认)
  • CacheRepository
  • RedisRepository(待办)
  • EnvRepository(待办)

测试

composer test

路线图

  • 为Installer和Updater添加支持先决条件
  • 添加数据库事务功能标志
  • 为每个环境添加单独的操作支持
  • 添加RedisRepository
  • 添加EnvRepository
  • 添加Filament扩展
  • 添加安装/更新UI扩展

变更日志

有关最近更改的更多信息,请参阅变更日志

贡献

有关详细信息,请参阅贡献指南

安全漏洞

请参阅我们的安全策略,了解如何报告安全漏洞。

鸣谢

许可

MIT许可(MIT)。有关更多信息,请参阅许可文件