germania-kg/update-command

1.2.3 2023-01-25 13:47 UTC

This package is auto-updated.

Last update: 2024-09-25 17:41:08 UTC


README

Symfony 控制台命令,用于从 CLI 更新 Web 应用。

Tests

安装

$ composer require germania-kg/update-command:^1.0

需求

此包需要 Symfony ConsoleProcess 组件。

使用

use Germania\UpdateApp\UpdateAppCommand;

$cache_directories = array();

$cmd = new UpdateAppCommand();
$cmd = new UpdateAppCommand($cache_directories);

CLI 使用

命令名称为 update,它接受一个 --no-dev 选项以用于生产环境。

$ bin/console update
$ bin/console update --no-dev

开发

$ git clone git@github.com:GermaniaKG/UpdateAppCommand.git
# or
$ git clone https://github.com/GermaniaKG/UpdateAppCommand.git

运行所有测试

此包已定义测试设置,用于代码质量、代码可读性和单元测试。在 composer.jsonscripts 部分查看它们。

$ composer test
# ... which currently includes
$ composer phpunit

单元测试

默认配置为 phpunit.xml.dist. 创建一个自定义的 phpunit.xml 以应用自己的设置。也请访问 phpunit.readthedocs.io · Packagist

$ composer phpunit
# ... or
$ vendor/bin/phpunit

PhpStan

默认配置为 phpstan.neon.dist. 创建一个自定义的 phpstan.neon 以应用自己的设置。也请访问 phpstan.org · GitHub · Packagist

$ composer phpstan
# ... which includes
$ vendor/bin/phpstan analyse

PhpCS

默认配置为 .php-cs-fixer.dist.php. 创建一个自定义的 .php-cs-fixer.php 以应用自己的设置。也请访问 cs.symfony.com · GitHub · Packagist

$ composer phpcs
# ... which aliases
$ vendor/bin/php-cs-fixer fix --verbose --diff --dry-run

应用所有 CS 修复

$ composer phpcs:apply
# ... which aliases 
$ vendor/bin/php-cs-fixer fix --verbose --diff