gameplayjdk/slim-console 问题修复 & 功能扩展

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

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

gameplayjdk/slim-console

Composer 安装命令:

composer require gameplayjdk/slim-console

包简介

The minimalistic slim framework console implementation.

README 文档

README

The minimalistic slim framework console implementation.

About

So, what exactly is this package?

Well, it is a simple library for Slim Framework 3 that allows you to call controller actions from the console.

It utilizes the strategy design pattern to provide a flexible way of parsing a given argv array.

You can find more information on the php argv variable here.

Further it provides a small middleware class, designed to stop web-access to these actions.

Installation

Run composer require gameplayjdk/slim-console.

Yes, it's that simple.

Usage

Initial setup:

<?php
// ...

$configuration = [];

$console = new \Slim\Console\Console();

if ($console->isSupported()) {
    $configuration['environment'] = $console->getEnvironment($argv);
}

$configuration['settings'] = [
    // ...
];

$app = new \Slim\App($configuration);

// ...

Middleware usage:

<?php

// ...

$app->get('/cli/some-command', \App\Controller\CliController::class . ':someCommandAction')
    ->add($console->getMiddleware());

// ...

Call that action from the console:

php app.php cli some-command 

License

The MIT license.

Open TODOs

  • Write up some unittests
  • More ArgvParserInterface implementations

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-09-15

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固