devshop / power-process
增强的 Symfony Process 组件。
1.8.0-beta3
2023-02-01 03:24 UTC
Requires
- php: ^7.1||^8.0
- consolidation/robo: ^2
- symfony/process: ^4.4
- 2.x-dev
- 1.x-dev
- 1.8.x-dev
- 1.8.0-beta3
- 1.8.0-beta2
- 1.8.0-beta1
- 1.8.0-alpha1
- 1.7.x-dev
- 1.7.0-alpha4
- 1.7.0-alpha3
- 1.7.0-alpha2
- 1.7.0-alpha1
- dev-component/yaml-tasks/env-fixes / 1.6.x-dev
- 1.6.0-alpha4
- 1.6.0-alpha3
- 1.6.0-alpha2
- dev-bug/bitbucket-builds
- dev-bug/bitbucket/integration
- dev-bug/build-fast
- dev-bug/composer-broke
- dev-bug/composer-install-fails-preserve-paths
- dev-bug/deploy
- dev-bug/deploy-apis
- dev-bug/destroyed
- dev-bug/docker-logs-artifacts
- dev-bug/docker/actions
- dev-bug/docker/hub
- dev-bug/everything
- dev-bug/failing-again
- dev-bug/fucked-containers
- dev-bug/full-stack-stuff
- dev-bug/github/actions
- dev-bug/github/settings-ui
- dev-bug/hosting-queue-runner-commands
- dev-bug/last-passing-commit
- dev-bug/little-things
- dev-bug/local/docker-command
- dev-bug/no-drush
- dev-bug/provision-files
- dev-bug/queues
- dev-bug/remote-hosts
- dev-bug/reset
- dev-bug/sync
- dev-bug/tasks
- dev-bug/ubuntu-scripts
- dev-bug/unpreserved-paths
- dev-bug/updated-containers
- dev-bug/upgrade
- dev-bug/verify
- dev-bug/verify-fail-after-install
- dev-bugs/beta-blockers
- dev-bugs/contrib
- dev-bugs/various
- dev-component/devshop-behat-extension
- dev-dev/github/fixes
- dev-dev/stuff
- dev-feature/ansible-tweaks
- dev-feature/ansible/faster
- dev-feature/bitbucket-fixes
- dev-feature/commands
- dev-feature/development/lando
- dev-feature/devshop-control-in-root
- dev-feature/devshop-platform
- dev-feature/drupal-10
- dev-feature/hosting/default_hosting_settings
- dev-feature/hosting_docker
- dev-feature/linuxserver
- dev-feature/megamerge
- dev-feature/minor-ansible-improvements
- dev-feature/no-platforms
- dev-feature/php-81-default
- dev-feature/php-intl
- dev-feature/php/8.1-default
- dev-feature/platform-user
- dev-feature/reinstall
- dev-feature/release-docs
- dev-feature/remote-host-container
- dev-feature/site-audit
- dev-feature/ubuntu22
- dev-release-1.8.0-beta1
- dev-release-1.8.0-beta2
- dev-tests/docker/from-devshop-server
- dev-tests/failing-install
- dev-updates/2023-10
- dev-feature/php/8.1
- dev-bug/ansible/detect-site
- dev-bug/docker/build-again
- dev-bug/docker/no-buildtime-tag
- dev-bug/docker/removed-too-much
- dev-bug/scripts/fix-path
- dev-bug/sites/git-reset
- dev-dev/install/platforms
- dev-feature/composer/git-traits
- dev-feature/docker/build-run
- dev-feature/docker/hub-publish
- dev-feature/os/ubuntu20
- dev-feature/os/ubuntu2004
- dev-feature/php-8
- dev-feature/php/8
- dev-feature/php/8.0
- dev-feature/robo/cleanup
- dev-ops/ansible/default-project-vars
- dev-php81
- dev-feature/docker/fix-it-all
- dev-feature/components/php-8
- dev-dev/devshop/docker-tools
- dev-bug/ch101/devshop-test-volumes
- dev-bug/ch112/release-fixes
- dev-bug/ch118/provision-release
- dev-bug/ch118/test-fails
- dev-bug/ch118/uid-reset
- dev-bug/ch122/test-devshop-control
- dev-bug/ch17/test-assets-folder
- dev-bug/ch177/detect-hostname
- dev-bug/ch185/composer-1
- dev-bug/ch185/composer-2
- dev-bug/ch20/ansible-lint
- dev-bug/ch35/tests-passing
- dev-bug/ch36/little-bugs
- dev-bug/ch460/bad-1.x-builds
- dev-bug/ch460/scheduled-build-branch
- dev-bug/ch472/composer-devshop-control
- dev-bug/ch477/composer-tests
- dev-bug/ch477/lost-control
- dev-bug/ch479/simplify-ansible-inventory-generation
- dev-bug/ch504/1x-ci-fail
- dev-bug/ch505/ansible-role-vars
- dev-bug/ch586/main-branch-tests
- dev-bug/ch587/install-sh-forks
- dev-bug/chXYZ/yaml-tasks-bugs
- dev-bug/components-ci-fail
- dev-bug/composer-ansible-fail
- dev-bug/composer-common-installable
- dev-bug/composer-fail
- dev-bug/docker-compose-up
- dev-bug/gh385/deploy
- dev-bug/gh642/disabled-sites
- dev-bug/gh656/protect-site
- dev-bug/git-split/composer-plugin-api-version
- dev-bug/hosting-queue-stop
- dev-bug/install-builder
- dev-bug/pr655/tests-failing
- dev-bug/tests-and-local
- dev-ci/install/devshop-tech
- dev-ci/makefiles/ci-makefile
- dev-component/composer/deploy
- dev-component/composer/devmaster
- dev-component/composer/set-path
- dev-component/devmaster/task-line-numbers
- dev-component/docs
- dev-components
- dev-composer/node/suggests
- dev-dependabot/add-v2-config-file
- dev-dev/environment/classes
- dev-dev/support/fixes
- dev-dev/ux/task-site-urls
- dev-dev/ux/tasks
- dev-feature/ch115/hugo-site
- dev-feature/ch121/links-to-domains
- dev-feature/ch139/ansible-cloud
- dev-feature/ch139/repos
- dev-feature/ch256/devshop-developers
- dev-feature/ch37/dev-environment
- dev-feature/ch475/better-install-sh
- dev-feature/ch534/github-actions-checkout
- dev-feature/ch584/better-dx
- dev-feature/ch81/composer-devshop
- dev-feature/ch86/deploy
- dev-feature/ch86/deploy-component
- dev-feature/ch87/rapid-tests
- dev-feature/ch87/rapid-tests-2
- dev-feature/ch89/core-values
- dev-feature/ch90/readme
- dev-feature/gh644/devshop-control-codebase
- dev-feature/gh644/path-devmaster-repo
- dev-feature/git-remote-monitor
- dev-feature/php-versions
- dev-feature/php80
- dev-feature/shape-up
- dev-feature/test-composer-template
- dev-feature/ubuntu20
- dev-install/get.devshop.tech
- dev-install/install-sh/ansible-pip
- dev-integration
- dev-ops/ansible/update
- dev-ops/docker/dockerfiles
- dev-ops/os/centos8
- dev-pr/655
- dev-pull/589
- dev-release-1.7.0
- dev-testing/php74
- dev-tests/control/pseudo-repo
- dev-ux/create/redirect
- dev-ci/github/actions-branches
- dev-ci/github/actions-fixes
- dev-component/cli/remove-asm
- dev-component/common
- dev-component/composer/github-api
- dev-component/github-api-cli/deployments
- dev-component/github-api-cli/ssl-ignore
- dev-component/github-cli
- dev-component/yaml-tasks/bin-path
- dev-component/yaml-tasks/output-options
- dev-dependabot/composer/composer/composer-1.10.4
- dev-dependabot/composer/composer/composer-1.10.5
- dev-dependabot/composer/drush/drush-10.2.2
- dev-dependabot/composer/drush/drush-9.0.0-alpha1
- dev-develop
- dev-development/drupalvm
- dev-ops/docker/fast-container
- dev-component/power-process/must-run-bug
This package is auto-updated.
Last update: 2024-09-04 12:07:22 UTC
README
此库提供了一个升级版的 Symfony Process 组件。
它为希望向用户展示正在运行的过程及其输出的应用程序提供了一个更友好的界面。
此库由 Provision Yaml 测试使用,并将用于 Provision CLI 项目。
Symfony 4
Symfony 4 中,Symfony Process 组件在几个 API 的参数中具有与 Symfony 3 不同的类型提示。这是由于 Symfony 4 需要 PHP 7.1.3 或更高版本,它支持一些在早期 PHP 版本中不允许的类型提示。对于大多数客户端来说,这种差异很小,但对于子类化 Process 的代码来说,这是一个问题,因为它无法同时兼容 Symfony 3 和 Symfony 4 的类型提示。
注意:将来会发布一个与 Symfony 4 兼容的组件。
非常感谢 @g1a 和整合团队提供这一段文本,并树立了一个基于 Process 组件的组件的典范。
请参阅 https://github.com/consolidation/site-process/compare/2.x...master,了解维护两个分支的示例。
用法
用法扩展了 Symfony Process 组件。
请参阅 demo.php 以获取简单示例
// Include autoloader include('vendor/autoload.php'); // PowerProcess needs IO. $input = new \Symfony\Component\Console\Input\ArgvInput($argv); $output = new \Symfony\Component\Console\Output\ConsoleOutput(); // Replace Style with your own to change the output style. $io = new DevShop\Component\PowerProcess\PowerProcessStyle($input, $output); // Run any command. $command = 'ls -la'; $process = new DevShop\Component\PowerProcess\PowerProcess($command, $io); $process->run();
然后运行文件
php demo.php
您将看到命令以如下方式运行
另一个示例
文件 `run' 是任何命令的包装器。
尝试
./run ping packagist.org -c 5 ./run git status ./run rm -rf /
简单。
功能
此项目正在从 Provision CLI 提取。它将迅速增长和变化。
计划功能
- 格式化输出以供人类阅读。
- 自动将输出重定向到文件,并提供目标路径选项。(这在 Provision CLI 中已经完成)
- 允许轻松静音输出。
- 添加钩子,允许其他插件对进程事件做出反应。