Update to PEAR 1.7.2, Image_Canvas 0.3.1, Image_Color 1.0.3, Image_Graph 0.7.2, XML_Parser 1.3.1.
Removed PHP_Compat, and references to it. Removed ionCube/Zend/mmCache compatibility checks in test.php script. Changed minimum PHP requirement to 5.0 in test.php script.
This commit is contained in:
@@ -13,9 +13,9 @@
|
||||
* @category pear
|
||||
* @package PEAR
|
||||
* @author Greg Beaver <cellog@php.net>
|
||||
* @copyright 1997-2005 The PHP Group
|
||||
* @copyright 1997-2008 The PHP Group
|
||||
* @license http://www.php.net/license/3_0.txt PHP License 3.0
|
||||
* @version CVS: $Id: Frontend.php,v 1.4 2005/04/13 04:17:45 cellog Exp $
|
||||
* @version CVS: $Id: Frontend.php,v 1.13 2008/01/03 20:26:35 cellog Exp $
|
||||
* @link http://pear.php.net/package/PEAR
|
||||
* @since File available since Release 1.4.0a1
|
||||
*/
|
||||
@@ -34,12 +34,13 @@ $GLOBALS['_PEAR_FRONTEND_SINGLETON'] = null;
|
||||
|
||||
/**
|
||||
* Singleton-based frontend for PEAR user input/output
|
||||
*
|
||||
* @category pear
|
||||
* @package PEAR
|
||||
* @author Greg Beaver <cellog@php.net>
|
||||
* @copyright 1997-2005 The PHP Group
|
||||
* @copyright 1997-2008 The PHP Group
|
||||
* @license http://www.php.net/license/3_0.txt PHP License 3.0
|
||||
* @version Release: 1.4.5
|
||||
* @version Release: 1.7.2
|
||||
* @link http://pear.php.net/package/PEAR
|
||||
* @since Class available since Release 1.4.0a1
|
||||
*/
|
||||
@@ -64,6 +65,15 @@ class PEAR_Frontend extends PEAR
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the frontend class that will be used by calls to {@link singleton()}
|
||||
*
|
||||
* Frontends are expected to conform to the PEAR naming standard of
|
||||
* _ => DIRECTORY_SEPARATOR (PEAR_Frontend_CLI is in PEAR/Frontend/CLI.php)
|
||||
* @param string $uiclass full class name
|
||||
* @return PEAR_Frontend
|
||||
* @static
|
||||
*/
|
||||
function &setFrontendClass($uiclass)
|
||||
{
|
||||
if (is_object($GLOBALS['_PEAR_FRONTEND_SINGLETON']) &&
|
||||
@@ -80,7 +90,7 @@ class PEAR_Frontend extends PEAR
|
||||
$obj = &new $uiclass;
|
||||
// quick test to see if this class implements a few of the most
|
||||
// important frontend methods
|
||||
if (method_exists($obj, 'userConfirm')) {
|
||||
if (is_a($obj, 'PEAR_Frontend')) {
|
||||
$GLOBALS['_PEAR_FRONTEND_SINGLETON'] = &$obj;
|
||||
$GLOBALS['_PEAR_FRONTEND_CLASS'] = $uiclass;
|
||||
return $obj;
|
||||
@@ -93,6 +103,30 @@ class PEAR_Frontend extends PEAR
|
||||
return $err;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the frontend class that will be used by calls to {@link singleton()}
|
||||
*
|
||||
* Frontends are expected to be a descendant of PEAR_Frontend
|
||||
* @param PEAR_Frontend
|
||||
* @return PEAR_Frontend
|
||||
* @static
|
||||
*/
|
||||
function &setFrontendObject($uiobject)
|
||||
{
|
||||
if (is_object($GLOBALS['_PEAR_FRONTEND_SINGLETON']) &&
|
||||
is_a($GLOBALS['_PEAR_FRONTEND_SINGLETON'], get_class($uiobject))) {
|
||||
return $GLOBALS['_PEAR_FRONTEND_SINGLETON'];
|
||||
}
|
||||
if (!is_a($uiobject, 'PEAR_Frontend')) {
|
||||
$err = PEAR::raiseError('not a valid frontend class: (' .
|
||||
get_class($uiobject) . ')');
|
||||
return $err;
|
||||
}
|
||||
$GLOBALS['_PEAR_FRONTEND_SINGLETON'] = &$uiobject;
|
||||
$GLOBALS['_PEAR_FRONTEND_CLASS'] = get_class($uiobject);
|
||||
return $uiobject;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $path relative or absolute include path
|
||||
* @return boolean
|
||||
@@ -103,15 +137,10 @@ class PEAR_Frontend extends PEAR
|
||||
if (file_exists($path) && is_readable($path)) {
|
||||
return true;
|
||||
}
|
||||
$ipath = explode(PATH_SEPARATOR, ini_get('include_path'));
|
||||
foreach ($ipath as $include) {
|
||||
$test = realpath($include . DIRECTORY_SEPARATOR . $path);
|
||||
if (!$test) { // support wrappers like phar (realpath just don't work with them)
|
||||
$test = $include . DIRECTORY_SEPARATOR . $path;
|
||||
}
|
||||
if (file_exists($test) && is_readable($test)) {
|
||||
return true;
|
||||
}
|
||||
$fp = @fopen($path, 'r', true);
|
||||
if ($fp) {
|
||||
fclose($fp);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -135,7 +164,59 @@ class PEAR_Frontend extends PEAR
|
||||
$GLOBALS['_PEAR_Common_tempfiles'][] = $file;
|
||||
}
|
||||
|
||||
function log($level, $msg, $append_crlf = true)
|
||||
/**
|
||||
* Log an action
|
||||
*
|
||||
* @param string $msg the message to log
|
||||
* @param boolean $append_crlf
|
||||
* @return boolean true
|
||||
* @abstract
|
||||
*/
|
||||
function log($msg, $append_crlf = true)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Run a post-installation script
|
||||
*
|
||||
* @param array $scripts array of post-install scripts
|
||||
* @abstract
|
||||
*/
|
||||
function runPostinstallScripts(&$scripts)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Display human-friendly output formatted depending on the
|
||||
* $command parameter.
|
||||
*
|
||||
* This should be able to handle basic output data with no command
|
||||
* @param mixed $data data structure containing the information to display
|
||||
* @param string $command command from which this method was called
|
||||
* @abstract
|
||||
*/
|
||||
function outputData($data, $command = '_default')
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a modal form dialog and return the given input
|
||||
*
|
||||
* A frontend that requires multiple requests to retrieve and process
|
||||
* data must take these needs into account, and implement the request
|
||||
* handling code.
|
||||
* @param string $command command from which this method was called
|
||||
* @param array $prompts associative array. keys are the input field names
|
||||
* and values are the description
|
||||
* @param array $types array of input field types (text, password,
|
||||
* etc.) keys have to be the same like in $prompts
|
||||
* @param array $defaults array of default values. again keys have
|
||||
* to be the same like in $prompts. Do not depend
|
||||
* on a default value being set.
|
||||
* @return array input sent by the user
|
||||
* @abstract
|
||||
*/
|
||||
function userDialog($command, $prompts, $types = array(), $defaults = array())
|
||||
{
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user