PHP Class Cli

* * @package Ninaca * @author Nivl * @started 09/01/2009, 01:29 AM * @last Nivl 05/05/2010, 03:16 PM * @link http://nivl.free.fr * @copyright Copyright (C) 2009 Laplanche Melvin * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see .
Afficher le fichier Open project: datasift/datasift-php Class Usage Examples

Protected Properties

Свойство Type Description
$arguments array Arguments
$commands array Commands
$options array Options

Méthodes publiques

Méthode Description
__construct ( array $arguments ) Constructor
callCommand ( object &$object, string $command, array $params, DataSiftUser &$user, $pretty = false ) : mixed Call the command required
getArguments ( ) : array Get the arguments
getCallParameters ( array $allowableParams, array $parameters, DataSift_User &$user ) : array Get the parameters for the call
getCommands ( ) : array Get the list of commands
getEndPointObject ( string $endpoint, DataSift_User &$user ) : object Get the object for target endpoint
getOptions ( ) : type Get the list of options
parseInput ( ) : array Parse the input parameters correctly
printHelp ( ) Print the help
setArguments ( array $arguments ) Set the arguments
validateCommands ( array $parsedOptions ) : boolean Validate the parsed options

Méthodes protégées

Méthode Description
getCommandLineOptions ( ) : array Process the command line options
optionMerge ( array $mergeKeys, array $options ) : array Function to merge any occurances of the same option chosen with long and short to a single array
parseAuth ( array $auth ) : array Convert the auth to the array required
sortParams ( array $params ) : array Sorts the parameters into matched pairs

Method Details

__construct() public méthode

Constructor
public __construct ( array $arguments )
$arguments array

callCommand() public méthode

Call the command required
public callCommand ( object &$object, string $command, array $params, DataSiftUser &$user, $pretty = false ) : mixed
$object object
$command string
$params array
$user DataSiftUser
Résultat mixed

getArguments() public méthode

Get the arguments
public getArguments ( ) : array
Résultat array

getCallParameters() public méthode

Get the parameters for the call
public getCallParameters ( array $allowableParams, array $parameters, DataSift_User &$user ) : array
$allowableParams array
$parameters array
$user DataSift_User
Résultat array

getCommandLineOptions() protected méthode

Process the command line options
protected getCommandLineOptions ( ) : array
Résultat array

getCommands() public méthode

Get the list of commands
public getCommands ( ) : array
Résultat array

getEndPointObject() public méthode

Get the object for target endpoint
public getEndPointObject ( string $endpoint, DataSift_User &$user ) : object
$endpoint string
$user DataSift_User
Résultat object

getOptions() public méthode

Get the list of options
public getOptions ( ) : type
Résultat type

optionMerge() protected méthode

Function to merge any occurances of the same option chosen with long and short to a single array
protected optionMerge ( array $mergeKeys, array $options ) : array
$mergeKeys array
$options array
Résultat array

parseAuth() protected méthode

Convert the auth to the array required
protected parseAuth ( array $auth ) : array
$auth array
Résultat array

parseInput() public méthode

Parse the input parameters correctly
public parseInput ( ) : array
Résultat array

printHelp() public méthode

Print the help
public printHelp ( )

setArguments() public méthode

Set the arguments
public setArguments ( array $arguments )
$arguments array

sortParams() protected méthode

Sorts the parameters into matched pairs
protected sortParams ( array $params ) : array
$params array
Résultat array

validateCommands() public méthode

Validate the parsed options
public validateCommands ( array $parsedOptions ) : boolean
$parsedOptions array
Résultat boolean

Property Details

$arguments protected_oe property

Arguments
protected array $arguments
Résultat array

$commands protected_oe property

Commands
protected array $commands
Résultat array

$options protected_oe property

Options
protected array $options
Résultat array