phppro / pm
PM
Requires (Dev)
- phppro/build-tools: 1.0.*
- phpunit/phpunit: 3.7.*
- tecnick.com/tcpdf: 6.0.053
This package is not auto-updated.
Last update: 2017-12-29 15:23:52 UTC
README
PM is a generic command line tool aimed to help you manage tasks on your project. With PM, you can create custom tasks such as packaging, auditing, deploying by using its internal API based on services.
First of all, you need to add support for PM to your project :
$ php pm.phar init
a pm.json file will then be generated at the root of your project.
This first init step is optional, but will help you customize PM in the future, so it is recommanded to do it first.
To list all command on pm :
$ php pm.phar -h
To excecute a command :
$ php pm.phar [options] <command> [args]
By default, PM is quite empty and let you the hard stuff of creating custom command. Command creation is as easy as creating a class with a method inside the src/ folder :
// src/MyCommand
<?php
class MyCommand
{
public function execute()
{
echo "Hello world !";
}
}
and then executing it :
$ php pm.phar my-command
Of course you can use options and arguments in your command :
<?php
class MyCommand2
{
public function execute($args, $options)
{
echo "First argument is : " . $args[0] . (isset($options['myoption']) ? " and 'my option' is set";
}
}
and call :
$ php pm.phar my-command2 hello --myoption