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
Creating a new blueprint.yml
Create a blueprint.yml
file by running the initialize
command:
[!NOTE]
- Replace the values specified in the
blueprint.yml
file.- Add commands and templates (if applicable) to their respective directories.
Creating a command
Prior to creating a command, the commands
property in blueprint.yml
must be updated:
Then create the command (e.g., TestCommand
) to the specified directory:
Updating the composer.json
After creating the command (e.g., TestCommand
), kindly check if its namespace is defined in Composer
:
Running the command
The created commands will be recognized automatically by Blueprint. With this, it could be executed in the same blueprint
command:
Extending Blueprint
The v0.7.0
version introduces a way to extend the Blueprint
package to use it as the console application for specified projects.
Initializing the instance
To initialize a console application, the Blueprint
class must be created first:
After creating the Blueprint
class, the following details can now be updated:
[!NOTE] Using this approach means the
blueprint.yml
can now be omitted. This approach is also applicable to create customized console applications without theBlueprint
branding.
Then run the console application in the terminal:
Customized Command
class
Blueprint
also provides an alternative Command
class for creating commands with descriptive methods and less code:
[!NOTE] All of the functionalities for the
Command
class is derived from theSymfony's Console
component.
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 information what has changed recently.
Testing
Credits
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 ~2.8|~3.0|~4.0|~5.0|~6.0
symfony/yaml Version ~2.8|~3.0|~4.0|~5.0|~6.0