PHP Classes


Recommend this page to a friend!
  Classes of nvb   PHP Executable Script Generator   Download  
Role: Documentation
Content type: text/markdown
Description: Documentation
Class: PHP Executable Script Generator
Generate shell scripts that can execute PHP code
Author: By
Last change:
Date: 2 years ago
Size: 2,755 bytes


Class file image Download

Command Line Environment for PHP

This project aims to deliver an free as in freedom, easy to use and lean as in fat free environment to create executable command line php files.

This project does not want to be competitive to a big console environment like the once mentioned below in the link section.

The versioneye status is: Dependency Status

The current change log can be found here.

Take a look on


Create Executable Command Line File

./bin/net_bazzline_create_executable_command_line_file bin/hello

Write Your Code

#open bin/hello
#replace line "$usage			= basename(__FILE__) . ' [-v|--verbose]';" with the line below
$usage			= basename(__FILE__) . ' <your name> [-v|--verbose]';
#replace the line "//put in your business logic" with the code below
//begin of dependencies
$arguments  = $environment->getArguments();
$values     = $arguments->getValues();
//end of dependencies

//begin of argument validation
$valuesNotAreValid = (count($values) == 0);

if ($valuesNotAreValid) {
    throw new InvalidArgumentException(
        'invalid number of arguments provided'
//end of argument validation

//begin of business logic
$name = ucfirst($values[0]);

$environment->outputIfVerbosityIsEnabled('provided values are: ' . implode(' ', $values));
$environment->output('Hello ' . $name);
//end of business logic

#execute ./bin/hello world



By Hand

mkdir -p vendor/net_bazzline/php_component_cli_environment
cd vendor/net_bazzline/php_component_cli_environment
git clone .

With Packagist

composer require net_bazzline/php_component_cli_environment:dev-master


API is available at