Download the PHP package rougin/blueprint without Composer
On this page you can find all versions of the php package rougin/blueprint. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download rougin/blueprint
More information about rougin/blueprint
Files in rougin/blueprint
Package blueprint
Short Description A bootstrap for PHP console projects.
License MIT
Homepage https://roug.in/blueprint/
Informations about the package blueprint
Blueprint
Blueprint is a PHP package for bootstrapping console applications.
Installation
Install Blueprint via Composer:
Basic usage
Create a blueprint.php file using the initialize command:
[!NOTE]
- Replace the values specified in the
blueprint.phpfile.- Add commands and templates (if applicable) to their respective directories.
- A
blueprint.ymlfile is also supported (use--format=yml).
Before writing a command, the commands property in blueprint.php must be updated first:
Then create the command (e.g., TestCommand) to its assigned directory (e.g., src/Commands):
Before running the command, kindly check if its namespace is defined in Composer:
Extending Blueprint
To use Blueprint as a console application, the Blueprint class must be created first:
The following details can now be updated after creating the class:
[!NOTE] Using this approach means the
blueprint.phpcan now be omitted. This approach is also applicable to create customized console applications without theBlueprintbranding.
Once configured, the console application can now be run in the terminal:
Customized Command
Blueprint also provides an alternative Command class for creating commands with descriptive methods and less code:
Kindly see COMMAND for its available properties and methods.
[!NOTE] All of the functionalities for the
Commandclass is derived from theSymfony's Consolecomponent.
Injecting dependencies
To perform automagic resolutions in each defined commands, the addPackage can be used with the additional functionality from the Container class from Slytherin:
With the above-mentioned integration, for any command that uses the Sample class will get the text value as the $name property:
Changelog
Please see CHANGELOG for more recent changes.
Contributing
See CONTRIBUTING on how to contribute.
License
The MIT License (MIT). Please see LICENSE for more information.
All versions of blueprint with dependencies
rougin/slytherin Version ~0.9
symfony/console Version *
symfony/yaml Version *