clarity/console 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

clarity/console

Composer 安装命令:

composer require clarity/console

包简介

README 文档

README

use this to build your own console command for your Phalcon applications.

Console

Let's create a simple console

<?php

use Clarity\Console\Brood;

class SampleConsole extends Brood
{
    protected $alias = 'sample';
    protected $description = 'Just a sample class to test console';

    public function slash()
    {
        $this->comment('triggered!');
    }
}

Save the file as SampleConsole.php

Bootstrap

Let's bootstrap the application on how we could probably create the executor.

#!/usr/bin/env php
<?php

$consoles = [
    SampleConsole::class,
];

use Symfony\Component\Console\Application;
$app = new Application(
    'Brood (c) Daison Cariño',
    'v0.0.1'
);

# let's check if the call came from CLI
if ( php_sapi_name() === 'cli' ) {

    # iterate the consoles array
    foreach ($consoles as $console) {
        $app->add(new $console);
    }
}

$app->run();

Save the above code as console or any you want, while slayer is brood.

Run it to your console:

php console

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-02-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固