1. Go to this page and download the library: Download brzuchal/command-line library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
$parser = new \Brzuchal\CommandLine\ArrayCommandLineParser($_SERVER['argv']);
$commandLine = $parser->parse();
$definition = new \Brzuchal\CommandLine\Definition([
new \Brzuchal\CommandLine\ArgumentDefinition('command'),
new \Brzuchal\CommandLine\OptionDefinition('env', 'e'),
new \Brzuchal\CommandLine\OptionDefinition('file', 'f'),
new \Brzuchal\CommandLine\OptionDefinition('count', 'c'),
]);
$parser = new \Brzuchal\CommandLine\ArrayParameterParser($_SERVER['argv']);
$parameters = $parser->parse();
ENV=prod // this is shell way for setting environment variables per process
php // this part is pointing to php interpreter
-d "error_reporting=E_ALL" // this part holds php interpreter options
script.php // visible at runtime script filename
test // visible at runtime arguments
--debug // visible at runtime options
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.