PEAR
[ class tree: PEAR ] [ index: PEAR ] [ all elements ]

Source for file Install.php

Documentation is available at Install.php

  1. <?php
  2. /**
  3.  * PEAR_Command_Install (install, upgrade, upgrade-all, uninstall, bundle, run-scripts commands)
  4.  *
  5.  * PHP versions 4 and 5
  6.  *
  7.  * @category   pear
  8.  * @package    PEAR
  9.  * @author     Stig Bakken <ssb@php.net>
  10.  * @author     Greg Beaver <cellog@php.net>
  11.  * @copyright  1997-2009 The Authors
  12.  * @license    http://opensource.org/licenses/bsd-license.php New BSD License
  13.  * @version    CVS: $Id: Install.php 313023 2011-07-06 19:17:11Z dufuz $
  14.  * @link       http://pear.php.net/package/PEAR
  15.  * @since      File available since Release 0.1
  16.  */
  17.  
  18. /**
  19.  * base class
  20.  */
  21. require_once 'PEAR/Command/Common.php';
  22.  
  23. /**
  24.  * PEAR commands for installation or deinstallation/upgrading of
  25.  * packages.
  26.  *
  27.  * @category   pear
  28.  * @package    PEAR
  29.  * @author     Stig Bakken <ssb@php.net>
  30.  * @author     Greg Beaver <cellog@php.net>
  31.  * @copyright  1997-2009 The Authors
  32.  * @license    http://opensource.org/licenses/bsd-license.php New BSD License
  33.  * @version    Release: 1.9.4
  34.  * @link       http://pear.php.net/package/PEAR
  35.  * @since      Class available since Release 0.1
  36.  */
  37. {
  38.     // {{{ properties
  39.  
  40.     var $commands = array(
  41.         'install' => array(
  42.             'summary' => 'Install Package',
  43.             'function' => 'doInstall',
  44.             'shortcut' => 'i',
  45.             'options' => array(
  46.                 'force' => array(
  47.                     'shortopt' => 'f',
  48.                     'doc' => 'will overwrite newer installed packages',
  49.                     ),
  50.                 'loose' => array(
  51.                     'shortopt' => 'l',
  52.                     'doc' => 'do not check for recommended dependency version',
  53.                     ),
  54.                 'nodeps' => array(
  55.                     'shortopt' => 'n',
  56.                     'doc' => 'ignore dependencies, install anyway',
  57.                     ),
  58.                 'register-only' => array(
  59.                     'shortopt' => 'r',
  60.                     'doc' => 'do not install files, only register the package as installed',
  61.                     ),
  62.                 'soft' => array(
  63.                     'shortopt' => 's',
  64.                     'doc' => 'soft install, fail silently, or upgrade if already installed',
  65.                     ),
  66.                 'nobuild' => array(
  67.                     'shortopt' => 'B',
  68.                     'doc' => 'don\'t build C extensions',
  69.                     ),
  70.                 'nocompress' => array(
  71.                     'shortopt' => 'Z',
  72.                     'doc' => 'request uncompressed files when downloading',
  73.                     ),
  74.                 'installroot' => array(
  75.                     'shortopt' => 'R',
  76.                     'arg' => 'DIR',
  77.                     'doc' => 'root directory used when installing files (ala PHP\'s INSTALL_ROOT), use packagingroot for RPM',
  78.                     ),
  79.                 'packagingroot' => array(
  80.                     'shortopt' => 'P',
  81.                     'arg' => 'DIR',
  82.                     'doc' => 'root directory used when packaging files, like RPM packaging',
  83.                     ),
  84.                 'ignore-errors' => array(
  85.                     'doc' => 'force install even if there were errors',
  86.                     ),
  87.                 'alldeps' => array(
  88.                     'shortopt' => 'a',
  89.                     'doc' => 'install all required and optional dependencies',
  90.                     ),
  91.                 'onlyreqdeps' => array(
  92.                     'shortopt' => 'o',
  93.                     'doc' => 'install all required dependencies',
  94.                     ),
  95.                 'offline' => array(
  96.                     'shortopt' => 'O',
  97.                     'doc' => 'do not attempt to download any urls or contact channels',
  98.                     ),
  99.                 'pretend' => array(
  100.                     'shortopt' => 'p',
  101.                     'doc' => 'Only list the packages that would be downloaded',
  102.                     ),
  103.                 ),
  104.             'doc' => '[channel/]<package> ...
  105. Installs one or more PEAR packages.  You can specify a package to
  106. install in four ways:
  107.  
  108. "Package-1.0.tgz" : installs from a local file
  109.  
  110. "http://example.com/Package-1.0.tgz" : installs from
  111. anywhere on the net.
  112.  
  113. "package.xml" : installs the package described in
  114. package.xml.  Useful for testing, or for wrapping a PEAR package in
  115. another package manager such as RPM.
  116.  
  117. "Package[-version/state][.tar]" : queries your default channel\'s server
  118. ({config master_server}) and downloads the newest package with
  119. the preferred quality/state ({config preferred_state}).
  120.  
  121. To retrieve Package version 1.1, use "Package-1.1," to retrieve
  122. Package state beta, use "Package-beta."  To retrieve an uncompressed
  123. file, append .tar (make sure there is no file by the same name first)
  124.  
  125. To download a package from another channel, prefix with the channel name like
  126. "channel/Package"
  127.  
  128. More than one package may be specified at once.  It is ok to mix these
  129. four ways of specifying packages.
  130. '),
  131.         'upgrade' => array(
  132.             'summary' => 'Upgrade Package',
  133.             'function' => 'doInstall',
  134.             'shortcut' => 'up',
  135.             'options' => array(
  136.                 'channel' => array(
  137.                     'shortopt' => 'c',
  138.                     'doc' => 'upgrade packages from a specific channel',
  139.                     'arg' => 'CHAN',
  140.                     ),
  141.                 'force' => array(
  142.                     'shortopt' => 'f',
  143.                     'doc' => 'overwrite newer installed packages',
  144.                     ),
  145.                 'loose' => array(
  146.                     'shortopt' => 'l',
  147.                     'doc' => 'do not check for recommended dependency version',
  148.                     ),
  149.                 'nodeps' => array(
  150.                     'shortopt' => 'n',
  151.                     'doc' => 'ignore dependencies, upgrade anyway',
  152.                     ),
  153.                 'register-only' => array(
  154.                     'shortopt' => 'r',
  155.                     'doc' => 'do not install files, only register the package as upgraded',
  156.                     ),
  157.                 'nobuild' => array(
  158.                     'shortopt' => 'B',
  159.                     'doc' => 'don\'t build C extensions',
  160.                     ),
  161.                 'nocompress' => array(
  162.                     'shortopt' => 'Z',
  163.                     'doc' => 'request uncompressed files when downloading',
  164.                     ),
  165.                 'installroot' => array(
  166.                     'shortopt' => 'R',
  167.                     'arg' => 'DIR',
  168.                     'doc' => 'root directory used when installing files (ala PHP\'s INSTALL_ROOT)',
  169.                     ),
  170.                 'ignore-errors' => array(
  171.                     'doc' => 'force install even if there were errors',
  172.                     ),
  173.                 'alldeps' => array(
  174.                     'shortopt' => 'a',
  175.                     'doc' => 'install all required and optional dependencies',
  176.                     ),
  177.                 'onlyreqdeps' => array(
  178.                     'shortopt' => 'o',
  179.                     'doc' => 'install all required dependencies',
  180.                     ),
  181.                 'offline' => array(
  182.                     'shortopt' => 'O',
  183.                     'doc' => 'do not attempt to download any urls or contact channels',
  184.                     ),
  185.                 'pretend' => array(
  186.                     'shortopt' => 'p',
  187.                     'doc' => 'Only list the packages that would be downloaded',
  188.                     ),
  189.                 ),
  190.             'doc' => '<package> ...
  191. Upgrades one or more PEAR packages.  See documentation for the
  192. "install" command for ways to specify a package.
  193.  
  194. When upgrading, your package will be updated if the provided new
  195. package has a higher version number (use the -f option if you need to
  196. upgrade anyway).
  197.  
  198. More than one package may be specified at once.
  199. '),
  200.         'upgrade-all' => array(
  201.             'summary' => 'Upgrade All Packages [Deprecated in favor of calling upgrade with no parameters]',
  202.             'function' => 'doUpgradeAll',
  203.             'shortcut' => 'ua',
  204.             'options' => array(
  205.                 'channel' => array(
  206.                     'shortopt' => 'c',
  207.                     'doc' => 'upgrade packages from a specific channel',
  208.                     'arg' => 'CHAN',
  209.                     ),
  210.                 'nodeps' => array(
  211.                     'shortopt' => 'n',
  212.                     'doc' => 'ignore dependencies, upgrade anyway',
  213.                     ),
  214.                 'register-only' => array(
  215.                     'shortopt' => 'r',
  216.                     'doc' => 'do not install files, only register the package as upgraded',
  217.                     ),
  218.                 'nobuild' => array(
  219.                     'shortopt' => 'B',
  220.                     'doc' => 'don\'t build C extensions',
  221.                     ),
  222.                 'nocompress' => array(
  223.                     'shortopt' => 'Z',
  224.                     'doc' => 'request uncompressed files when downloading',
  225.                     ),
  226.                 'installroot' => array(
  227.                     'shortopt' => 'R',
  228.                     'arg' => 'DIR',
  229.                     'doc' => 'root directory used when installing files (ala PHP\'s INSTALL_ROOT), use packagingroot for RPM',
  230.                     ),
  231.                 'ignore-errors' => array(
  232.                     'doc' => 'force install even if there were errors',
  233.                     ),
  234.                 'loose' => array(
  235.                     'doc' => 'do not check for recommended dependency version',
  236.                     ),
  237.                 ),
  238.             'doc' => '
  239. WARNING: This function is deprecated in favor of using the upgrade command with no params
  240.  
  241. Upgrades all packages that have a newer release available.  Upgrades are
  242. done only if there is a release available of the state specified in
  243. "preferred_state" (currently {config preferred_state}), or a state considered
  244. more stable.
  245. '),
  246.         'uninstall' => array(
  247.             'summary' => 'Un-install Package',
  248.             'function' => 'doUninstall',
  249.             'shortcut' => 'un',
  250.             'options' => array(
  251.                 'nodeps' => array(
  252.                     'shortopt' => 'n',
  253.                     'doc' => 'ignore dependencies, uninstall anyway',
  254.                     ),
  255.                 'register-only' => array(
  256.                     'shortopt' => 'r',
  257.                     'doc' => 'do not remove files, only register the packages as not installed',
  258.                     ),
  259.                 'installroot' => array(
  260.                     'shortopt' => 'R',
  261.                     'arg' => 'DIR',
  262.                     'doc' => 'root directory used when installing files (ala PHP\'s INSTALL_ROOT)',
  263.                     ),
  264.                 'ignore-errors' => array(
  265.                     'doc' => 'force install even if there were errors',
  266.                     ),
  267.                 'offline' => array(
  268.                     'shortopt' => 'O',
  269.                     'doc' => 'do not attempt to uninstall remotely',
  270.                     ),
  271.                 ),
  272.             'doc' => '[channel/]<package> ...
  273. Uninstalls one or more PEAR packages.  More than one package may be
  274. specified at once.  Prefix with channel name to uninstall from a
  275. channel not in your default channel ({config default_channel})
  276. '),
  277.         'bundle' => array(
  278.             'summary' => 'Unpacks a Pecl Package',
  279.             'function' => 'doBundle',
  280.             'shortcut' => 'bun',
  281.             'options' => array(
  282.                 'destination' => array(
  283.                    'shortopt' => 'd',
  284.                     'arg' => 'DIR',
  285.                     'doc' => 'Optional destination directory for unpacking (defaults to current path or "ext" if exists)',
  286.                     ),
  287.                 'force' => array(
  288.                     'shortopt' => 'f',
  289.                     'doc' => 'Force the unpacking even if there were errors in the package',
  290.                 ),
  291.             ),
  292.             'doc' => '<package>
  293. Unpacks a Pecl Package into the selected location. It will download the
  294. package if needed.
  295. '),
  296.         'run-scripts' => array(
  297.             'summary' => 'Run Post-Install Scripts bundled with a package',
  298.             'function' => 'doRunScripts',
  299.             'shortcut' => 'rs',
  300.             'options' => array(
  301.             ),
  302.             'doc' => '<package>
  303. Run post-installation scripts in package <package>, if any exist.
  304. '),
  305.     );
  306.  
  307.     // }}}
  308.     // {{{ constructor
  309.  
  310.     /**
  311.      * PEAR_Command_Install constructor.
  312.      *
  313.      * @access public
  314.      */
  315.     function PEAR_Command_Install(&$ui&$config)
  316.     {
  317.         parent::PEAR_Command_Common($ui$config);
  318.     }
  319.  
  320.     // }}}
  321.  
  322.     /**
  323.      * For unit testing purposes
  324.      */
  325.     function &getDownloader(&$ui$options&$config)
  326.     {
  327.         if (!class_exists('PEAR_Downloader')) {
  328.             require_once 'PEAR/Downloader.php';
  329.         }
  330.         $a &new PEAR_Downloader($ui$options$config);
  331.         return $a;
  332.     }
  333.  
  334.     /**
  335.      * For unit testing purposes
  336.      */
  337.     function &getInstaller(&$ui)
  338.     {
  339.         if (!class_exists('PEAR_Installer')) {
  340.             require_once 'PEAR/Installer.php';
  341.         }
  342.         $a &new PEAR_Installer($ui);
  343.         return $a;
  344.     }
  345.  
  346.     function enableExtension($binaries$type)
  347.     {
  348.         if (!($phpini $this->config->get('php_ini'null'pear.php.net'))) {
  349.             return PEAR::raiseError('configuration option "php_ini" is not set to php.ini location');
  350.         }
  351.         $ini $this->_parseIni($phpini);
  352.         if (PEAR::isError($ini)) {
  353.             return $ini;
  354.         }
  355.         $line = 0;
  356.         if ($type == 'extsrc' || $type == 'extbin'{
  357.             $search 'extensions';
  358.             $enable 'extension';
  359.         else {
  360.             $search 'zend_extensions';
  361.             ob_start();
  362.             phpinfo(INFO_GENERAL);
  363.             $info ob_get_contents();
  364.             ob_end_clean();
  365.             $debug function_exists('leak''_debug' '';
  366.             $ts preg_match('/Thread Safety.+enabled/'$info'_ts' '';
  367.             $enable 'zend_extension' $debug $ts;
  368.         }
  369.         foreach ($ini[$searchas $line => $extension{
  370.             if (in_array($extension$binariestrue|| in_array(
  371.                   $ini['extension_dir'. DIRECTORY_SEPARATOR . $extension$binariestrue)) {
  372.                 // already enabled - assume if one is, all are
  373.                 return true;
  374.             }
  375.         }
  376.         if ($line{
  377.             $newini array_slice($ini['all']0$line);
  378.         else {
  379.             $newini = array();
  380.         }
  381.         foreach ($binaries as $binary{
  382.             if ($ini['extension_dir']{
  383.                 $binary basename($binary);
  384.             }
  385.             $newini[$enable '="' $binary '"' (OS_UNIX ? "\n" "\r\n");
  386.         }
  387.         $newini array_merge($newiniarray_slice($ini['all']$line));
  388.         $fp @fopen($phpini'wb');
  389.         if (!$fp{
  390.             return PEAR::raiseError('cannot open php.ini "' $phpini '" for writing');
  391.         }
  392.         foreach ($newini as $line{
  393.             fwrite($fp$line);
  394.         }
  395.         fclose($fp);
  396.         return true;
  397.     }
  398.  
  399.     function disableExtension($binaries$type)
  400.     {
  401.         if (!($phpini $this->config->get('php_ini'null'pear.php.net'))) {
  402.             return PEAR::raiseError('configuration option "php_ini" is not set to php.ini location');
  403.         }
  404.         $ini $this->_parseIni($phpini);
  405.         if (PEAR::isError($ini)) {
  406.             return $ini;
  407.         }
  408.         $line = 0;
  409.         if ($type == 'extsrc' || $type == 'extbin'{
  410.             $search 'extensions';
  411.             $enable 'extension';
  412.         else {
  413.             $search 'zend_extensions';
  414.             ob_start();
  415.             phpinfo(INFO_GENERAL);
  416.             $info ob_get_contents();
  417.             ob_end_clean();
  418.             $debug function_exists('leak''_debug' '';
  419.             $ts preg_match('/Thread Safety.+enabled/'$info'_ts' '';
  420.             $enable 'zend_extension' $debug $ts;
  421.         }
  422.         $found = false;
  423.         foreach ($ini[$searchas $line => $extension{
  424.             if (in_array($extension$binariestrue|| in_array(
  425.                   $ini['extension_dir'. DIRECTORY_SEPARATOR . $extension$binariestrue)) {
  426.                 $found = true;
  427.                 break;
  428.             }
  429.         }
  430.         if (!$found{
  431.             // not enabled
  432.             return true;
  433.         }
  434.         $fp @fopen($phpini'wb');
  435.         if (!$fp{
  436.             return PEAR::raiseError('cannot open php.ini "' $phpini '" for writing');
  437.         }
  438.         if ($line{
  439.             $newini array_slice($ini['all']0$line);
  440.             // delete the enable line
  441.             $newini array_merge($newiniarray_slice($ini['all']$line + 1));
  442.         else {
  443.             $newini array_slice($ini['all']1);
  444.         }
  445.         foreach ($newini as $line{
  446.             fwrite($fp$line);
  447.         }
  448.         fclose($fp);
  449.         return true;
  450.     }
  451.  
  452.     function _parseIni($filename)
  453.     {
  454.         if (!file_exists($filename)) {
  455.             return PEAR::raiseError('php.ini "' $filename '" does not exist');
  456.         }
  457.  
  458.         if (filesize($filename> 300000{
  459.             return PEAR::raiseError('php.ini "' $filename '" is too large, aborting');
  460.         }
  461.  
  462.         ob_start();
  463.         phpinfo(INFO_GENERAL);
  464.         $info ob_get_contents();
  465.         ob_end_clean();
  466.         $debug function_exists('leak''_debug' '';
  467.         $ts preg_match('/Thread Safety.+enabled/'$info'_ts' '';
  468.         $zend_extension_line 'zend_extension' $debug $ts;
  469.         $all @file($filename);
  470.         if (!$all{
  471.             return PEAR::raiseError('php.ini "' $filename .'" could not be read');
  472.         }
  473.         $zend_extensions $extensions = array();
  474.         // assume this is right, but pull from the php.ini if it is found
  475.         $extension_dir ini_get('extension_dir');
  476.         foreach ($all as $linenum => $line{
  477.             $line trim($line);
  478.             if (!$line{
  479.                 continue;
  480.             }
  481.             if ($line[0== ';'{
  482.                 continue;
  483.             }
  484.             if (strtolower(substr($line013)) == 'extension_dir'{
  485.                 $line trim(substr($line13));
  486.                 if ($line[0== '='{
  487.                     $x trim(substr($line1));
  488.                     $x explode(';'$x);
  489.                     $extension_dir str_replace('"'''array_shift($x));
  490.                     continue;
  491.                 }
  492.             }
  493.             if (strtolower(substr($line09)) == 'extension'{
  494.                 $line trim(substr($line9));
  495.                 if ($line[0== '='{
  496.                     $x trim(substr($line1));
  497.                     $x explode(';'$x);
  498.                     $extensions[$linenumstr_replace('"'''array_shift($x));
  499.                     continue;
  500.                 }
  501.             }
  502.             if (strtolower(substr($line0strlen($zend_extension_line))) ==
  503.                   $zend_extension_line{
  504.                 $line trim(substr($linestrlen($zend_extension_line)));
  505.                 if ($line[0== '='{
  506.                     $x trim(substr($line1));
  507.                     $x explode(';'$x);
  508.                     $zend_extensions[$linenumstr_replace('"'''array_shift($x));
  509.                     continue;
  510.                 }
  511.             }
  512.         }
  513.         return array(
  514.             'extensions' => $extensions,
  515.             'zend_extensions' => $zend_extensions,
  516.             'extension_dir' => $extension_dir,
  517.             'all' => $all,
  518.         );
  519.     }
  520.  
  521.     // {{{ doInstall()
  522.  
  523.     function doInstall($command$options$params)
  524.     {
  525.         if (!class_exists('PEAR_PackageFile')) {
  526.             require_once 'PEAR/PackageFile.php';
  527.         }
  528.  
  529.         if (isset($options['installroot']&& isset($options['packagingroot'])) {
  530.             return $this->raiseError('ERROR: cannot use both --installroot and --packagingroot');
  531.         }
  532.  
  533.         $reg &$this->config->getRegistry();
  534.         $channel = isset($options['channel']$options['channel'$this->config->get('default_channel');
  535.         if (!$reg->channelExists($channel)) {
  536.             return $this->raiseError('Channel "' $channel '" does not exist');
  537.         }
  538.  
  539.         if (empty($this->installer)) {
  540.             $this->installer &$this->getInstaller($this->ui);
  541.         }
  542.  
  543.         if ($command == 'upgrade' || $command == 'upgrade-all'{
  544.             // If people run the upgrade command but pass nothing, emulate a upgrade-all
  545.             if ($command == 'upgrade' && empty($params)) {
  546.                 return $this->doUpgradeAll($command$options$params);
  547.             }
  548.             $options['upgrade'= true;
  549.         else {
  550.             $packages $params;
  551.         }
  552.  
  553.         $instreg &$reg// instreg used to check if package is installed
  554.         if (isset($options['packagingroot']&& !isset($options['upgrade'])) {
  555.             $packrootphp_dir $this->installer->_prependPath(
  556.                 $this->config->get('php_dir'null'pear.php.net'),
  557.                 $options['packagingroot']);
  558.             $instreg = new PEAR_Registry($packrootphp_dir)// other instreg!
  559.  
  560.             if ($this->config->get('verbose'> 2{
  561.                 $this->ui->outputData('using package root: ' $options['packagingroot']);
  562.             }
  563.         }
  564.  
  565.         $abstractpackages $otherpackages = array();
  566.         // parse params
  567.  
  568.         foreach ($params as $param{
  569.             if (strpos($param'http://'=== 0{
  570.                 $otherpackages[$param;
  571.                 continue;
  572.             }
  573.  
  574.             if (strpos($param'channel://'=== false && @file_exists($param)) {
  575.                 if (isset($options['force'])) {
  576.                     $otherpackages[$param;
  577.                     continue;
  578.                 }
  579.  
  580.                 $pkg = new PEAR_PackageFile($this->config);
  581.                 $pf  $pkg->fromAnyFile($paramPEAR_VALIDATE_DOWNLOADING);
  582.                 if (PEAR::isError($pf)) {
  583.                     $otherpackages[$param;
  584.                     continue;
  585.                 }
  586.  
  587.                 $exists   $reg->packageExists($pf->getPackage()$pf->getChannel());
  588.                 $pversion $reg->packageInfo($pf->getPackage()'version'$pf->getChannel());
  589.                 $version_compare version_compare($pf->getVersion()$pversion'<=');
  590.                 if ($exists && $version_compare{
  591.                     if ($this->config->get('verbose')) {
  592.                         $this->ui->outputData('Ignoring installed package ' .
  593.                             $reg->parsedPackageNameToString(
  594.                             array('package' => $pf->getPackage(),
  595.                                   'channel' => $pf->getChannel())true));
  596.                     }
  597.                     continue;
  598.                 }
  599.                 $otherpackages[$param;
  600.                 continue;
  601.             }
  602.  
  603.             $e $reg->parsePackageName($param$channel);
  604.             if (PEAR::isError($e)) {
  605.                 $otherpackages[$param;
  606.             else {
  607.                 $abstractpackages[$e;
  608.             }
  609.         }
  610.         PEAR::staticPopErrorHandling();
  611.  
  612.         // if there are any local package .tgz or remote static url, we can't
  613.         // filter.  The filter only works for abstract packages
  614.         if (count($abstractpackages&& !isset($options['force'])) {
  615.             // when not being forced, only do necessary upgrades/installs
  616.             if (isset($options['upgrade'])) {
  617.                 $abstractpackages $this->_filterUptodatePackages($abstractpackages$command);
  618.             else {
  619.                 $count count($abstractpackages);
  620.                 foreach ($abstractpackages as $i => $package{
  621.                     if (isset($package['group'])) {
  622.                         // do not filter out install groups
  623.                         continue;
  624.                     }
  625.  
  626.                     if ($instreg->packageExists($package['package']$package['channel'])) {
  627.                         if ($count > 1{
  628.                             if ($this->config->get('verbose')) {
  629.                                 $this->ui->outputData('Ignoring installed package ' .
  630.                                     $reg->parsedPackageNameToString($packagetrue));
  631.                             }
  632.                             unset($abstractpackages[$i]);
  633.                         elseif ($count === 1{
  634.                             // Lets try to upgrade it since it's already installed
  635.                             $options['upgrade'= true;
  636.                         }
  637.                     }
  638.                 }
  639.             }
  640.             $abstractpackages =
  641.                 array_map(array($reg'parsedPackageNameToString')$abstractpackages);
  642.         elseif (count($abstractpackages)) {
  643.             $abstractpackages =
  644.                 array_map(array($reg'parsedPackageNameToString')$abstractpackages);
  645.         }
  646.  
  647.         $packages array_merge($abstractpackages$otherpackages);
  648.         if (!count($packages)) {
  649.             $c '';
  650.             if (isset($options['channel'])){
  651.                 $c .= ' in channel "' $options['channel''"';
  652.             }
  653.             $this->ui->outputData('Nothing to ' $command $c);
  654.             return true;
  655.         }
  656.  
  657.         $this->downloader &$this->getDownloader($this->ui$options$this->config);
  658.         $errors $downloaded $binaries = array();
  659.         $downloaded &$this->downloader->download($packages);
  660.         if (PEAR::isError($downloaded)) {
  661.             return $this->raiseError($downloaded);
  662.         }
  663.  
  664.         $errors $this->downloader->getErrorMsgs();
  665.         if (count($errors)) {
  666.             $err = array();
  667.             $err['data'= array();
  668.             foreach ($errors as $error{
  669.                 if ($error !== null{
  670.                     $err['data'][= array($error);
  671.                 }
  672.             }
  673.  
  674.             if (!empty($err['data'])) {
  675.                 $err['headline''Install Errors';
  676.                 $this->ui->outputData($err);
  677.             }
  678.  
  679.             if (!count($downloaded)) {
  680.                 return $this->raiseError("$command failed");
  681.             }
  682.         }
  683.  
  684.         $data = array(
  685.             'headline' => 'Packages that would be Installed'
  686.         );
  687.  
  688.         if (isset($options['pretend'])) {
  689.             foreach ($downloaded as $package{
  690.                 $data['data'][= array($reg->parsedPackageNameToString($package->getParsedPackage()));
  691.             }
  692.             $this->ui->outputData($data'pretend');
  693.             return true;
  694.         }
  695.  
  696.         $this->installer->setOptions($options);
  697.         $this->installer->sortPackagesForInstall($downloaded);
  698.         if (PEAR::isError($err $this->installer->setDownloadedPackages($downloaded))) {
  699.             $this->raiseError($err->getMessage());
  700.             return true;
  701.         }
  702.  
  703.         $binaries $extrainfo = array();
  704.         foreach ($downloaded as $param{
  705.             $info $this->installer->install($param$options);
  706.             PEAR::staticPopErrorHandling();
  707.             if (PEAR::isError($info)) {
  708.                 $oldinfo $info;
  709.                 $pkg &$param->getPackageFile();
  710.                 if ($info->getCode(!= PEAR_INSTALLER_NOBINARY{
  711.                     if (!($info $pkg->installBinary($this->installer))) {
  712.                         $this->ui->outputData('ERROR: ' .$oldinfo->getMessage());
  713.                         continue;
  714.                     }
  715.  
  716.                     // we just installed a different package than requested,
  717.                     // let's change the param and info so that the rest of this works
  718.                     $param $info[0];
  719.                     $info  $info[1];
  720.                 }
  721.             }
  722.  
  723.             if (!is_array($info)) {
  724.                 return $this->raiseError("$command failed");
  725.             }
  726.  
  727.             if ($param->getPackageType(== 'extsrc' ||
  728.                   $param->getPackageType(== 'extbin' ||
  729.                   $param->getPackageType(== 'zendextsrc' ||
  730.                   $param->getPackageType(== 'zendextbin'
  731.             {
  732.                 $pkg &$param->getPackageFile();
  733.                 if ($instbin $pkg->getInstalledBinary()) {
  734.                     $instpkg &$instreg->getPackage($instbin$pkg->getChannel());
  735.                 else {
  736.                     $instpkg &$instreg->getPackage($pkg->getPackage()$pkg->getChannel());
  737.                 }
  738.  
  739.                 foreach ($instpkg->getFilelist(as $name => $atts{
  740.                     $pinfo pathinfo($atts['installed_as']);
  741.                     if (!isset($pinfo['extension']||
  742.                           in_array($pinfo['extension']array('c''h'))
  743.                     {
  744.                         continue; // make sure we don't match php_blah.h
  745.                     }
  746.  
  747.                     if ((strpos($pinfo['basename']'php_'=== 0 &&
  748.                           $pinfo['extension'== 'dll'||
  749.                           // most unices
  750.                           $pinfo['extension'== 'so' ||
  751.                           // hp-ux
  752.                           $pinfo['extension'== 'sl'{
  753.                         $binaries[= array($atts['installed_as']$pinfo);
  754.                         break;
  755.                     }
  756.                 }
  757.  
  758.                 if (count($binaries)) {
  759.                     foreach ($binaries as $pinfo{
  760.                         PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN);
  761.                         $ret $this->enableExtension(array($pinfo[0])$param->getPackageType());
  762.                         PEAR::staticPopErrorHandling();
  763.                         if (PEAR::isError($ret)) {
  764.                             $extrainfo[$ret->getMessage();
  765.                             if ($param->getPackageType(== 'extsrc' ||
  766.                                   $param->getPackageType(== 'extbin'{
  767.                                 $exttype 'extension';
  768.                             else {
  769.                                 ob_start();
  770.                                 phpinfo(INFO_GENERAL);
  771.                                 $info ob_get_contents();
  772.                                 ob_end_clean();
  773.                                 $debug function_exists('leak''_debug' '';
  774.                                 $ts preg_match('/Thread Safety.+enabled/'$info'_ts' '';
  775.                                 $exttype 'zend_extension' $debug $ts;
  776.                             }
  777.                             $extrainfo['You should add "' $exttype '=' .
  778.                                 $pinfo[1]['basename''" to php.ini';
  779.                         else {
  780.                             $extrainfo['Extension ' $instpkg->getProvidesExtension(.
  781.                                 ' enabled in php.ini';
  782.                         }
  783.                     }
  784.                 }
  785.             }
  786.  
  787.             if ($this->config->get('verbose'> 0{
  788.                 $chan $param->getChannel();
  789.                 $label $reg->parsedPackageNameToString(
  790.                     array(
  791.                         'channel' => $chan,
  792.                         'package' => $param->getPackage(),
  793.                         'version' => $param->getVersion(),
  794.                     ));
  795.                 $out = array('data' => "$command ok: $label");
  796.                 if (isset($info['release_warnings'])) {
  797.                     $out['release_warnings'$info['release_warnings'];
  798.                 }
  799.                 $this->ui->outputData($out$command);
  800.  
  801.                 if (!isset($options['register-only']&& !isset($options['offline'])) {
  802.                     if ($this->config->isDefinedLayer('ftp')) {
  803.                         PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN);
  804.                         $info $this->installer->ftpInstall($param);
  805.                         PEAR::staticPopErrorHandling();
  806.                         if (PEAR::isError($info)) {
  807.                             $this->ui->outputData($info->getMessage());
  808.                             $this->ui->outputData("remote install failed: $label");
  809.                         else {
  810.                             $this->ui->outputData("remote install ok: $label");
  811.                         }
  812.                     }
  813.                 }
  814.             }
  815.  
  816.             $deps $param->getDeps();
  817.             if ($deps{
  818.                 if (isset($deps['group'])) {
  819.                     $groups $deps['group'];
  820.                     if (!isset($groups[0])) {
  821.                         $groups = array($groups);
  822.                     }
  823.  
  824.                     foreach ($groups as $group{
  825.                         if ($group['attribs']['name'== 'default'{
  826.                             // default group is always installed, unless the user
  827.                             // explicitly chooses to install another group
  828.                             continue;
  829.                         }
  830.                         $extrainfo[$param->getPackage(': Optional feature ' .
  831.                             $group['attribs']['name'' available (' .
  832.                             $group['attribs']['hint'')';
  833.                     }
  834.  
  835.                     $extrainfo[$param->getPackage(.
  836.                         ': To install optional features use "pear install ' .
  837.                         $reg->parsedPackageNameToString(
  838.                             array('package' => $param->getPackage(),
  839.                                   'channel' => $param->getChannel())true.
  840.                               '#featurename"';
  841.                 }
  842.             }
  843.  
  844.             $pkg &$instreg->getPackage($param->getPackage()$param->getChannel());
  845.             // $pkg may be NULL if install is a 'fake' install via --packagingroot
  846.             if (is_object($pkg)) {
  847.                 $pkg->setConfig($this->config);
  848.                 if ($list $pkg->listPostinstallScripts()) {
  849.                     $pn $reg->parsedPackageNameToString(array('channel' =>
  850.                        $param->getChannel()'package' => $param->getPackage())true);
  851.                     $extrainfo[$pn ' has post-install scripts:';
  852.                     foreach ($list as $file{
  853.                         $extrainfo[$file;
  854.                     }
  855.                     $extrainfo[$param->getPackage(.
  856.                         ': Use "pear run-scripts ' $pn '" to finish setup.';
  857.                     $extrainfo['DO NOT RUN SCRIPTS FROM UNTRUSTED SOURCES';
  858.                 }
  859.             }
  860.         }
  861.  
  862.         if (count($extrainfo)) {
  863.             foreach ($extrainfo as $info{
  864.                 $this->ui->outputData($info);
  865.             }
  866.         }
  867.  
  868.         return true;
  869.     }
  870.  
  871.     // }}}
  872.     // {{{ doUpgradeAll()
  873.  
  874.     function doUpgradeAll($command$options$params)
  875.     {
  876.         $reg &$this->config->getRegistry();
  877.         $upgrade = array();
  878.  
  879.         if (isset($options['channel'])) {
  880.             $channels = array($options['channel']);
  881.         else {
  882.             $channels $reg->listChannels();
  883.         }
  884.  
  885.         foreach ($channels as $channel{
  886.             if ($channel == '__uri'{
  887.                 continue;
  888.             }
  889.  
  890.             // parse name with channel
  891.             foreach ($reg->listPackages($channelas $name{
  892.                 $upgrade[$reg->parsedPackageNameToString(array(
  893.                         'channel' => $channel,
  894.                         'package' => $name
  895.                     ));
  896.             }
  897.         }
  898.  
  899.         $err $this->doInstall($command$options$upgrade);
  900.         if (PEAR::isError($err)) {
  901.             $this->ui->outputData($err->getMessage()$command);
  902.         }
  903.    }
  904.  
  905.     // }}}
  906.     // {{{ doUninstall()
  907.  
  908.     function doUninstall($command$options$params)
  909.     {
  910.         if (count($params< 1{
  911.             return $this->raiseError("Please supply the package(s) you want to uninstall");
  912.         }
  913.  
  914.         if (empty($this->installer)) {
  915.             $this->installer &$this->getInstaller($this->ui);
  916.         }
  917.  
  918.         if (isset($options['remoteconfig'])) {
  919.             $e $this->config->readFTPConfigFile($options['remoteconfig']);
  920.             if (!PEAR::isError($e)) {
  921.                 $this->installer->setConfig($this->config);
  922.             }
  923.         }
  924.  
  925.         $reg &$this->config->getRegistry();
  926.         $newparams = array();
  927.         $binaries = array();
  928.         $badparams = array();
  929.         foreach ($params as $pkg{
  930.             $channel $this->config->get('default_channel');
  931.             $parsed $reg->parsePackageName($pkg$channel);
  932.             PEAR::staticPopErrorHandling();
  933.             if (!$parsed || PEAR::isError($parsed)) {
  934.                 $badparams[$pkg;
  935.                 continue;
  936.             }
  937.             $package $parsed['package'];
  938.             $channel $parsed['channel'];
  939.             $info &$reg->getPackage($package$channel);
  940.             if ($info === null &&
  941.                  ($channel == 'pear.php.net' || $channel == 'pecl.php.net')) {
  942.                 // make sure this isn't a package that has flipped from pear to pecl but
  943.                 // used a package.xml 1.0
  944.                 $testc ($channel == 'pear.php.net''pecl.php.net' 'pear.php.net';
  945.                 $info &$reg->getPackage($package$testc);
  946.                 if ($info !== null{
  947.                     $channel $testc;
  948.                 }
  949.             }
  950.             if ($info === null{
  951.                 $badparams[$pkg;
  952.             else {
  953.                 $newparams[&$info;
  954.                 // check for binary packages (this is an alias for those packages if so)
  955.                 if ($installedbinary $info->getInstalledBinary()) {
  956.                     $this->ui->log('adding binary package ' .
  957.                         $reg->parsedPackageNameToString(array('channel' => $channel,
  958.                             'package' => $installedbinary)true));
  959.                     $newparams[&$reg->getPackage($installedbinary$channel);
  960.                 }
  961.                 // add the contents of a dependency group to the list of installed packages
  962.                 if (isset($parsed['group'])) {
  963.                     $group $info->getDependencyGroup($parsed['group']);
  964.                     if ($group{
  965.                         $installed $reg->getInstalledGroup($group);
  966.                         if ($installed{
  967.                             foreach ($installed as $i => $p{
  968.                                 $newparams[&$installed[$i];
  969.                             }
  970.                         }
  971.                     }
  972.                 }
  973.             }
  974.         }
  975.         $err $this->installer->sortPackagesForUninstall($newparams);
  976.         if (PEAR::isError($err)) {
  977.             $this->ui->outputData($err->getMessage()$command);
  978.             return true;
  979.         }
  980.         $params $newparams;
  981.         // twist this to use it to check on whether dependent packages are also being uninstalled
  982.         // for circular dependencies like subpackages
  983.         $this->installer->setUninstallPackages($newparams);
  984.         $params array_merge($params$badparams);
  985.         $binaries = array();
  986.         foreach ($params as $pkg{
  987.             $this->installer->pushErrorHandling(PEAR_ERROR_RETURN);
  988.             if ($err $this->installer->uninstall($pkg$options)) {
  989.                 $this->installer->popErrorHandling();
  990.                 if (PEAR::isError($err)) {
  991.                     $this->ui->outputData($err->getMessage()$command);
  992.                     continue;
  993.                 }
  994.                 if ($pkg->getPackageType(== 'extsrc' ||
  995.                       $pkg->getPackageType(== 'extbin' ||
  996.                       $pkg->getPackageType(== 'zendextsrc' ||
  997.                       $pkg->getPackageType(== 'zendextbin'{
  998.                     if ($instbin $pkg->getInstalledBinary()) {
  999.                         continue; // this will be uninstalled later
  1000.                     }
  1001.  
  1002.                     foreach ($pkg->getFilelist(as $name => $atts{
  1003.                         $pinfo pathinfo($atts['installed_as']);
  1004.                         if (!isset($pinfo['extension']||
  1005.                               in_array($pinfo['extension']array('c''h'))) {
  1006.                             continue; // make sure we don't match php_blah.h
  1007.                         }
  1008.                         if ((strpos($pinfo['basename']'php_'=== 0 &&
  1009.                               $pinfo['extension'== 'dll'||
  1010.                               // most unices
  1011.                               $pinfo['extension'== 'so' ||
  1012.                               // hp-ux
  1013.                               $pinfo['extension'== 'sl'{
  1014.                             $binaries[= array($atts['installed_as']$pinfo);
  1015.                             break;
  1016.                         }
  1017.                     }
  1018.                     if (count($binaries)) {
  1019.                         foreach ($binaries as $pinfo{
  1020.                             PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN);
  1021.                             $ret $this->disableExtension(array($pinfo[0])$pkg->getPackageType());
  1022.                             PEAR::staticPopErrorHandling();
  1023.                             if (PEAR::isError($ret)) {
  1024.                                 $extrainfo[$ret->getMessage();
  1025.                                 if ($pkg->getPackageType(== 'extsrc' ||
  1026.                                       $pkg->getPackageType(== 'extbin'{
  1027.                                     $exttype 'extension';
  1028.                                 else {
  1029.                                     ob_start();
  1030.                                     phpinfo(INFO_GENERAL);
  1031.                                     $info ob_get_contents();
  1032.                                     ob_end_clean();
  1033.                                     $debug function_exists('leak''_debug' '';
  1034.                                     $ts preg_match('/Thread Safety.+enabled/'$info'_ts' '';
  1035.                                     $exttype 'zend_extension' $debug $ts;
  1036.                                 }
  1037.                                 $this->ui->outputData('Unable to remove "' $exttype '=' .
  1038.                                     $pinfo[1]['basename''" from php.ini'$command);
  1039.                             else {
  1040.                                 $this->ui->outputData('Extension ' $pkg->getProvidesExtension(.
  1041.                                     ' disabled in php.ini'$command);
  1042.                             }
  1043.                         }
  1044.                     }
  1045.                 }
  1046.                 $savepkg $pkg;
  1047.                 if ($this->config->get('verbose'> 0{
  1048.                     if (is_object($pkg)) {
  1049.                         $pkg $reg->parsedPackageNameToString($pkg);
  1050.                     }
  1051.                     $this->ui->outputData("uninstall ok: $pkg"$command);
  1052.                 }
  1053.                 if (!isset($options['offline']&& is_object($savepkg&&
  1054.                       defined('PEAR_REMOTEINSTALL_OK')) {
  1055.                     if ($this->config->isDefinedLayer('ftp')) {
  1056.                         $this->installer->pushErrorHandling(PEAR_ERROR_RETURN);
  1057.                         $info $this->installer->ftpUninstall($savepkg);
  1058.                         $this->installer->popErrorHandling();
  1059.                         if (PEAR::isError($info)) {
  1060.                             $this->ui->outputData($info->getMessage());
  1061.                             $this->ui->outputData("remote uninstall failed: $pkg");
  1062.                         else {
  1063.                             $this->ui->outputData("remote uninstall ok: $pkg");
  1064.                         }
  1065.                     }
  1066.                 }
  1067.             else {
  1068.                 $this->installer->popErrorHandling();
  1069.                 if (!is_object($pkg)) {
  1070.                     return $this->raiseError("uninstall failed: $pkg");
  1071.                 }
  1072.                 $pkg $reg->parsedPackageNameToString($pkg);
  1073.             }
  1074.         }
  1075.  
  1076.         return true;
  1077.     }
  1078.  
  1079.     // }}}
  1080.  
  1081.  
  1082.     // }}}
  1083.     // {{{ doBundle()
  1084.     /*
  1085.     (cox) It just downloads and untars the package, does not do
  1086.             any check that the PEAR_Installer::_installFile() does.
  1087.     */
  1088.  
  1089.     function doBundle($command$options$params)
  1090.     {
  1091.         $opts = array(
  1092.             'force'        => true,
  1093.             'nodeps'       => true,
  1094.             'soft'         => true,
  1095.             'downloadonly' => true
  1096.         );
  1097.         $downloader &$this->getDownloader($this->ui$opts$this->config);
  1098.         $reg &$this->config->getRegistry();
  1099.         if (count($params< 1{
  1100.             return $this->raiseError("Please supply the package you want to bundle");
  1101.         }
  1102.  
  1103.         if (isset($options['destination'])) {
  1104.             if (!is_dir($options['destination'])) {
  1105.                 System::mkdir('-p ' $options['destination']);
  1106.             }
  1107.             $dest realpath($options['destination']);
  1108.         else {
  1109.             $pwd  getcwd();
  1110.             $dir  $pwd . DIRECTORY_SEPARATOR . 'ext';
  1111.             $dest is_dir($dir$dir $pwd;
  1112.         }
  1113.         $err $downloader->setDownloadDir($dest);
  1114.         PEAR::staticPopErrorHandling();
  1115.         if (PEAR::isError($err)) {
  1116.             return PEAR::raiseError('download directory "' $dest .
  1117.                 '" is not writeable.');
  1118.         }
  1119.         $result &$downloader->download(array($params[0]));
  1120.         if (PEAR::isError($result)) {
  1121.             return $result;
  1122.         }
  1123.         if (!isset($result[0])) {
  1124.             return $this->raiseError('unable to unpack ' $params[0]);
  1125.         }
  1126.         $pkgfile &$result[0]->getPackageFile();
  1127.         $pkgname $pkgfile->getName();
  1128.         $pkgversion $pkgfile->getVersion();
  1129.  
  1130.         // Unpacking -------------------------------------------------
  1131.         $dest .= DIRECTORY_SEPARATOR . $pkgname;
  1132.         $orig $pkgname '-' $pkgversion;
  1133.  
  1134.         $tar &new Archive_Tar($pkgfile->getArchiveFile());
  1135.         if (!$tar->extractModify($dest$orig)) {
  1136.             return $this->raiseError('unable to unpack ' $pkgfile->getArchiveFile());
  1137.         }
  1138.         $this->ui->outputData("Package ready at '$dest'");
  1139.     // }}}
  1140.     }
  1141.  
  1142.     // }}}
  1143.  
  1144.     function doRunScripts($command$options$params)
  1145.     {
  1146.         if (!isset($params[0])) {
  1147.             return $this->raiseError('run-scripts expects 1 parameter: a package name');
  1148.         }
  1149.  
  1150.         $reg &$this->config->getRegistry();
  1151.         $parsed $reg->parsePackageName($params[0]$this->config->get('default_channel'));
  1152.         PEAR::staticPopErrorHandling();
  1153.         if (PEAR::isError($parsed)) {
  1154.             return $this->raiseError($parsed);
  1155.         }
  1156.  
  1157.         $package &$reg->getPackage($parsed['package']$parsed['channel']);
  1158.         if (!is_object($package)) {
  1159.             return $this->raiseError('Could not retrieve package "' $params[0'" from registry');
  1160.         }
  1161.  
  1162.         $package->setConfig($this->config);
  1163.         $package->runPostinstallScripts();
  1164.         $this->ui->outputData('Install scripts complete'$command);
  1165.         return true;
  1166.     }
  1167.  
  1168.     /**
  1169.      * Given a list of packages, filter out those ones that are already up to date
  1170.      *
  1171.      * @param $packages: packages, in parsed array format !
  1172.      * @return list of packages that can be upgraded
  1173.      */
  1174.     function _filterUptodatePackages($packages$command)
  1175.     {
  1176.         $reg &$this->config->getRegistry();
  1177.         $latestReleases = array();
  1178.  
  1179.         $ret = array();
  1180.         foreach ($packages as $package{
  1181.             if (isset($package['group'])) {
  1182.                 $ret[$package;
  1183.                 continue;
  1184.             }
  1185.  
  1186.             $channel $package['channel'];
  1187.             $name    $package['package'];
  1188.             if (!$reg->packageExists($name$channel)) {
  1189.                 $ret[$package;
  1190.                 continue;
  1191.             }
  1192.  
  1193.             if (!isset($latestReleases[$channel])) {
  1194.                 // fill in cache for this channel
  1195.                 $chan &$reg->getChannel($channel);
  1196.                 if (PEAR::isError($chan)) {
  1197.                     return $this->raiseError($chan);
  1198.                 }
  1199.  
  1200.                 $base2 = false;
  1201.                 $preferred_mirror $this->config->get('preferred_mirror'null$channel);
  1202.                 if ($chan->supportsREST($preferred_mirror&&
  1203.                     (
  1204.                        //($base2 = $chan->getBaseURL('REST1.4', $preferred_mirror)) ||
  1205.                        ($base  $chan->getBaseURL('REST1.0'$preferred_mirror))
  1206.                     )
  1207.                 {
  1208.                     $dorest = true;
  1209.                 }
  1210.  
  1211.                 PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN);
  1212.                 if (!isset($package['state'])) {
  1213.                     $state $this->config->get('preferred_state'null$channel);
  1214.                 else {
  1215.                     $state $package['state'];
  1216.                 }
  1217.  
  1218.                 if ($dorest{
  1219.                     if ($base2{
  1220.                         $rest &$this->config->getREST('1.4'array());
  1221.                         $base $base2;
  1222.                     else {
  1223.                         $rest &$this->config->getREST('1.0'array());
  1224.                     }
  1225.  
  1226.                     $installed array_flip($reg->listPackages($channel));
  1227.                     $latest    $rest->listLatestUpgrades($base$state$installed$channel$reg);
  1228.                 }
  1229.  
  1230.                 PEAR::staticPopErrorHandling();
  1231.                 if (PEAR::isError($latest)) {
  1232.                     $this->ui->outputData('Error getting channel info from ' $channel .
  1233.                         ': ' $latest->getMessage());
  1234.                     continue;
  1235.                 }
  1236.  
  1237.                 $latestReleases[$channelarray_change_key_case($latest);
  1238.             }
  1239.  
  1240.             // check package for latest release
  1241.             $name_lower strtolower($name);
  1242.             if (isset($latestReleases[$channel][$name_lower])) {
  1243.                 // if not set, up to date
  1244.                 $inst_version    $reg->packageInfo($name'version'$channel);
  1245.                 $channel_version $latestReleases[$channel][$name_lower]['version'];
  1246.                 if (version_compare($channel_version$inst_version'le')) {
  1247.                     // installed version is up-to-date
  1248.                     continue;
  1249.                 }
  1250.  
  1251.                 // maintain BC
  1252.                 if ($command == 'upgrade-all'{
  1253.                     $this->ui->outputData(array('data' => 'Will upgrade ' .
  1254.                         $reg->parsedPackageNameToString($package))$command);
  1255.                 }
  1256.                 $ret[$package;
  1257.             }
  1258.         }
  1259.  
  1260.         return $ret;
  1261.     }
  1262. }

Documentation generated on Wed, 06 Jul 2011 23:30:52 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.