Source for file CliFrontend.php
Documentation is available at CliFrontend.php
* Always keep your application up-to-date with the most recent and stable version
* of PEAR::Config package.
* Present new features of PPU version 0.6.0 : get more details
* on package installed and available
* @package PEAR_PackageUpdate
* @author Laurent Laville <pear@laurent-laville.org>
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: CliFrontend.php,v 1.5 2007/11/25 16:36:49 farell Exp $
* @link http://pear.php.net/package/PEAR_PackageUpdate
* @since File available since Release 0.6.0
require_once 'PEAR/PackageUpdate.php';
// Check for updates of PEAR::Config package though pear.php.net channel
'c:\wamp\php\pear.ini', '', 'c:\wamp\php\ppurc.ini');
// Check for new stable version
if ($ppu->checkUpdate ()) {
$inst = $ppu->getInstalledRelease ();
$rel = $ppu->getLatestRelease ();
$vers = $rel['version'] . ' (' . $rel['state'] . ')';
print " A new version $vers of package $channel/$packageName " .
// Update your local copy, only if package is already installed
$error = $ppu->popError ();
echo "Error occured when trying to update: " .
" $channel/$packageName package\n";
echo "Message: " . $error['message'] . "\n";
if (isset ($error['context']) {
echo "*** Context: ***\n";
echo "File: " . $error['context']['file'] . "\n";
echo "Line: " . $error['context']['line'] . "\n";
echo "Function: " . $error['context']['function'] . "\n";
echo "Class: " . $error['context']['class'] . "\n";
print " Package $channel/$packageName is not installed \n";
if (isset ($upd) && $upd === true ) {
print "Your local copy is now up-to-date";
$inst = $ppu->getInstalledRelease ();
$vers = $inst['version'] . ' (' . $inst['state'] . ')';
print " You are still using version $vers of package " .
" $channel/$packageName \n";
print "which depend on package(s) : \n";
foreach ($inst['deps'] as $dep) {
if ($dep['type'] === 'pkg') {
print "- " . $dep['channel'] . '/'. $dep['name'] . "\n";
// your application code goes here ...
Documentation generated on Sun, 15 Jun 2008 10:30:04 -0400 by phpDocumentor 1.4.0. PEAR Logo Copyright © PHP Group 2004.
|