Source for file help.cmdline.php

Documentation is available at help.cmdline.php

  1. <?php
  2. /**
  3. @package    jelix-modules
  4. @subpackage jelix
  5. @author     Loic Mathaud
  6. @copyright  2006 Loic Mathaud
  7. @licence    http://www.gnu.org/licenses/gpl.html GNU General Public Licence, see LICENCE file
  8. */
  9.  
  10. /**
  11.  * @package    jelix-modules
  12.  * @subpackage jelix
  13.  */
  14. class helpCtrl extends jControllerCmdLine {
  15.     protected $allowed_options = array(
  16.             'index' => array());
  17.  
  18.     protected $allowed_parameters = array(
  19.             'index' => array('cmd_name' => false));
  20.  
  21.     /**
  22.     *
  23.     */
  24.     public function index({
  25.         global $gJConfig;
  26.  
  27.         $rep $this->getResponse('text');
  28.  
  29.         $cmd_name $this->param('cmd_name');
  30.  
  31.         if (empty($cmd_name)) {
  32.             $rep->content "
  33. General purpose:
  34.     php cmdline.php help [COMMAND]
  35.  
  36.     COMMAND : name of the command to launch
  37.                'module~controller:action' or more simply
  38.                'controller:action' or 'action', depending of the app configuration
  39. ";
  40.         else {
  41.             if (!preg_match('/(?:([\w\.]+)~)/'$cmd_name)) {
  42.                 $cmd_name $gJConfig->startModule.'~'.$cmd_name;
  43.             }
  44.             $selector new jSelectorAct($cmd_name);
  45.  
  46.             include($selector->getPath());
  47.             $ctrl $selector->getClass();
  48.             $ctrl new $ctrl(null);
  49.             $help $ctrl->help;
  50.  
  51.             $rep->content "
  52. Use of the command "$selector->method ." :
  53. ";
  54.             if (isset($help[$selector->method]&& $help[$selector->method!=''{
  55.                 $rep->content .= $help[$selector->method]."\n\n";
  56.             else {
  57.                 $rep->content .= "\tNo available help for this command\n\n";
  58.             }
  59.         }
  60.         return $rep;
  61.     }
  62. }
  63. ?>

Documentation generated on Wed, 07 Sep 2011 13:46:37 +0200 by phpDocumentor 1.4.3