PHP code example of skyline / cli
1. Go to this page and download the library: Download skyline/cli library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
skyline / cli example snippets
// 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
]
];
~/Public/skyline.php