These PEAR scripts arent used
This commit is contained in:
parent
17b6bb2c61
commit
d4deec22d0
|
@ -1,115 +0,0 @@
|
|||
@ECHO OFF
|
||||
|
||||
REM ----------------------------------------------------------------------
|
||||
REM PHP version 5
|
||||
REM ----------------------------------------------------------------------
|
||||
REM Copyright (c) 1997-2004 The PHP Group
|
||||
REM ----------------------------------------------------------------------
|
||||
REM This source file is subject to version 3.0 of the PHP license,
|
||||
REM that is bundled with this package in the file LICENSE, and is
|
||||
REM available at through the world-wide-web at
|
||||
REM http://www.php.net/license/3_0.txt.
|
||||
REM If you did not receive a copy of the PHP license and are unable to
|
||||
REM obtain it through the world-wide-web, please send a note to
|
||||
REM license@php.net so we can mail you a copy immediately.
|
||||
REM ----------------------------------------------------------------------
|
||||
REM Authors: Alexander Merz (alexmerz@php.net)
|
||||
REM ----------------------------------------------------------------------
|
||||
REM
|
||||
REM Last updated 12/29/2004 ($Id$ is not replaced if the file is binary)
|
||||
|
||||
REM change this lines to match the paths of your system
|
||||
REM -------------------
|
||||
|
||||
|
||||
REM Test to see if this is a raw pear.bat (uninstalled version)
|
||||
SET TMPTMPTMPTMPT=@includ
|
||||
SET PMTPMTPMT=%TMPTMPTMPTMPT%e_path@
|
||||
FOR %%x IN ("@include_path@") DO (if %%x=="%PMTPMTPMT%" GOTO :NOTINSTALLED)
|
||||
|
||||
REM Check PEAR global ENV, set them if they do not exist
|
||||
IF "%PHP_PEAR_INSTALL_DIR%"=="" SET "PHP_PEAR_INSTALL_DIR=@include_path@"
|
||||
IF "%PHP_PEAR_BIN_DIR%"=="" SET "PHP_PEAR_BIN_DIR=@bin_dir@"
|
||||
IF "%PHP_PEAR_PHP_BIN%"=="" SET "PHP_PEAR_PHP_BIN=@php_bin@"
|
||||
GOTO :INSTALLED
|
||||
|
||||
:NOTINSTALLED
|
||||
ECHO WARNING: This is a raw, uninstalled pear.bat
|
||||
|
||||
REM Check to see if we can grab the directory of this file (Windows NT+)
|
||||
IF %~n0 == pear (
|
||||
FOR %%x IN (cli\php.exe php.exe) DO (if "%%~$PATH:x" NEQ "" (
|
||||
SET "PHP_PEAR_PHP_BIN=%%~$PATH:x"
|
||||
echo Using PHP Executable "%PHP_PEAR_PHP_BIN%"
|
||||
"%PHP_PEAR_PHP_BIN%" -v
|
||||
GOTO :NEXTTEST
|
||||
))
|
||||
GOTO :FAILAUTODETECT
|
||||
:NEXTTEST
|
||||
IF "%PHP_PEAR_PHP_BIN%" NEQ "" (
|
||||
|
||||
REM We can use this PHP to run a temporary php file to get the dirname of pear
|
||||
|
||||
echo ^<?php $s=getcwd^(^);chdir^($a=dirname^(__FILE__^).'\\'^);if^(stristr^($a,'\\scripts'^)^)$a=dirname^(dirname^($a^)^).'\\';$f=fopen^($s.'\\~a.a','wb'^);echo$s.'\\~a.a';fwrite^($f,$a^);fclose^($f^);chdir^($s^);?^> > ~~getloc.php
|
||||
"%PHP_PEAR_PHP_BIN%" ~~getloc.php
|
||||
set /p PHP_PEAR_BIN_DIR=fakeprompt < ~a.a
|
||||
DEL ~a.a
|
||||
DEL ~~getloc.php
|
||||
set "PHP_PEAR_INSTALL_DIR=%PHP_PEAR_BIN_DIR%pear"
|
||||
|
||||
REM Make sure there is a pearcmd.php at our disposal
|
||||
|
||||
IF NOT EXIST %PHP_PEAR_INSTALL_DIR%\pearcmd.php (
|
||||
IF EXIST %PHP_PEAR_INSTALL_DIR%\scripts\pearcmd.php COPY %PHP_PEAR_INSTALL_DIR%\scripts\pearcmd.php %PHP_PEAR_INSTALL_DIR%\pearcmd.php
|
||||
IF EXIST pearcmd.php COPY pearcmd.php %PHP_PEAR_INSTALL_DIR%\pearcmd.php
|
||||
IF EXIST %~dp0\scripts\pearcmd.php COPY %~dp0\scripts\pearcmd.php %PHP_PEAR_INSTALL_DIR%\pearcmd.php
|
||||
)
|
||||
)
|
||||
GOTO :INSTALLED
|
||||
) ELSE (
|
||||
REM Windows Me/98 cannot succeed, so allow the batch to fail
|
||||
)
|
||||
:FAILAUTODETECT
|
||||
echo WARNING: failed to auto-detect pear information
|
||||
:INSTALLED
|
||||
|
||||
REM Check Folders and files
|
||||
IF NOT EXIST "%PHP_PEAR_INSTALL_DIR%" GOTO PEAR_INSTALL_ERROR
|
||||
IF NOT EXIST "%PHP_PEAR_INSTALL_DIR%\pearcmd.php" GOTO PEAR_INSTALL_ERROR2
|
||||
IF NOT EXIST "%PHP_PEAR_BIN_DIR%" GOTO PEAR_BIN_ERROR
|
||||
IF NOT EXIST "%PHP_PEAR_PHP_BIN%" GOTO PEAR_PHPBIN_ERROR
|
||||
REM launch pearcmd
|
||||
GOTO RUN
|
||||
:PEAR_INSTALL_ERROR
|
||||
ECHO PHP_PEAR_INSTALL_DIR is not set correctly.
|
||||
ECHO Please fix it using your environment variable or modify
|
||||
ECHO the default value in pear.bat
|
||||
ECHO The current value is:
|
||||
ECHO %PHP_PEAR_INSTALL_DIR%
|
||||
GOTO END
|
||||
:PEAR_INSTALL_ERROR2
|
||||
ECHO PHP_PEAR_INSTALL_DIR is not set correctly.
|
||||
ECHO pearcmd.php could not be found there.
|
||||
ECHO Please fix it using your environment variable or modify
|
||||
ECHO the default value in pear.bat
|
||||
ECHO The current value is:
|
||||
ECHO %PHP_PEAR_INSTALL_DIR%
|
||||
GOTO END
|
||||
:PEAR_BIN_ERROR
|
||||
ECHO PHP_PEAR_BIN_DIR is not set correctly.
|
||||
ECHO Please fix it using your environment variable or modify
|
||||
ECHO the default value in pear.bat
|
||||
ECHO The current value is:
|
||||
ECHO %PHP_PEAR_BIN_DIR%
|
||||
GOTO END
|
||||
:PEAR_PHPBIN_ERROR
|
||||
ECHO PHP_PEAR_PHP_BIN is not set correctly.
|
||||
ECHO Please fix it using your environment variable or modify
|
||||
ECHO the default value in pear.bat
|
||||
ECHO The current value is:
|
||||
ECHO %PHP_PEAR_PHP_BIN%
|
||||
GOTO END
|
||||
:RUN
|
||||
"%PHP_PEAR_PHP_BIN%" -C -d output_buffering=1 -d safe_mode=0 -d open_basedir="" -d include_path="%PHP_PEAR_INSTALL_DIR%" -f "%PHP_PEAR_INSTALL_DIR%\pearcmd.php" -- %1 %2 %3 %4 %5 %6 %7 %8 %9
|
||||
:END
|
||||
@ECHO ON
|
|
@ -1,28 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
# first find which PHP binary to use
|
||||
if test "x$PHP_PEAR_PHP_BIN" != "x"; then
|
||||
PHP="$PHP_PEAR_PHP_BIN"
|
||||
else
|
||||
if test "@php_bin@" = '@'php_bin'@'; then
|
||||
PHP=php
|
||||
else
|
||||
PHP="@php_bin@"
|
||||
fi
|
||||
fi
|
||||
|
||||
# then look for the right pear include dir
|
||||
if test "x$PHP_PEAR_INSTALL_DIR" != "x"; then
|
||||
INCDIR=$PHP_PEAR_INSTALL_DIR
|
||||
INCARG="-d include_path=$PHP_PEAR_INSTALL_DIR"
|
||||
else
|
||||
if test "@php_dir@" = '@'php_dir'@'; then
|
||||
INCDIR=`dirname $0`
|
||||
INCARG=""
|
||||
else
|
||||
INCDIR="@php_dir@"
|
||||
INCARG="-d include_path=@php_dir@"
|
||||
fi
|
||||
fi
|
||||
|
||||
exec $PHP -C -q $INCARG -d output_buffering=1 -d open_basedir="" -d safe_mode=0 $INCDIR/pearcmd.php "$@"
|
|
@ -1,437 +0,0 @@
|
|||
<?php
|
||||
//
|
||||
// +----------------------------------------------------------------------+
|
||||
// | PHP Version 5 |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 1997-2004 The PHP Group |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This source file is subject to version 3.0 of the PHP license, |
|
||||
// | that is bundled with this package in the file LICENSE, and is |
|
||||
// | available through the world-wide-web at the following url: |
|
||||
// | http://www.php.net/license/3_0.txt. |
|
||||
// | If you did not receive a copy of the PHP license and are unable to |
|
||||
// | obtain it through the world-wide-web, please send a note to |
|
||||
// | license@php.net so we can mail you a copy immediately. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Authors: Stig Bakken <ssb@php.net> |
|
||||
// | Tomas V.V.Cox <cox@idecnet.com> |
|
||||
// | |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: pearcmd.php,v 1.33 2006/01/02 18:05:53 cellog Exp $
|
||||
|
||||
ob_end_clean();
|
||||
if (!defined('PEAR_RUNTYPE')) {
|
||||
// this is defined in peclcmd.php as 'pecl'
|
||||
define('PEAR_RUNTYPE', 'pear');
|
||||
}
|
||||
define('PEAR_IGNORE_BACKTRACE', 1);
|
||||
if (!function_exists('file_get_contents')) {
|
||||
function file_get_contents($filename)
|
||||
{
|
||||
$fp = fopen($filename, 'rb');
|
||||
$ret = '';
|
||||
while (!feof($fp)) {
|
||||
$ret .= fread($fp, 8092);;
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @nodep Gtk
|
||||
*/
|
||||
if ('@include_path@' != '@'.'include_path'.'@') {
|
||||
ini_set('include_path', '@include_path@');
|
||||
$raw = false;
|
||||
} else {
|
||||
// this is a raw, uninstalled pear, either a cvs checkout, or php distro
|
||||
$raw = true;
|
||||
}
|
||||
@ini_set('allow_url_fopen', true);
|
||||
if (!ini_get('safe_mode')) {
|
||||
@set_time_limit(0);
|
||||
}
|
||||
ob_implicit_flush(true);
|
||||
@ini_set('track_errors', true);
|
||||
@ini_set('html_errors', false);
|
||||
@ini_set('magic_quotes_runtime', false);
|
||||
$_PEAR_PHPDIR = '#$%^&*';
|
||||
set_error_handler('error_handler');
|
||||
|
||||
$pear_package_version = "@pear_version@";
|
||||
|
||||
require_once 'PEAR.php';
|
||||
require_once 'PEAR/Frontend.php';
|
||||
require_once 'PEAR/Config.php';
|
||||
require_once 'PEAR/Command.php';
|
||||
require_once 'Console/Getopt.php';
|
||||
|
||||
|
||||
PEAR_Command::setFrontendType('CLI');
|
||||
$all_commands = PEAR_Command::getCommands();
|
||||
|
||||
// remove this next part when we stop supporting that crap-ass PHP 4.2
|
||||
if (!isset($_SERVER['argv']) && !isset($argv) && !isset($HTTP_SERVER_VARS['argv'])) {
|
||||
die('ERROR: either use the CLI php executable, or set register_argc_argv=On in php.ini');
|
||||
}
|
||||
$argv = Console_Getopt::readPHPArgv();
|
||||
// fix CGI sapi oddity - the -- in pear.bat/pear is not removed
|
||||
if (php_sapi_name() != 'cli' && isset($argv[1]) && $argv[1] == '--') {
|
||||
unset($argv[1]);
|
||||
$argv = array_values($argv);
|
||||
}
|
||||
$progname = PEAR_RUNTYPE;
|
||||
if (in_array('getopt2', get_class_methods('Console_Getopt'))) {
|
||||
array_shift($argv);
|
||||
$options = Console_Getopt::getopt2($argv, "c:C:d:D:Gh?sSqu:vV");
|
||||
} else {
|
||||
$options = Console_Getopt::getopt($argv, "c:C:d:D:Gh?sSqu:vV");
|
||||
}
|
||||
if (PEAR::isError($options)) {
|
||||
usage($options);
|
||||
}
|
||||
|
||||
$opts = $options[0];
|
||||
|
||||
$fetype = 'CLI';
|
||||
if ($progname == 'gpear' || $progname == 'pear-gtk') {
|
||||
$fetype = 'Gtk';
|
||||
} else {
|
||||
foreach ($opts as $opt) {
|
||||
if ($opt[0] == 'G') {
|
||||
$fetype = 'Gtk';
|
||||
}
|
||||
}
|
||||
}
|
||||
//Check if Gtk and PHP >= 5.1.0
|
||||
if ($fetype == 'Gtk' && version_compare(phpversion(), '5.1.0', '>=')) {
|
||||
$fetype = 'Gtk2';
|
||||
}
|
||||
|
||||
$pear_user_config = '';
|
||||
$pear_system_config = '';
|
||||
$store_user_config = false;
|
||||
$store_system_config = false;
|
||||
$verbose = 1;
|
||||
|
||||
foreach ($opts as $opt) {
|
||||
switch ($opt[0]) {
|
||||
case 'c':
|
||||
$pear_user_config = $opt[1];
|
||||
break;
|
||||
case 'C':
|
||||
$pear_system_config = $opt[1];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
PEAR_Command::setFrontendType($fetype);
|
||||
$ui = &PEAR_Command::getFrontendObject();
|
||||
$config = &PEAR_Config::singleton($pear_user_config, $pear_system_config);
|
||||
|
||||
if (PEAR::isError($config)) {
|
||||
$_file = '';
|
||||
if ($pear_user_config !== false) {
|
||||
$_file .= $pear_user_config;
|
||||
}
|
||||
if ($pear_system_config !== false) {
|
||||
$_file .= '/' . $pear_system_config;
|
||||
}
|
||||
if ($_file == '/') {
|
||||
$_file = 'The default config file';
|
||||
}
|
||||
$config->getMessage();
|
||||
$ui->outputData("ERROR: $_file is not a valid config file or is corrupted.");
|
||||
// We stop, we have no idea where we are :)
|
||||
exit();
|
||||
}
|
||||
|
||||
// this is used in the error handler to retrieve a relative path
|
||||
$_PEAR_PHPDIR = $config->get('php_dir');
|
||||
$ui->setConfig($config);
|
||||
PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, array($ui, "displayFatalError"));
|
||||
if (ini_get('safe_mode')) {
|
||||
$ui->outputData('WARNING: running in safe mode requires that all files created ' .
|
||||
'be the same uid as the current script. PHP reports this script is uid: ' .
|
||||
@getmyuid() . ', and current user is: ' . @get_current_user());
|
||||
}
|
||||
|
||||
$verbose = $config->get("verbose");
|
||||
$cmdopts = array();
|
||||
|
||||
if ($raw) {
|
||||
if (!$config->isDefinedLayer('user') && !$config->isDefinedLayer('system')) {
|
||||
$found = false;
|
||||
foreach ($opts as $opt) {
|
||||
if ($opt[0] == 'd' || $opt[0] == 'D') {
|
||||
$found = true; // the user knows what they are doing, and are setting config values
|
||||
}
|
||||
}
|
||||
if (!$found) {
|
||||
// no prior runs, try to install PEAR
|
||||
if (strpos(dirname(__FILE__), 'scripts')) {
|
||||
$packagexml = dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'package2.xml';
|
||||
$pearbase = dirname(dirname(__FILE__));
|
||||
} else {
|
||||
$packagexml = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'package2.xml';
|
||||
$pearbase = dirname(__FILE__);
|
||||
}
|
||||
if (file_exists($packagexml)) {
|
||||
$options[1] = array(
|
||||
'install',
|
||||
$packagexml
|
||||
);
|
||||
$config->set('php_dir', $pearbase . DIRECTORY_SEPARATOR . 'php');
|
||||
$config->set('data_dir', $pearbase . DIRECTORY_SEPARATOR . 'data');
|
||||
$config->set('doc_dir', $pearbase . DIRECTORY_SEPARATOR . 'docs');
|
||||
$config->set('test_dir', $pearbase . DIRECTORY_SEPARATOR . 'tests');
|
||||
$config->set('ext_dir', $pearbase . DIRECTORY_SEPARATOR . 'extensions');
|
||||
$config->set('bin_dir', $pearbase);
|
||||
$config->mergeConfigFile($pearbase . 'pear.ini', false);
|
||||
$config->store();
|
||||
$config->set('auto_discover', 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach ($opts as $opt) {
|
||||
$param = !empty($opt[1]) ? $opt[1] : true;
|
||||
switch ($opt[0]) {
|
||||
case 'd':
|
||||
list($key, $value) = explode('=', $param);
|
||||
$config->set($key, $value, 'user');
|
||||
break;
|
||||
case 'D':
|
||||
list($key, $value) = explode('=', $param);
|
||||
$config->set($key, $value, 'system');
|
||||
break;
|
||||
case 's':
|
||||
$store_user_config = true;
|
||||
break;
|
||||
case 'S':
|
||||
$store_system_config = true;
|
||||
break;
|
||||
case 'u':
|
||||
$config->remove($param, 'user');
|
||||
break;
|
||||
case 'v':
|
||||
$config->set('verbose', $config->get('verbose') + 1);
|
||||
break;
|
||||
case 'q':
|
||||
$config->set('verbose', $config->get('verbose') - 1);
|
||||
break;
|
||||
case 'V':
|
||||
usage(null, 'version');
|
||||
case 'c':
|
||||
case 'C':
|
||||
break;
|
||||
default:
|
||||
// all non pear params goes to the command
|
||||
$cmdopts[$opt[0]] = $param;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($store_system_config) {
|
||||
$config->store('system');
|
||||
}
|
||||
|
||||
if ($store_user_config) {
|
||||
$config->store('user');
|
||||
}
|
||||
|
||||
$command = (isset($options[1][0])) ? $options[1][0] : null;
|
||||
|
||||
if (empty($command) && ($store_user_config || $store_system_config)) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($fetype == 'Gtk' || $fetype == 'Gtk2') {
|
||||
if (!$config->validConfiguration()) {
|
||||
PEAR::raiseError('CRITICAL ERROR: no existing valid configuration files found in files ' .
|
||||
"'$pear_user_config' or '$pear_system_config', please copy an existing configuration" .
|
||||
'file to one of these locations, or use the -c and -s options to create one');
|
||||
}
|
||||
Gtk::main();
|
||||
} else do {
|
||||
if ($command == 'help') {
|
||||
usage(null, @$options[1][1]);
|
||||
}
|
||||
if (!$config->validConfiguration()) {
|
||||
PEAR::raiseError('CRITICAL ERROR: no existing valid configuration files found in files ' .
|
||||
"'$pear_user_config' or '$pear_system_config', please copy an existing configuration" .
|
||||
'file to one of these locations, or use the -c and -s options to create one');
|
||||
}
|
||||
|
||||
PEAR::pushErrorHandling(PEAR_ERROR_RETURN);
|
||||
$cmd = PEAR_Command::factory($command, $config);
|
||||
PEAR::popErrorHandling();
|
||||
if (PEAR::isError($cmd)) {
|
||||
usage(null, @$options[1][0]);
|
||||
}
|
||||
|
||||
$short_args = $long_args = null;
|
||||
PEAR_Command::getGetoptArgs($command, $short_args, $long_args);
|
||||
if (in_array('getopt2', get_class_methods('Console_Getopt'))) {
|
||||
array_shift($options[1]);
|
||||
$tmp = Console_Getopt::getopt2($options[1], $short_args, $long_args);
|
||||
} else {
|
||||
$tmp = Console_Getopt::getopt($options[1], $short_args, $long_args);
|
||||
}
|
||||
if (PEAR::isError($tmp)) {
|
||||
break;
|
||||
}
|
||||
list($tmpopt, $params) = $tmp;
|
||||
$opts = array();
|
||||
foreach ($tmpopt as $foo => $tmp2) {
|
||||
list($opt, $value) = $tmp2;
|
||||
if ($value === null) {
|
||||
$value = true; // options without args
|
||||
}
|
||||
if (strlen($opt) == 1) {
|
||||
$cmdoptions = $cmd->getOptions($command);
|
||||
foreach ($cmdoptions as $o => $d) {
|
||||
if (@$d['shortopt'] == $opt) {
|
||||
$opts[$o] = $value;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (substr($opt, 0, 2) == '--') {
|
||||
$opts[substr($opt, 2)] = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
$ok = $cmd->run($command, $opts, $params);
|
||||
if ($ok === false) {
|
||||
PEAR::raiseError("unknown command `$command'");
|
||||
}
|
||||
if (PEAR::isError($ok)) {
|
||||
PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, array($ui, "displayFatalError"));
|
||||
PEAR::raiseError($ok);
|
||||
}
|
||||
} while (false);
|
||||
|
||||
// {{{ usage()
|
||||
|
||||
function usage($error = null, $helpsubject = null)
|
||||
{
|
||||
global $progname, $all_commands;
|
||||
$stderr = fopen('php://stderr', 'w');
|
||||
if (PEAR::isError($error)) {
|
||||
fputs($stderr, $error->getMessage() . "\n");
|
||||
} elseif ($error !== null) {
|
||||
fputs($stderr, "$error\n");
|
||||
}
|
||||
if ($helpsubject != null) {
|
||||
$put = cmdHelp($helpsubject);
|
||||
} else {
|
||||
$put =
|
||||
"Commands:\n";
|
||||
$maxlen = max(array_map("strlen", $all_commands));
|
||||
$formatstr = "%-{$maxlen}s %s\n";
|
||||
ksort($all_commands);
|
||||
foreach ($all_commands as $cmd => $class) {
|
||||
$put .= sprintf($formatstr, $cmd, PEAR_Command::getDescription($cmd));
|
||||
}
|
||||
$put .=
|
||||
"Usage: $progname [options] command [command-options] <parameters>\n".
|
||||
"Type \"$progname help options\" to list all options.\n".
|
||||
"Type \"$progname help shortcuts\" to list all command shortcuts.\n".
|
||||
"Type \"$progname help <command>\" to get the help for the specified command.";
|
||||
}
|
||||
fputs($stderr, "$put\n");
|
||||
fclose($stderr);
|
||||
exit;
|
||||
}
|
||||
|
||||
function cmdHelp($command)
|
||||
{
|
||||
global $progname, $all_commands, $config;
|
||||
if ($command == "options") {
|
||||
return
|
||||
"Options:\n".
|
||||
" -v increase verbosity level (default 1)\n".
|
||||
" -q be quiet, decrease verbosity level\n".
|
||||
" -c file find user configuration in `file'\n".
|
||||
" -C file find system configuration in `file'\n".
|
||||
" -d foo=bar set user config variable `foo' to `bar'\n".
|
||||
" -D foo=bar set system config variable `foo' to `bar'\n".
|
||||
" -G start in graphical (Gtk) mode\n".
|
||||
" -s store user configuration\n".
|
||||
" -S store system configuration\n".
|
||||
" -u foo unset `foo' in the user configuration\n".
|
||||
" -h, -? display help/usage (this message)\n".
|
||||
" -V version information\n";
|
||||
} elseif ($command == "shortcuts") {
|
||||
$sc = PEAR_Command::getShortcuts();
|
||||
$ret = "Shortcuts:\n";
|
||||
foreach ($sc as $s => $c) {
|
||||
$ret .= sprintf(" %-8s %s\n", $s, $c);
|
||||
}
|
||||
return $ret;
|
||||
|
||||
} elseif ($command == "version") {
|
||||
return "PEAR Version: ".$GLOBALS['pear_package_version'].
|
||||
"\nPHP Version: ".phpversion().
|
||||
"\nZend Engine Version: ".zend_version().
|
||||
"\nRunning on: ".php_uname();
|
||||
|
||||
} elseif ($help = PEAR_Command::getHelp($command)) {
|
||||
if (is_string($help)) {
|
||||
return "$progname $command [options] $help\n";
|
||||
}
|
||||
if ($help[1] === null) {
|
||||
return "$progname $command $help[0]";
|
||||
} else {
|
||||
return "$progname $command [options] $help[0]\n$help[1]";
|
||||
}
|
||||
}
|
||||
return "Command '$command' is not valid, try 'pear help'";
|
||||
}
|
||||
|
||||
// }}}
|
||||
|
||||
function error_handler($errno, $errmsg, $file, $line, $vars) {
|
||||
if ((defined('E_STRICT') && $errno & E_STRICT) || !error_reporting()) {
|
||||
if (defined('E_STRICT') && $errno & E_STRICT) {
|
||||
return; // E_STRICT
|
||||
}
|
||||
if ($GLOBALS['config']->get('verbose') < 4) {
|
||||
return; // @silenced error, show all if debug is high enough
|
||||
}
|
||||
}
|
||||
$errortype = array (
|
||||
E_ERROR => "Error",
|
||||
E_WARNING => "Warning",
|
||||
E_PARSE => "Parsing Error",
|
||||
E_NOTICE => "Notice",
|
||||
E_CORE_ERROR => "Core Error",
|
||||
E_CORE_WARNING => "Core Warning",
|
||||
E_COMPILE_ERROR => "Compile Error",
|
||||
E_COMPILE_WARNING => "Compile Warning",
|
||||
E_USER_ERROR => "User Error",
|
||||
E_USER_WARNING => "User Warning",
|
||||
E_USER_NOTICE => "User Notice"
|
||||
);
|
||||
$prefix = $errortype[$errno];
|
||||
global $_PEAR_PHPDIR;
|
||||
if (stristr($file, $_PEAR_PHPDIR)) {
|
||||
$file = substr($file, strlen($_PEAR_PHPDIR) + 1);
|
||||
} else {
|
||||
$file = basename($file);
|
||||
}
|
||||
print "\n$prefix: $errmsg in $file on line $line\n";
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* tab-width: 4
|
||||
* c-basic-offset: 4
|
||||
* indent-tabs-mode: nil
|
||||
* mode: php
|
||||
* End:
|
||||
*/
|
||||
// vim600:syn=php
|
||||
|
||||
?>
|
|
@ -1,115 +0,0 @@
|
|||
@ECHO OFF
|
||||
|
||||
REM ----------------------------------------------------------------------
|
||||
REM PHP version 5
|
||||
REM ----------------------------------------------------------------------
|
||||
REM Copyright (c) 1997-2004 The PHP Group
|
||||
REM ----------------------------------------------------------------------
|
||||
REM This source file is subject to version 3.0 of the PHP license,
|
||||
REM that is bundled with this package in the file LICENSE, and is
|
||||
REM available at through the world-wide-web at
|
||||
REM http://www.php.net/license/3_0.txt.
|
||||
REM If you did not receive a copy of the PHP license and are unable to
|
||||
REM obtain it through the world-wide-web, please send a note to
|
||||
REM license@php.net so we can mail you a copy immediately.
|
||||
REM ----------------------------------------------------------------------
|
||||
REM Authors: Alexander Merz (alexmerz@php.net)
|
||||
REM ----------------------------------------------------------------------
|
||||
REM
|
||||
REM $Id: peardev.bat,v 1.3 2006/01/23 16:30:14 cellog Exp $
|
||||
|
||||
REM change this lines to match the paths of your system
|
||||
REM -------------------
|
||||
|
||||
|
||||
REM Test to see if this is a raw pear.bat (uninstalled version)
|
||||
SET TMPTMPTMPTMPT=@includ
|
||||
SET PMTPMTPMT=%TMPTMPTMPTMPT%e_path@
|
||||
FOR %%x IN ("@include_path@") DO (if %%x=="%PMTPMTPMT%" GOTO :NOTINSTALLED)
|
||||
|
||||
REM Check PEAR global ENV, set them if they do not exist
|
||||
IF "%PHP_PEAR_INSTALL_DIR%"=="" SET "PHP_PEAR_INSTALL_DIR=@include_path@"
|
||||
IF "%PHP_PEAR_BIN_DIR%"=="" SET "PHP_PEAR_BIN_DIR=@bin_dir@"
|
||||
IF "%PHP_PEAR_PHP_BIN%"=="" SET "PHP_PEAR_PHP_BIN=@php_bin@"
|
||||
GOTO :INSTALLED
|
||||
|
||||
:NOTINSTALLED
|
||||
ECHO WARNING: This is a raw, uninstalled pear.bat
|
||||
|
||||
REM Check to see if we can grab the directory of this file (Windows NT+)
|
||||
IF %~n0 == pear (
|
||||
FOR %%x IN (cli\php.exe php.exe) DO (if "%%~$PATH:x" NEQ "" (
|
||||
SET "PHP_PEAR_PHP_BIN=%%~$PATH:x"
|
||||
echo Using PHP Executable "%PHP_PEAR_PHP_BIN%"
|
||||
"%PHP_PEAR_PHP_BIN%" -v
|
||||
GOTO :NEXTTEST
|
||||
))
|
||||
GOTO :FAILAUTODETECT
|
||||
:NEXTTEST
|
||||
IF "%PHP_PEAR_PHP_BIN%" NEQ "" (
|
||||
|
||||
REM We can use this PHP to run a temporary php file to get the dirname of pear
|
||||
|
||||
echo ^<?php $s=getcwd^(^);chdir^($a=dirname^(__FILE__^).'\\'^);if^(stristr^($a,'\\scripts'^)^)$a=dirname^(dirname^($a^)^).'\\';$f=fopen^($s.'\\~a.a','wb'^);echo$s.'\\~a.a';fwrite^($f,$a^);fclose^($f^);chdir^($s^);?^> > ~~getloc.php
|
||||
"%PHP_PEAR_PHP_BIN%" ~~getloc.php
|
||||
set /p PHP_PEAR_BIN_DIR=fakeprompt < ~a.a
|
||||
DEL ~a.a
|
||||
DEL ~~getloc.php
|
||||
set "PHP_PEAR_INSTALL_DIR=%PHP_PEAR_BIN_DIR%pear"
|
||||
|
||||
REM Make sure there is a pearcmd.php at our disposal
|
||||
|
||||
IF NOT EXIST %PHP_PEAR_INSTALL_DIR%\pearcmd.php (
|
||||
IF EXIST %PHP_PEAR_INSTALL_DIR%\scripts\pearcmd.php COPY %PHP_PEAR_INSTALL_DIR%\scripts\pearcmd.php %PHP_PEAR_INSTALL_DIR%\pearcmd.php
|
||||
IF EXIST pearcmd.php COPY pearcmd.php %PHP_PEAR_INSTALL_DIR%\pearcmd.php
|
||||
IF EXIST %~dp0\scripts\pearcmd.php COPY %~dp0\scripts\pearcmd.php %PHP_PEAR_INSTALL_DIR%\pearcmd.php
|
||||
)
|
||||
)
|
||||
GOTO :INSTALLED
|
||||
) ELSE (
|
||||
REM Windows Me/98 cannot succeed, so allow the batch to fail
|
||||
)
|
||||
:FAILAUTODETECT
|
||||
echo WARNING: failed to auto-detect pear information
|
||||
:INSTALLED
|
||||
|
||||
REM Check Folders and files
|
||||
IF NOT EXIST "%PHP_PEAR_INSTALL_DIR%" GOTO PEAR_INSTALL_ERROR
|
||||
IF NOT EXIST "%PHP_PEAR_INSTALL_DIR%\pearcmd.php" GOTO PEAR_INSTALL_ERROR2
|
||||
IF NOT EXIST "%PHP_PEAR_BIN_DIR%" GOTO PEAR_BIN_ERROR
|
||||
IF NOT EXIST "%PHP_PEAR_PHP_BIN%" GOTO PEAR_PHPBIN_ERROR
|
||||
REM launch pearcmd
|
||||
GOTO RUN
|
||||
:PEAR_INSTALL_ERROR
|
||||
ECHO PHP_PEAR_INSTALL_DIR is not set correctly.
|
||||
ECHO Please fix it using your environment variable or modify
|
||||
ECHO the default value in pear.bat
|
||||
ECHO The current value is:
|
||||
ECHO %PHP_PEAR_INSTALL_DIR%
|
||||
GOTO END
|
||||
:PEAR_INSTALL_ERROR2
|
||||
ECHO PHP_PEAR_INSTALL_DIR is not set correctly.
|
||||
ECHO pearcmd.php could not be found there.
|
||||
ECHO Please fix it using your environment variable or modify
|
||||
ECHO the default value in pear.bat
|
||||
ECHO The current value is:
|
||||
ECHO %PHP_PEAR_INSTALL_DIR%
|
||||
GOTO END
|
||||
:PEAR_BIN_ERROR
|
||||
ECHO PHP_PEAR_BIN_DIR is not set correctly.
|
||||
ECHO Please fix it using your environment variable or modify
|
||||
ECHO the default value in pear.bat
|
||||
ECHO The current value is:
|
||||
ECHO %PHP_PEAR_BIN_DIR%
|
||||
GOTO END
|
||||
:PEAR_PHPBIN_ERROR
|
||||
ECHO PHP_PEAR_PHP_BIN is not set correctly.
|
||||
ECHO Please fix it using your environment variable or modify
|
||||
ECHO the default value in pear.bat
|
||||
ECHO The current value is:
|
||||
ECHO %PHP_PEAR_PHP_BIN%
|
||||
GOTO END
|
||||
:RUN
|
||||
"%PHP_PEAR_PHP_BIN%" -C -d memory_limit="-1" -d safe_mode=0 -d open_basedir="" -d output_buffering=1 -d include_path="%PHP_PEAR_INSTALL_DIR%" -f "%PHP_PEAR_INSTALL_DIR%\pearcmd.php" -- %1 %2 %3 %4 %5 %6 %7 %8 %9
|
||||
:END
|
||||
@ECHO ON
|
|
@ -1,28 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
# first find which PHP binary to use
|
||||
if test "x$PHP_PEAR_PHP_BIN" != "x"; then
|
||||
PHP="$PHP_PEAR_PHP_BIN"
|
||||
else
|
||||
if test "@php_bin@" = '@'php_bin'@'; then
|
||||
PHP=php
|
||||
else
|
||||
PHP="@php_bin@"
|
||||
fi
|
||||
fi
|
||||
|
||||
# then look for the right pear include dir
|
||||
if test "x$PHP_PEAR_INSTALL_DIR" != "x"; then
|
||||
INCDIR=$PHP_PEAR_INSTALL_DIR
|
||||
INCARG="-d include_path=$PHP_PEAR_INSTALL_DIR"
|
||||
else
|
||||
if test "@php_dir@" = '@'php_dir'@'; then
|
||||
INCDIR=`dirname $0`
|
||||
INCARG=""
|
||||
else
|
||||
INCDIR="@php_dir@"
|
||||
INCARG="-d include_path=@php_dir@"
|
||||
fi
|
||||
fi
|
||||
|
||||
exec $PHP -d memory_limit="-1" -C -q $INCARG -d output_buffering=1 -d open_basedir="" -d safe_mode=0 $INCDIR/pearcmd.php "$@"
|
|
@ -1,115 +0,0 @@
|
|||
@ECHO OFF
|
||||
|
||||
REM ----------------------------------------------------------------------
|
||||
REM PHP version 5
|
||||
REM ----------------------------------------------------------------------
|
||||
REM Copyright (c) 1997-2004 The PHP Group
|
||||
REM ----------------------------------------------------------------------
|
||||
REM This source file is subject to version 3.0 of the PHP license,
|
||||
REM that is bundled with this package in the file LICENSE, and is
|
||||
REM available at through the world-wide-web at
|
||||
REM http://www.php.net/license/3_0.txt.
|
||||
REM If you did not receive a copy of the PHP license and are unable to
|
||||
REM obtain it through the world-wide-web, please send a note to
|
||||
REM license@php.net so we can mail you a copy immediately.
|
||||
REM ----------------------------------------------------------------------
|
||||
REM Authors: Alexander Merz (alexmerz@php.net)
|
||||
REM ----------------------------------------------------------------------
|
||||
REM
|
||||
REM Last updated 02/08/2004 ($Id$ is not replaced if the file is binary)
|
||||
|
||||
REM change this lines to match the paths of your system
|
||||
REM -------------------
|
||||
|
||||
|
||||
REM Test to see if this is a raw pear.bat (uninstalled version)
|
||||
SET TMPTMPTMPTMPT=@includ
|
||||
SET PMTPMTPMT=%TMPTMPTMPTMPT%e_path@
|
||||
FOR %%x IN ("@include_path@") DO (if %%x=="%PMTPMTPMT%" GOTO :NOTINSTALLED)
|
||||
|
||||
REM Check PEAR global ENV, set them if they do not exist
|
||||
IF "%PHP_PEAR_INSTALL_DIR%"=="" SET "PHP_PEAR_INSTALL_DIR=@include_path@"
|
||||
IF "%PHP_PEAR_BIN_DIR%"=="" SET "PHP_PEAR_BIN_DIR=@bin_dir@"
|
||||
IF "%PHP_PEAR_PHP_BIN%"=="" SET "PHP_PEAR_PHP_BIN=@php_bin@"
|
||||
GOTO :INSTALLED
|
||||
|
||||
:NOTINSTALLED
|
||||
ECHO WARNING: This is a raw, uninstalled pear.bat
|
||||
|
||||
REM Check to see if we can grab the directory of this file (Windows NT+)
|
||||
IF %~n0 == pear (
|
||||
FOR %%x IN (cli\php.exe php.exe) DO (if "%%~$PATH:x" NEQ "" (
|
||||
SET "PHP_PEAR_PHP_BIN=%%~$PATH:x"
|
||||
echo Using PHP Executable "%PHP_PEAR_PHP_BIN%"
|
||||
"%PHP_PEAR_PHP_BIN%" -v
|
||||
GOTO :NEXTTEST
|
||||
))
|
||||
GOTO :FAILAUTODETECT
|
||||
:NEXTTEST
|
||||
IF "%PHP_PEAR_PHP_BIN%" NEQ "" (
|
||||
|
||||
REM We can use this PHP to run a temporary php file to get the dirname of pear
|
||||
|
||||
echo ^<?php $s=getcwd^(^);chdir^($a=dirname^(__FILE__^).'\\'^);if^(stristr^($a,'\\scripts'^)^)$a=dirname^(dirname^($a^)^).'\\';$f=fopen^($s.'\\~a.a','wb'^);echo$s.'\\~a.a';fwrite^($f,$a^);fclose^($f^);chdir^($s^);?^> > ~~getloc.php
|
||||
"%PHP_PEAR_PHP_BIN%" ~~getloc.php
|
||||
set /p PHP_PEAR_BIN_DIR=fakeprompt < ~a.a
|
||||
DEL ~a.a
|
||||
DEL ~~getloc.php
|
||||
set "PHP_PEAR_INSTALL_DIR=%PHP_PEAR_BIN_DIR%pear"
|
||||
|
||||
REM Make sure there is a pearcmd.php at our disposal
|
||||
|
||||
IF NOT EXIST %PHP_PEAR_INSTALL_DIR%\pearcmd.php (
|
||||
IF EXIST %PHP_PEAR_INSTALL_DIR%\scripts\pearcmd.php COPY %PHP_PEAR_INSTALL_DIR%\scripts\pearcmd.php %PHP_PEAR_INSTALL_DIR%\pearcmd.php
|
||||
IF EXIST pearcmd.php COPY pearcmd.php %PHP_PEAR_INSTALL_DIR%\pearcmd.php
|
||||
IF EXIST %~dp0\scripts\pearcmd.php COPY %~dp0\scripts\pearcmd.php %PHP_PEAR_INSTALL_DIR%\pearcmd.php
|
||||
)
|
||||
)
|
||||
GOTO :INSTALLED
|
||||
) ELSE (
|
||||
REM Windows Me/98 cannot succeed, so allow the batch to fail
|
||||
)
|
||||
:FAILAUTODETECT
|
||||
echo WARNING: failed to auto-detect pear information
|
||||
:INSTALLED
|
||||
|
||||
REM Check Folders and files
|
||||
IF NOT EXIST "%PHP_PEAR_INSTALL_DIR%" GOTO PEAR_INSTALL_ERROR
|
||||
IF NOT EXIST "%PHP_PEAR_INSTALL_DIR%\pearcmd.php" GOTO PEAR_INSTALL_ERROR2
|
||||
IF NOT EXIST "%PHP_PEAR_BIN_DIR%" GOTO PEAR_BIN_ERROR
|
||||
IF NOT EXIST "%PHP_PEAR_PHP_BIN%" GOTO PEAR_PHPBIN_ERROR
|
||||
REM launch pearcmd
|
||||
GOTO RUN
|
||||
:PEAR_INSTALL_ERROR
|
||||
ECHO PHP_PEAR_INSTALL_DIR is not set correctly.
|
||||
ECHO Please fix it using your environment variable or modify
|
||||
ECHO the default value in pear.bat
|
||||
ECHO The current value is:
|
||||
ECHO %PHP_PEAR_INSTALL_DIR%
|
||||
GOTO END
|
||||
:PEAR_INSTALL_ERROR2
|
||||
ECHO PHP_PEAR_INSTALL_DIR is not set correctly.
|
||||
ECHO pearcmd.php could not be found there.
|
||||
ECHO Please fix it using your environment variable or modify
|
||||
ECHO the default value in pear.bat
|
||||
ECHO The current value is:
|
||||
ECHO %PHP_PEAR_INSTALL_DIR%
|
||||
GOTO END
|
||||
:PEAR_BIN_ERROR
|
||||
ECHO PHP_PEAR_BIN_DIR is not set correctly.
|
||||
ECHO Please fix it using your environment variable or modify
|
||||
ECHO the default value in pear.bat
|
||||
ECHO The current value is:
|
||||
ECHO %PHP_PEAR_BIN_DIR%
|
||||
GOTO END
|
||||
:PEAR_PHPBIN_ERROR
|
||||
ECHO PHP_PEAR_PHP_BIN is not set correctly.
|
||||
ECHO Please fix it using your environment variable or modify
|
||||
ECHO the default value in pear.bat
|
||||
ECHO The current value is:
|
||||
ECHO %PHP_PEAR_PHP_BIN%
|
||||
GOTO END
|
||||
:RUN
|
||||
"%PHP_PEAR_PHP_BIN%" -C -n -d output_buffering=1 -d safe_mode=0 -d include_path="%PHP_PEAR_INSTALL_DIR%" -f "%PHP_PEAR_INSTALL_DIR%\peclcmd.php" -- %1 %2 %3 %4 %5 %6 %7 %8 %9
|
||||
:END
|
||||
@ECHO ON
|
|
@ -1,28 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
# first find which PHP binary to use
|
||||
if test "x$PHP_PEAR_PHP_BIN" != "x"; then
|
||||
PHP="$PHP_PEAR_PHP_BIN"
|
||||
else
|
||||
if test "@php_bin@" = '@'php_bin'@'; then
|
||||
PHP=php
|
||||
else
|
||||
PHP="@php_bin@"
|
||||
fi
|
||||
fi
|
||||
|
||||
# then look for the right pear include dir
|
||||
if test "x$PHP_PEAR_INSTALL_DIR" != "x"; then
|
||||
INCDIR=$PHP_PEAR_INSTALL_DIR
|
||||
INCARG="-d include_path=$PHP_PEAR_INSTALL_DIR"
|
||||
else
|
||||
if test "@php_dir@" = '@'php_dir'@'; then
|
||||
INCDIR=`dirname $0`
|
||||
INCARG=""
|
||||
else
|
||||
INCDIR="@php_dir@"
|
||||
INCARG="-d include_path=@php_dir@"
|
||||
fi
|
||||
fi
|
||||
|
||||
exec $PHP -C -n -q $INCARG -d output_buffering=1 -d safe_mode=0 $INCDIR/peclcmd.php "$@"
|
|
@ -1,45 +0,0 @@
|
|||
<?php
|
||||
//
|
||||
// +----------------------------------------------------------------------+
|
||||
// | PHP Version 5 |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 1997-2004 The PHP Group |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This source file is subject to version 3.0 of the PHP license, |
|
||||
// | that is bundled with this package in the file LICENSE, and is |
|
||||
// | available through the world-wide-web at the following url: |
|
||||
// | http://www.php.net/license/3_0.txt. |
|
||||
// | If you did not receive a copy of the PHP license and are unable to |
|
||||
// | obtain it through the world-wide-web, please send a note to |
|
||||
// | license@php.net so we can mail you a copy immediately. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Authors: Stig Bakken <ssb@php.net> |
|
||||
// | Tomas V.V.Cox <cox@idecnet.com> |
|
||||
// | |
|
||||
// +----------------------------------------------------------------------+
|
||||
//
|
||||
// $Id: peclcmd.php,v 1.1 2005/02/21 05:30:56 cellog Exp $
|
||||
|
||||
/**
|
||||
* @nodep Gtk
|
||||
*/
|
||||
if ('@include_path@' != '@'.'include_path'.'@') {
|
||||
ini_set('include_path', '@include_path@');
|
||||
$raw = false;
|
||||
} else {
|
||||
// this is a raw, uninstalled pear, either a cvs checkout, or php distro
|
||||
$raw = true;
|
||||
}
|
||||
define('PEAR_RUNTYPE', 'pecl');
|
||||
require_once 'pearcmd.php';
|
||||
/*
|
||||
* Local variables:
|
||||
* tab-width: 4
|
||||
* c-basic-offset: 4
|
||||
* indent-tabs-mode: nil
|
||||
* mode: php
|
||||
* End:
|
||||
*/
|
||||
// vim600:syn=php
|
||||
|
||||
?>
|
Loading…
Reference in New Issue