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

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

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

new3den/console

Composer 安装命令:

composer require new3den/console

包简介

Console library

README 文档

README

Requirements

  1. PSR-11 compatible container
  2. PHP8.0 or higher

bin/console example

<?php
declare(strict_types=1);

$autoloaderPath = __DIR__ . '/../vendor/autoload.php';
if(!file_exists($autoloaderPath)) {
    throw new RuntimeException('Error, composer is not setup correctly.. Please run composer install');
}

$autoloader = require $autoloaderPath;

# Container
$container = new \League\Container\Container();

# Autowiring
$container->delegate(new \League\Container\ReflectionContainer());

# Load the CLI
$cli = new \New3den\Console\Console($container, $autoloader);

# Define the class scope to load commands from
$cli->setCommandsNamespace('New3den\\Commands');

# Define the name
$cli->setConsoleName('New3den');

# Define the version
$cli->setVersion('1.0.0');

# Run the cli
$cli->run();

Command example

<?php
declare(strict_types=1);

namespace New3den\Commands;

/**
 * @property string $stringInput
 */
class Command extends \New3den\Console\ConsoleCommand
{
    protected string $signature = 'command {--stringInput=Hello World : Some string to pass into the command }';
    protected string $description = 'This is an example command';
    
    public function handle(): void
    {
        $this->out($this->stringInput);
    }
}

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-03-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固