* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id: Command.php 313023 2011-07-06 19:17:11Z dufuz $
* @link http://pear.php.net/package/PEAR
* @since File available since Release 0.1
*/
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version Release: 1.9.4
+ * @version Release: 1.10.1
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 0.1
*/
* @param object $config Instance of PEAR_Config object
*
* @return object the command object or a PEAR error
- *
- * @access public
- * @static
*/
- function &factory($command, &$config)
+ public static function &factory($command, &$config)
{
if (empty($GLOBALS['_PEAR_Command_commandlist'])) {
PEAR_Command::registerCommands();
return $a;
}
$ui =& PEAR_Command::getFrontendObject();
- $obj = &new $class($ui, $config);
+ $obj = new $class($ui, $config);
return $obj;
}
// }}}
// {{{ & getObject()
- function &getObject($command)
+ public static function &getObject($command)
{
$class = $GLOBALS['_PEAR_Command_commandlist'][$command];
if (!class_exists($class)) {
}
$ui =& PEAR_Command::getFrontendObject();
$config = &PEAR_Config::singleton();
- $obj = &new $class($ui, $config);
+ $obj = new $class($ui, $config);
return $obj;
}
* Get instance of frontend object.
*
* @return object|PEAR_Error
- * @static
*/
- function &getFrontendObject()
+ public static function &getFrontendObject()
{
$a = &PEAR_Frontend::singleton();
return $a;
* @param string $uiclass Name of class implementing the frontend
*
* @return object the frontend object, or a PEAR error
- * @static
*/
- function &setFrontendClass($uiclass)
+ public static function &setFrontendClass($uiclass)
{
$a = &PEAR_Frontend::setFrontendClass($uiclass);
return $a;
* @param string $uitype Name of the frontend type (for example "CLI")
*
* @return object the frontend object, or a PEAR error
- * @static
*/
- function setFrontendType($uitype)
+ public static function setFrontendType($uitype)
{
$uiclass = 'PEAR_Frontend_' . $uitype;
return PEAR_Command::setFrontendClass($uiclass);
* included.
*
* @return bool TRUE on success, a PEAR error on failure
- *
- * @access public
- * @static
*/
- function registerCommands($merge = false, $dir = null)
+ public static function registerCommands($merge = false, $dir = null)
{
$parser = new PEAR_XMLParser;
if ($dir === null) {
* classes implement them.
*
* @return array command => implementing class
- *
- * @access public
- * @static
*/
- function getCommands()
+ public static function getCommands()
{
if (empty($GLOBALS['_PEAR_Command_commandlist'])) {
PEAR_Command::registerCommands();
* Get the list of command shortcuts.
*
* @return array shortcut => command
- *
- * @access public
- * @static
*/
- function getShortcuts()
+ public static function getShortcuts()
{
if (empty($GLOBALS['_PEAR_Command_shortcuts'])) {
PEAR_Command::registerCommands();
* @param array $long_args (reference) long getopt format
*
* @return void
- *
- * @access public
- * @static
*/
- function getGetoptArgs($command, &$short_args, &$long_args)
+ public static function getGetoptArgs($command, &$short_args, &$long_args)
{
if (empty($GLOBALS['_PEAR_Command_commandlist'])) {
PEAR_Command::registerCommands();
* @param string $command Name of the command
*
* @return string command description
- *
- * @access public
- * @static
*/
- function getDescription($command)
+ public static function getDescription($command)
{
if (!isset($GLOBALS['_PEAR_Command_commanddesc'][$command])) {
return null;
* Get help for command.
*
* @param string $command Name of the command to return help for
- *
- * @access public
- * @static
*/
- function getHelp($command)
+ public static function getHelp($command)
{
$cmds = PEAR_Command::getCommands();
if (isset($GLOBALS['_PEAR_Command_shortcuts'][$command])) {