2017 © Pedro Peláez
 

library terminal-request

Powerful tool for commands

image

stdakov/terminal-request

Powerful tool for commands

  • Friday, March 31, 2017
  • by stdakov
  • Repository
  • 1 Watchers
  • 0 Stars
  • 2 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

terminalRequest

Installation

The preferred way to install this tool is through composer., (*1)

Either run, (*2)

php composer.phar require stdakov/terminal-request

or add, (*3)

"stdakov/terminal-request": "*"

Usage

require 'vendor/autoload.php';

Examples

php script.php command subCommand -a value1 -bc 'value2' --param1 value3 --param2 --pa "value4" --vk value5

$terminal = new Terminal\Request(); echo "Script:" . $terminal->getScript() . PHP_EOL; echo "Command:" . $terminal->getCommand() . PHP_EOL; echo "SubCommand:" . $terminal->getSubCommand() . PHP_EOL; foreach ($terminal->getParams() as $paramName => $paramValue) { echo "Param $paramName has value '" . ($terminal->getParameter($paramName) === true ? "true" : $terminal->getParameter($paramName)) . "'" . PHP_EOL; } print_r($terminal->getParams());

Output, (*4)

Script:script.php
Command:command
SubCommand:subCommand
Param a has value 'value1'
Param b has value 'true'
Param c has value 'value2'
Param param1 has value 'value3'
Param param2 has value 'true'
Param pa has value 'value4'
Param vk has value 'value5'
<pre>Array
(
    [a] => value1
    [b] => 1
    [c] => value2
    [param1] => value3
    [param2] => 1
    [pa] => value4
    [vk] => value5
)

The Versions

31/03 2017

dev-master

9999999-dev

Powerful tool for commands

  Sources   Download

Apache

The Requires

  • php >=5.4.0

 

by Stanislav Dakov

console commands terminal request

31/03 2017

v1.0

1.0.0.0

Powerful tool for commands

  Sources   Download

Apache

The Requires

  • php >=5.4.0

 

by Stanislav Dakov

console commands terminal request