Download the PHP package yiisoft/yii-console without Composer
On this page you can find all versions of the php package yiisoft/yii-console. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download yiisoft/yii-console
More information about yiisoft/yii-console
Files in yiisoft/yii-console
Package yii-console
Short Description Symfony console wrapper with additional features
License BSD-3-Clause
Homepage https://www.yiiframework.com/
Informations about the package yii-console
Yii Console
Yii Console package provides a console that could be added to an application. This console is based on Symfony Console. The following extra features are added:
- lazy command loader;
SymfonyEventDispatcher
class that allows to use any PSR-14 compatible event dispatcher with Symfony console;ErrorListener
for logging console errors to any PSR-3 compatible logger;- console command
serve
that runs PHP built-in web server; - raises events
ApplicationStartup
andApplicationShutdown
in console application; - class
ExitCode
that contains constants for defining console command exit codes; ConsoleBufferedOutput
that wrapsConsoleOutput
and buffers console output.
Requirements
- PHP 8.0 or higher.
Installation
The package could be installed with Composer:
General usage
In case you use one of Yii 3 standard application templates, console could be accessed as ./yii <command>
.
If not, then in the simplest use case in your console entry script do the following:
Since \Yiisoft\Yii\Console\CommandLoader
uses lazy loading of commands, it's necessary
to specify the name and description in static properties when creating a command:
Run the console entry script with your command:
When naming commands use
:
as a separator. For example:user:create
,user:delete
, etc.
Since the package is based on Symfony Console component, refer to its documentation for details on how to use the binary and create your own commands.
Aliases and hidden commands
To configure commands, set the names and aliases in \Yiisoft\Yii\Console\CommandLoader
configuration.
Names and aliases from the command class itself are always ignored.
The command can be marked as hidden by prefixing its name with |
.
Runs PHP built-in web server
You can start local built-in web development server using the command:
Your application will be accessible in your web browser at http://localhost:8080 by default.
To configure default settings, set the options in \Yiisoft\Yii\Console\CommandLoader
configuration.
Alternatively, you can pass the settings through the console options.
Tip: To run a web server with XDebug enabled, pass
--xdebug 1
to the command.
To see the available options, run ./yii serve --help
.
Documentation
- Internals
If you need help or have a question, the Yii Forum is a good place for that. You may also check out other Yii Community Resources.
License
The Yii Console is free software. It is released under the terms of the BSD License.
Please see LICENSE
for more information.
Maintained by Yii Software.
Support the project
Follow updates
All versions of yii-console with dependencies
psr/container Version ^1.0|^2.0
psr/event-dispatcher Version ^1.0
psr/log Version ^1.0|^2.0|^3.0
symfony/console Version ^5.4|^6.0|^7.0
symfony/event-dispatcher-contracts Version ^2.2|^3.0
yiisoft/friendly-exception Version ^1.0