- Code: Select all
<?php
// create the customized command
require_once "pfccommand.class.php";
class pfcCommand_help extends pfcCommand
{
function run(&$xml_reponse, $clientid, $msg)
{
// Initialisation
$c =& $this->c;
$container =& $c->getContainerInstance();
// Ignored commands list
$this->ign[] = 'init';
$return = 'Voici la liste des commandes disponible :<br /> ';
// open commands directory
if ($dh = opendir(dirname(__FILE__))) {
while (($file = readdir($dh)) !== false) {
// Test the file name, if its a command class
if(substr($file, 0, 11) == 'pfccommand_' && substr($file, strlen($file)-10, strlen($file)) == '.class.php'){
$cmd = substr($file, 11, (strlen($file)-21));
// If command isn't in ignored list, show it
if (!in_array($cmd, $this->ign)){
$return .= ' - '.$cmd.'<br /> ';
}
}
}
closedir($dh);
}
// Send commands list
$container->writeMsg("*notice*", $return);
}
}
?>
PS : sorry for my english, I'm french
