deable/console
最新稳定版本:v1.0.1
Composer 安装命令:
composer require deable/console
包简介
Simpliest way to use console on your nette project.
README 文档
README
Simple symfony console implementation for nette framework with synchronized commands. Thanks to this library, you can simplify your workflow with the console commands and Nette Framework.
Requirements
This library was developed for PHP 7.3 or newer, designed for Nette Framework version 3.1 or newer.
Installation
The best way to install this library is using Composer:
$ composer require deable/console
Usage
Add extension to your application configuration:
extensions:
console: Deable\Console\ConsoleExtension(%consoleMode%)
console:
name: App Console
url: https://my-project.lndo.site/
locksDir: %tempDir%/console-locks
search:
commands:
in: %appDir%/Console
files: *Command.php
To enable auto-detection of debug mode from console, use something like this in your Bootstrap.php:
ConsoleHelper::setupMode($configurator, function () use ($configurator) { $configurator->setDebugMode(self::COOKIE_SECRET . '@' . ($_SERVER['REMOTE_ADDR'] ?? php_uname('n'))); });
To run your console application, create file bin/console.php like this:
<?php declare(strict_types=1); use Symfony\Component\Console\Application; require __DIR__ . '/../vendor/autoload.php'; exit( App\Bootstrap::boot() ->createContainer() ->getByType(Application::class) ->run() );
Contributing
This is an open source, community-driven project. If you would like to contribute, please follow the code format as used in current sources and submit a pull request.
统计信息
- 总下载量: 554
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-02-10