当前位置: 首页>>代码示例>>PHP>>正文


PHP PEAR_Command::getCommands方法代码示例

本文整理汇总了PHP中PEAR_Command::getCommands方法的典型用法代码示例。如果您正苦于以下问题:PHP PEAR_Command::getCommands方法的具体用法?PHP PEAR_Command::getCommands怎么用?PHP PEAR_Command::getCommands使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PEAR_Command的用法示例。


在下文中一共展示了PEAR_Command::getCommands方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: ob_implicit_flush

    @set_time_limit(0);
}
ob_implicit_flush(true);
@ini_set('track_errors', true);
@ini_set('html_errors', false);
@ini_set('magic_quotes_runtime', false);
$_PEAR_PHPDIR = '#$%^&*';
set_error_handler('error_handler');
$pear_package_version = "@pear_version@";
require_once 'PEAR.php';
require_once 'PEAR/Frontend.php';
require_once 'PEAR/Config.php';
require_once 'PEAR/Command.php';
require_once 'Console/Getopt.php';
PEAR_Command::setFrontendType('CLI');
$all_commands = PEAR_Command::getCommands();
// remove this next part when we stop supporting that crap-ass PHP 4.2
if (!isset($_SERVER['argv']) && !isset($argv) && !isset($HTTP_SERVER_VARS['argv'])) {
    die('ERROR: either use the CLI php executable, or set register_argc_argv=On in php.ini');
}
$argv = Console_Getopt::readPHPArgv();
// fix CGI sapi oddity - the -- in pear.bat/pear is not removed
if (php_sapi_name() != 'cli' && isset($argv[1]) && $argv[1] == '--') {
    unset($argv[1]);
    $argv = array_values($argv);
}
$progname = PEAR_RUNTYPE;
if (in_array('getopt2', get_class_methods('Console_Getopt'))) {
    array_shift($argv);
    $options = Console_Getopt::getopt2($argv, "c:C:d:D:Gh?sSqu:vV");
} else {
开发者ID:BackupTheBerlios,项目名称:rheinaufcms-svn,代码行数:31,代码来源:pearcmd.php

示例2: getHelp

 /**
  * Get help for command.
  *
  * @param string $command Name of the command to return help for
  *
  * @access public
  * @static
  */
 function getHelp($command)
 {
     $cmds = PEAR_Command::getCommands();
     if (isset($cmds[$command])) {
         $class = $cmds[$command];
         return $GLOBALS['_PEAR_Command_objects'][$class]->getHelp($command);
     }
     return false;
 }
开发者ID:bantudevelopment,项目名称:polysmis,代码行数:17,代码来源:Command.php

示例3: getHelp

 /**
  * Get help for command.
  *
  * @param string $command Name of the command to return help for
  *
  * @access public
  * @static
  */
 function getHelp($command)
 {
     $cmds = PEAR_Command::getCommands();
     if (isset($GLOBALS['_PEAR_Command_shortcuts'][$command])) {
         $command = $GLOBALS['_PEAR_Command_shortcuts'][$command];
     }
     if (isset($cmds[$command])) {
         $obj =& PEAR_Command::getObject($command);
         return $obj->getHelp($command);
     }
     return false;
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:20,代码来源:Command.php

示例4: run

 public function run($argv)
 {
     //        $old = error_reporting(0);
     if (!defined('PEAR_RUNTYPE')) {
         define('PEAR_RUNTYPE', 'pear');
     }
     if (!defined('PEAR_IGNORE_BACKTRACE')) {
         define('PEAR_IGNORE_BACKTRACE', 1);
     }
     @ini_set('allow_url_fopen', true);
     if (!ini_get('safe_mode')) {
         @set_time_limit(0);
     }
     ob_implicit_flush(true);
     @ini_set('track_errors', true);
     @ini_set('html_errors', false);
     @ini_set('magic_quotes_runtime', false);
     $pear_package_version = "1.9.0";
     PEAR_Command::setFrontendType('CLI');
     $this->_allCommands = PEAR_Command::getCommands();
     $progname = PEAR_RUNTYPE;
     array_shift($argv);
     $options = Console_Getopt::getopt2($argv, "c:C:d:D:Gh?sSqu:vV");
     if (PEAR::isError($options)) {
         $this->usage($options);
     }
     $opts = $options[0];
     $store_user_config = false;
     $verbose = 1;
     $config = PEAR_Config::singleton($this->_pearConfigFile, "#no#system#config#");
     if ($config instanceof PEAR_Error) {
         echo $config, "\n";
         exit(1);
     }
     $config->set('verbose', 1);
     //        $config->set('verbose', -1); // supress all kind of annoying stuff.
     $ui = PEAR_Command::getFrontendObject();
     $ui->setConfig($config);
     PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, array($this, "throwException"));
     if (ini_get('safe_mode')) {
         $ui->outputData('WARNING: running in safe mode requires that all files created ' . 'be the same uid as the current script. PHP reports this script is uid: ' . @getmyuid() . ', and current user is: ' . @get_current_user());
     }
     $verbose = $config->get("verbose");
     $cmdopts = array();
     foreach ($opts as $opt) {
         $param = !empty($opt[1]) ? $opt[1] : true;
         switch ($opt[0]) {
             case 'd':
                 if ($param === true) {
                     die('Invalid usage of "-d" option, expected -d config_value=value, ' . 'received "-d"' . "\n");
                 }
                 $possible = explode('=', $param);
                 if (count($possible) != 2) {
                     die('Invalid usage of "-d" option, expected -d config_value=value, received "' . $param . '"' . "\n");
                 }
                 list($key, $value) = explode('=', $param);
                 $config->set($key, $value, 'user');
                 break;
             case 'D':
                 if ($param === true) {
                     die('Invalid usage of "-d" option, expected -d config_value=value, ' . 'received "-d"' . "\n");
                 }
                 $possible = explode('=', $param);
                 if (count($possible) != 2) {
                     die('Invalid usage of "-d" option, expected -d config_value=value, received "' . $param . '"' . "\n");
                 }
                 list($key, $value) = explode('=', $param);
                 $config->set($key, $value, 'system');
                 break;
             case 's':
                 $store_user_config = true;
                 break;
             case 'u':
                 $config->remove($param, 'user');
                 break;
             case 'v':
                 $config->set('verbose', $config->get('verbose') + 1);
                 break;
             case 'q':
                 $config->set('verbose', $config->get('verbose') - 1);
                 break;
             case 'V':
                 $this->usage(null, 'version');
             case 'c':
             case 'C':
                 break;
             default:
                 // all non pear params goes to the command
                 $cmdopts[$opt[0]] = $param;
                 break;
         }
     }
     if ($store_user_config) {
         $config->store('user');
     }
     $command = isset($options[1][0]) ? $options[1][0] : null;
     if (empty($command) && $store_user_config) {
         exit;
     }
     if ($command == 'help') {
//.........这里部分代码省略.........
开发者ID:pago,项目名称:pantr,代码行数:101,代码来源:PearRunner.php


注:本文中的PEAR_Command::getCommands方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。