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

Source for file Cli.php

Documentation is available at Cli.php

  1. <?php
  2. /*
  3.  * This is the default CLI driver for PEAR_PackageUpdate.
  4.  *
  5.  * PHP versions 4 and 5
  6.  *
  7.  * LICENSE: This source file is subject to version 3.01 of the PHP license
  8.  * that is available through the world-wide-web at the following URI:
  9.  * http://www.php.net/license/3_01.txt.  If you did not receive a copy of
  10.  * the PHP License and are unable to obtain it through the web, please
  11.  * send a note to license@php.net so we can mail you a copy immediately.
  12.  *
  13.  * @category   PEAR
  14.  * @package    PEAR_PackageUpdate
  15.  * @author     Laurent Laville <pear@laurent-laville.org>
  16.  * @license    http://www.php.net/license/3_01.txt  PHP License 3.01
  17.  * @version    CVS: $Id: Cli.php,v 1.1 2007/01/10 16:19:04 farell Exp $
  18.  * @since      File available since Release 0.6.0
  19.  */
  20.  
  21.  
  22. /**
  23.  * This is the default CLI driver for PEAR_PackageUpdate.
  24.  *
  25.  * A package to make adding self updating functionality to other
  26.  * packages easy.
  27.  *
  28.  * EXAMPLE:
  29.  * <code>
  30.  * <?php
  31.  *     require_once 'PEAR/PackageUpdate.php';
  32.  *     // check for updates of PEAR::Config package
  33.  *     $ppu =& PEAR_PackageUpdate::factory('Cli', 'Config', 'pear');
  34.  *     if ($ppu !== false) {
  35.  *         // Check for new stable and minor changes version
  36.  *         $ppu->setMinimumState(PEAR_PACKAGEUPDATE_STATE_STABLE);
  37.  *         $ppu->setMinimumReleaseType(PEAR_PACKAGEUPDATE_TYPE_MINOR);
  38.  *         if ($ppu->checkUpdate()) {
  39.  *             // Update your local copy
  40.  *             if ($ppu->update()) {
  41.  *                 include_once 'Config.php';
  42.  *             }
  43.  *         }
  44.  *     }
  45.  * ?>
  46.  * </code>
  47.  *
  48.  * @category   PEAR
  49.  * @package    PEAR_PackageUpdate
  50.  * @author     Laurent Laville <pear@laurent-laville.org>
  51.  * @license    http://www.php.net/license/3_01.txt  PHP License 3.01
  52.  * @version    Release: @package_version@
  53.  * @since      Class available since Release 0.6.0
  54.  */
  55.  
  56. {
  57.     function PEAR_PackageUpdate_Cli($packageName$channel)
  58.     {
  59.         parent::PEAR_PackageUpdate($packageName$channel);
  60.     }
  61.  
  62.     function forceRestart()
  63.     {
  64.     }
  65.  
  66.     function presentUpdate()
  67.     {
  68.         // always update the package to latest version depending of options
  69.         // see    setMinimumState(), setMinimumReleaseType()
  70.         return true;
  71.     }
  72. }
  73. ?>

Documentation generated on Mon, 11 Mar 2019 14:54:17 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.