定制 statikbe/deployer-tasks 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

statikbe/deployer-tasks

Composer 安装命令:

composer require statikbe/deployer-tasks

包简介

Reusable Deployer 8 tasks for Statik.be projects (Laravel, Craft CMS, common integrations).

README 文档

README

Reusable Deployer 8 tasks and recipes for Statik.be projects.

Requirements

  • PHP 8.3+
  • Deployer 8.x

Installation

composer require --dev statikbe/deployer-tasks

Usage

Laravel projects

<?php
namespace Deployer;

require 'vendor/statikbe/deployer-tasks/recipe/laravel.php';

// regular deployer host configuration:
set('application', 'my-app');
set('repository', 'git@github.com:statikbe/my-app.git');

host('production')
    ->set('hostname', 'prod.example.org')
    ->set('deploy_path', '/var/www/my-app');

Craft CMS projects

<?php
namespace Deployer;

require 'vendor/statikbe/deployer-tasks/recipe/craft.php';

// ...host config

À la carte

Require an individual task file and wire the hook yourself:

require 'vendor/statikbe/deployer-tasks/recipe/tasks/voight.php';
after('deploy', 'statik:voight');

Available tasks

Task Description
statik:reload-phpfpm Reload PHP-FPM safely with mutex, debounce, and opcache validation. Wired by both starters to after('deploy:symlink', ...). Combell-specific — set combell_hosting to false (globally or per-host) to skip it on non-Combell hosts.
statik:copy_env Copy the stage-specific .env file (env_file, relative to release_path) into {{deploy_path}}/shared/.env. No-ops when env_file is unset. Wired by the Laravel starter to before('deploy:shared', ...).
statik:copy_htaccess Copy the stage-specific htaccess file (htaccess_file, relative to release_path) into {{public_path}}/.htaccess. No-ops when htaccess_file is unset. Wired by both starters to before('deploy:shared', ...).
statik:voight Download and run the Voight versioning script in the release path.

env_file and htaccess_file are read with an inline null default, so they never shadow a value set per host (e.g. in hosts.yml) or globally. Set them per host:

# hosts.yml
production:
  hostname: prod.example.org
  deploy_path: /var/www/my-app
  env_file: .env.production
  htaccess_file: .htaccess.production

statik:copy_htaccess (and statik:reload-phpfpm) resolve the web root via {{public_path}}. The Laravel base recipe sets this to public; the Craft starter sets it to web. If you require either task à la carte without a framework recipe, set public_path yourself.

More tasks (composer install with secret env, local-build asset rsync, maintenance banner, config-file sync) ship in upcoming releases.

reload-phpfpm

If the probe URL is behind .htaccess basic auth, configure the credentials in your project's deploy.php after the require line:

require 'vendor/statikbe/deployer-tasks/recipe/laravel.php';

set('basic_auth_user', 'htaccess_user');
set('basic_auth_password', 'htaccess_password');

host('production')->set(/* ... */);

Both values must be set; if either is empty the task runs without auth. You can also source them from the environment (e.g. set('basic_auth_user', getenv('BASIC_AUTH_USER'));) — handy for Bitbucket Pipelines repository variables. Per-host overrides work too: host('staging')->set('basic_auth_user', '...');.

The application's .env no longer needs BASIC_AUTH_USER / BASIC_AUTH_PASSWORD for this task. Existing projects should remove those keys from .env and move them to deploy.php via the set() calls above.

Development

composer install
composer test       # Pest — currently no tests; helper classes in src/ will get unit tests
composer format     # Laravel Pint
composer analyse    # PHPStan (exits non-zero until src/ has PHP files; recipe/ is intentionally excluded since Deployer's global functions need stubs)

The recipes are smoke-tested by loading them through Deployer:

vendor/bin/dep --file=tests/fixtures/laravel-deploy.php list
vendor/bin/dep --file=tests/fixtures/craft-deploy.php list

License

MIT — see LICENSE.

statikbe/deployer-tasks 适用场景与选型建议

statikbe/deployer-tasks 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 116 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 05 月 08 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「laravel」 「deployment」 「deployer」 「craftcms」 「statikbe」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 statikbe/deployer-tasks 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 statikbe/deployer-tasks 我们能提供哪些服务?
定制开发 / 二次开发

基于 statikbe/deployer-tasks 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 116
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 44
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-05-08