/** * * * @version 02/11/22 * @author Wolfram Kriesing <*****@*****.**> * @return void * @access public */ function I18N_Format($locale) { parent::PEAR(); $this->_locale = $locale; //FIXXME catch locales that we dont have a class for yet, and use default class, which // translates using google or something ... if (include_once "I18N/Common/{$locale}.php") { $class = "I18N_Common_{$locale}"; $this->_localeObj = new $class(); } }
/** * PEAR_Registry constructor. * * @param string (optional) PEAR install directory (for .php files) * * @access public */ function PEAR_Registry($pear_install_dir = PEAR_INSTALL_DIR) { parent::PEAR(); $ds = DIRECTORY_SEPARATOR; $this->install_dir = $pear_install_dir; $this->statedir = $pear_install_dir . $ds . '.registry'; $this->filemap = $pear_install_dir . $ds . '.filemap'; $this->lockfile = $pear_install_dir . $ds . '.lock'; if (!file_exists($this->filemap)) { $this->rebuildFileMap(); } }
function Page() { parent::PEAR(); $this->_header =& new HTTP_Header(); //start the session if ($this->_start_session) { $this->startSession(); } //set language related session vars $this->setLanguage(); $this->setI18NDomain(); $this->setI18NDir(); }
function SApplication() { $this->_updateMeStatic(); if (ENABLE_PROFILING) { include_once 'Benchmark/Timer.php'; $this->_timer =& new Benchmark_Timer(); $this->_timer->start(); } parent::PEAR(); $u = SAURL::restore(); if (PEAR::isError($u)) { if ($u->getCode() == URL_MANIPULATION) { HTTP_Header::redirect(SAUrl::Url(APPLICATION_401_PAGE)); exit; } } }
function PEAR_Frontend_CLI() { parent::PEAR(); $term = getenv('TERM'); //(cox) $_ENV is empty for me in 4.1.1 if ($term) { // XXX can use ncurses extension here, if available if (preg_match('/^(xterm|vt220|linux)/', $term)) { $this->term['bold'] = sprintf("%c%c%c%c", 27, 91, 49, 109); $this->term['normal'] = sprintf("%c%c%c", 27, 91, 109); } elseif (preg_match('/^vt100/', $term)) { $this->term['bold'] = sprintf("%c%c%c%c%c%c", 27, 91, 49, 109, 0, 0); $this->term['normal'] = sprintf("%c%c%c%c%c", 27, 91, 109, 0, 0); } } elseif (OS_WINDOWS) { // XXX add ANSI codes here } }
function PEAR_Frontend_CLI() { parent::PEAR(); $term = getenv('TERM'); //(cox) $_ENV is empty for me in 4.1.1 if (function_exists('posix_isatty') && !posix_isatty(1)) { // output is being redirected to a file or through a pipe } elseif ($term) { // XXX can use ncurses extension here, if available if (preg_match('/^(xterm|vt220|linux)/', $term)) { $this->term['bold'] = sprintf("%c%c%c%c", 27, 91, 49, 109); $this->term['normal'] = sprintf("%c%c%c", 27, 91, 109); } elseif (preg_match('/^vt100/', $term)) { $this->term['bold'] = sprintf("%c%c%c%c%c%c", 27, 91, 49, 109, 0, 0); $this->term['normal'] = sprintf("%c%c%c%c%c", 27, 91, 109, 0, 0); } } elseif (OS_WINDOWS) { // XXX add ANSI codes here } }
/** * PEAR_Registry constructor. * * @param string (optional) PEAR install directory (for .php files) * * @access public */ function PEAR_Registry($pear_install_dir = PEAR_INSTALL_DIR) { parent::PEAR(); $ds = DIRECTORY_SEPARATOR; $this->install_dir = $pear_install_dir; $this->statedir = $pear_install_dir . $ds . '.registry'; $this->filemap = $pear_install_dir . $ds . '.filemap'; $this->lockfile = $pear_install_dir . $ds . '.lock'; // XXX Compatibility code should be removed in the future // rename all registry files if any to lowercase if (!OS_WINDOWS && ($handle = @opendir($this->statedir))) { $dest = $this->statedir . DIRECTORY_SEPARATOR; while (false !== ($file = readdir($handle))) { if (preg_match('/^.*[A-Z].*\\.reg$/', $file)) { rename($dest . $file, $dest . strtolower($file)); } } closedir($handle); } if (!file_exists($this->filemap)) { $this->rebuildFileMap(); } }
/** * PEAR_Registry constructor. * * @param string (optional) PEAR install directory (for .php files) * @param PEAR_ChannelFile PEAR_ChannelFile object representing the PEAR channel, if * default values are not desired. Only used the very first time a PEAR * repository is initialized * @param PEAR_ChannelFile PEAR_ChannelFile object representing the PECL channel, if * default values are not desired. Only used the very first time a PEAR * repository is initialized * * @access public */ function PEAR_Registry($pear_install_dir = PEAR_INSTALL_DIR, $pear_channel = false, $pecl_channel = false) { parent::PEAR(); $this->setInstallDir($pear_install_dir); $this->_pearChannel = $pear_channel; $this->_peclChannel = $pecl_channel; $this->_config = false; }
/** * PEAR_Registry constructor. * * @param string (optional) PEAR install directory (for .php files) * @param PEAR_ChannelFile PEAR_ChannelFile object representing the PEAR channel, if * default values are not desired. Only used the very first time a PEAR * repository is initialized * @param PEAR_ChannelFile PEAR_ChannelFile object representing the PECL channel, if * default values are not desired. Only used the very first time a PEAR * repository is initialized * * @access public */ function PEAR_Registry($pear_install_dir = PEAR_INSTALL_DIR, $pear_channel = false, $pecl_channel = false) { parent::PEAR(); $ds = DIRECTORY_SEPARATOR; $this->install_dir = $pear_install_dir; $this->channelsdir = $pear_install_dir . $ds . '.channels'; $this->statedir = $pear_install_dir . $ds . '.registry'; $this->filemap = $pear_install_dir . $ds . '.filemap'; $this->lockfile = $pear_install_dir . $ds . '.lock'; $this->_pearChannel = $pear_channel; $this->_peclChannel = $pecl_channel; $this->_config = false; }
/** * Call parent::PEAR() for destuctor to be called, and initialize vars * * @return: void * @access: public */ function I18N_Common() { parent::PEAR(); $this->_codes = array(); }
/** * PEAR_Command_Common constructor. * * @access public */ function PEAR_Command_Common(&$ui, &$config) { parent::PEAR(); $this->config =& $config; $this->ui =& $ui; }
/** * Constructor. * * @param string $faultcode Error code. */ function SOAP_Base_Object($faultcode = 'Client') { $this->_myfaultcode = $faultcode; parent::PEAR('SOAP_Fault'); }
/** * Constructor * * @param string error code * @see $debug_data, _debug() */ function SOAP_Base_Object($faultcode = 'Client') { $this->_myfaultcode = $faultcode; $this->_debug_flag = $GLOBALS['SOAP_DEBUG']; parent::PEAR('SOAP_Fault'); }
function __construct() { parent::PEAR(); }
function PEAR_Frontend_Web() { parent::PEAR(); $GLOBALS['_PEAR_Frontend_Web_log'] = ''; $this->config = $GLOBALS['_PEAR_Frontend_Web_config']; }
function PEAR_Start() { parent::PEAR(); if (OS_WINDOWS) { $this->configPrompt['php_bin'] = 'Path to CLI php.exe'; $this->config[] = 'php_bin'; $this->prefix = getcwd(); if (!@is_dir($this->prefix)) { if (@is_dir('c:\\php5')) { $this->prefix = 'c:\\php5'; } elseif (@is_dir('c:\\php4')) { $this->prefix = 'c:\\php4'; } elseif (@is_dir('c:\\php')) { $this->prefix = 'c:\\php'; } } $slash = "\\"; if (strrpos($this->prefix, '\\') === strlen($this->prefix) - 1) { $slash = ''; } $this->localInstall = false; $this->bin_dir = '$prefix'; $this->temp_dir = '$prefix' . $slash . 'tmp'; $this->download_dir = '$prefix' . $slash . 'tmp'; $this->php_dir = '$prefix' . $slash . 'pear'; $this->doc_dir = '$prefix' . $slash . 'docs'; $this->data_dir = '$prefix' . $slash . 'data'; $this->test_dir = '$prefix' . $slash . 'tests'; $this->www_dir = '$prefix' . $slash . 'www'; $this->cfg_dir = '$prefix' . $slash . 'cfg'; $this->pear_conf = PEAR_CONFIG_SYSCONFDIR . '\\pear.ini'; /* * Detects php.exe */ $this->validPHPBin = true; if ($t = $this->safeGetenv('PHP_PEAR_PHP_BIN')) { $this->php_bin = dirname($t); } elseif ($t = $this->safeGetenv('PHP_BIN')) { $this->php_bin = dirname($t); } elseif ($t = System::which('php')) { $this->php_bin = dirname($t); } elseif (is_file($this->prefix . '\\cli\\php.exe')) { $this->php_bin = $this->prefix . '\\cli'; } elseif (is_file($this->prefix . '\\php.exe')) { $this->php_bin = $this->prefix; } $phpexe = OS_WINDOWS ? '\\php.exe' : '/php'; if ($this->php_bin && !is_file($this->php_bin . $phpexe)) { $this->php_bin = ''; } else { if (strpos($this->php_bin, ':') === 0) { $this->php_bin = getcwd() . DIRECTORY_SEPARATOR . $this->php_bin; } } if (!is_file($this->php_bin . $phpexe)) { if (is_file('c:/php/cli/php.exe')) { $this->php_bin = 'c"\\php\\cli'; } elseif (is_file('c:/php5/php.exe')) { $this->php_bin = 'c:\\php5'; } elseif (is_file('c:/php4/cli/php.exe')) { $this->php_bin = 'c:\\php4\\cli'; } else { $this->validPHPBin = false; } } } else { $this->prefix = dirname(PHP_BINDIR); $this->pear_conf = PEAR_CONFIG_SYSCONFDIR . '/pear.conf'; if (get_current_user() != 'root') { $this->prefix = $this->safeGetenv('HOME') . '/pear'; $this->pear_conf = $this->safeGetenv('HOME') . '.pearrc'; } $this->bin_dir = '$prefix/bin'; $this->php_dir = '$prefix/share/pear'; $this->temp_dir = '/tmp/pear/install'; $this->download_dir = '/tmp/pear/install'; $this->doc_dir = '$prefix/docs'; $this->www_dir = '$prefix/www'; $this->cfg_dir = '$prefix/cfg'; $this->data_dir = '$prefix/data'; $this->test_dir = '$prefix/tests'; // check if the user has installed PHP with PHP or GNU layout if (@is_dir("{$this->prefix}/lib/php/.registry")) { $this->php_dir = '$prefix/lib/php'; } elseif (@is_dir("{$this->prefix}/share/pear/lib/.registry")) { $this->php_dir = '$prefix/share/pear/lib'; $this->doc_dir = '$prefix/share/pear/docs'; $this->data_dir = '$prefix/share/pear/data'; $this->test_dir = '$prefix/share/pear/tests'; } elseif (@is_dir("{$this->prefix}/share/php/.registry")) { $this->php_dir = '$prefix/share/php'; } } }
/** * Constructor * * @access public */ function Net_NNTP_Protocol_Client() { // // parent::PEAR('Net_NNTP_Error'); parent::PEAR(); }
/** * constructor * * @param string $userAgent User-Agent string */ function Net_UserAgent_Mobile_Common($userAgent) { parent::PEAR('Net_UserAgent_Mobile_Error'); $result = $this->parse($userAgent); if (Net_UserAgent_Mobile::isError($result)) { $this->isError($result); } $this->_userAgent = $userAgent; }
/** * Constructor * * @access public */ public function Net_NNTP_Protocol_Client() { // Init PEAR. parent::PEAR(); }
/** * Class constructor * * Defines all necessary constants and sets defaults * * @access public */ function System_Command($in_shell = null) { parent::PEAR(); // Defining constants $this->options = array('SEQUENCE' => true, 'SHUTDOWN' => false, 'SHELL' => $this->which($in_shell), 'OUTPUT' => true, 'NOHUP' => false, 'BACKGROUND' => false); // prepare the available control operators $this->controlOperators = array('PIPE' => '|', 'AND' => '&&', 'OR' => '||', 'GROUP' => ';', 'LFIFO' => '<', 'RFIFO' => '>'); // List of allowed/available shells $this->shells = array('sh', 'bash', 'zsh', 'tcsh', 'csh', 'ash', 'sash', 'esh', 'ksh'); // Find the first available shell if (empty($this->options['SHELL'])) { foreach ($this->shells as $shell) { if ($this->options['SHELL'] = $this->which($shell)) { break; } } // see if we still have no shell if (empty($this->options['SHELL'])) { $this = PEAR::raiseError(null, SYSTEM_COMMAND_NO_SHELL, null, E_USER_WARNING, null, 'System_Command_Error', true); return; } } // Caputre a temporary directory for capturing stderr from commands $this->tmpdir = System::tmpdir(); if (!System::mkDir("-p {$this->tmpdir}")) { $this = PEAR::raiseError(null, SYSTEM_COMMAND_TMPDIR_ERROR, null, E_USER_WARNING, null, 'System_Command_Error', true); return; } }
/** * Constructor * * This method instantiate a new Net_Growl object and opens a socket connection * to the specified Growl socket server. Currently, only UDP is supported by Growl. * The constructor registers a shutdown function {@link Net_Growl::_Net_Growl()} * that closes the socket if it is open. * * Example 1. * <code> * require_once 'Net/Growl.php'; * * $notifications = array('Errors', 'Messages'); * $growl = new Net_Growl('My application', $notification); * $growl->notify( 'Messages', * 'My notification title', * 'My notification description'); * </code> * * @param mixed Can be a Net_Growl_Application object or the application name string * @param array Array of notifications * @param string Optional password for Growl * @param array Array of options : 'host', 'port', 'protocol' for Growl socket server * @access public */ function Net_Growl(&$application, $notifications = array(), $password = '', $options = array()) { foreach ($options as $k => $v) { if (isset($this->_options[$k])) { $this->_options[$k] = $v; } } if (is_string($application)) { $this->_application =& new Net_Growl_Application($application, $notifications, $password); } elseif (is_object($application)) { $this->_application =& $application; } parent::PEAR(); }
/** * PEAR_Common constructor * * @access public */ function PEAR_Common() { parent::PEAR(); $this->config =& PEAR_Config::singleton(); $this->debug = $this->config->get('verbose'); }
/** * ??? * * @param string error code * @see $debug_data, debug() */ function SOAP_Base($faultcode) { $this->myfaultcode = $faultcode; parent::PEAR('SOAP_Fault'); }