Download the PHP package yiisoft/app-console without Composer
On this page you can find all versions of the php package yiisoft/app-console. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download yiisoft/app-console
More information about yiisoft/app-console
Files in yiisoft/app-console
Package app-console
Short Description Template for console application
License BSD-3-Clause
Homepage https://www.yiiframework.com/
Informations about the package app-console
Yii Console Application
The package is a console only application template that can be used to perform common tasks in a Yii application. If you need classic web or API please start with corresponding templates:
It is based on Yii console runner that is used in the entry
command script, ./yii
. You are free to adjust any part of this template including the entry command script
to suit your needs.
Requirements
- PHP 8.1 or higher.
Creating a project
Use Composer to create new project from this template:
General usage
Console is available as ./yii
from the root directory of the application:
Help for specific command could be displayed by adding --help
to the command itself:
Using the command is like the following:
Environments
Out of the box, three environments are available:
- dev — for development.
- prod — for production.
- test — for running tests.
Config files for these are in config/environments
.
Environment could be chosen by setting YII_ENV
:
Extra debugging
To enable validation of container and events, set YII_DEBUG
environment variable:
Creating your own command
Commands are placed into src/Command
. Let's see how hello
command is implemented in src/Command/HelloCommand.php
:
To register the command, add it to config/commands.php
:
Info: Yii console is based on Symfony console so for additional usage documentation, please follow Yii console and Symfony console guide.
Events
The application raises ApplicationStartup
before and ApplicationShutdown
after running a command.
Tests
The template comes with ready to use Codeception configuration. In order to execute tests run:
Static analysis
The code is statically analyzed with Psalm. To run static analysis:
License
The Yii Console Application 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 app-console with dependencies
vlucas/phpdotenv Version ^5.3
yiisoft/aliases Version ^3.0
yiisoft/log Version ^2.0
yiisoft/log-target-file Version ^3.0
yiisoft/yii-console Version ^2.0
yiisoft/yii-runner-console Version ^2.0