skyline/cli
Composer 安装命令:
composer require skyline/cli
包简介
This package makes a Skyline Web Application accessible via command line, for example to trigger background tasks from a foreign target.
README 文档
README
The CLI Package adds a plugin to your application that interact on command line requests.
By default, the file ~/Public/skyline.php gets called by apache or another webserver to deliver your webpage.
If this file gets performed under command line, you will get an error, because the routing never will success.
This Package installed it will listen for command line calls and forward to registered tasks.
Installation
$ composer require skyline/cli
Usage
The package introduces a new configuration file:
processes.cfg.php
All files with this name are collected while compiling and they should declare a process info.
Such a config file might look like:
<?php // File MyClass.php class MyClass { // Constructor must not expect arguments. // If you need so, specify as service and define with ProcessConfig::PROCESS_SERVICE_NAME public function __construct() {} public function run($argc, $argv) { // Do stuff } } // File: processes.cfg.php use Skyline\CLI\Config\ProcessConfig; return [ [ ProcessConfig::PROCESS_NAME => 'my-process', ProcessConfig::PROCESS_METHOD => 'run', ProcessConfig::PROCESS_CLASS_NAME => stdClass::class ] ];
统计信息
- 总下载量: 14
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2020-01-22