Help about commands - PSF1/pharinix GitHub Wiki
Pharinix have help integrated over all commands. At home page you can see three blocks:
- URL Decoder/Encoder: This block help to convert POST params to URL encoded string. This way you can pass params into the Direct command block.
- Command help: Quick help about commands, type the command name & press help.
- Direct command: With this you can execute a command, with the params required. At down left you can see a button called 'Command's help', it open a new windows with all commands and help about each one.
All commands have the next structure:
//TODO: Update commands wiki.
if (!class_exists("commandNothing")) {
class commandNothing extends driverCommand {
public static function runMe(&$params, $debug = true) {
if(CMS_DEBUG) echo "<i>I do nothing...</i>";
}
public static function getHelp() {
return array(
"package" => 'core', // Module slugname
"description" => __("Nothing to do"), // Command description
"parameters" => array(), // Parameters description
"response" => array(), // Response description
"type" => array(
"parameters" => array(), // Parameters type declarations
"response" => array(), // Response type declarations
),
"echo" => false, // TRUE if the command output to the client
"interface" => true, // TRUE if the command transform and output parameters to the client
// "hooks" => array( // Hooks declarations
// array(
// "name" => "nothingHook",
// "description" => "sadasdaAllow rewrite a HTML alert message.",
// "parameters" => array(
// "alert" => "asdasdResponse to be echoed to the client.",
// "msg" => "asdasdThe message to show."
// )
// )
// )
);
}
}
}
return new commandNothing();
When Pharinix call driverCommand::run('nothing', ...), for example, it search the file 'nothing.php' in each path, load the file, and execute commandNothing::run($params). See https://github.com/PSF1/pharinix/wiki/Database-information
While in Linux commands names are case insensitive, in Windows aren't. When Pharinix find a file of a command stop search more, by that, if two commands have the some name in two diferents path it only run one of them.
//TODO: Describe access control over commands.
If the user search help, how described at top of this text, Pharinix call commandNothing::getHelp.