定制 skyline/cli 二次开发

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

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

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

GitHub 信息

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

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2020-01-22

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固