Example #1
0
 /**
  *
  *
  *   @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();
     }
 }
Example #3
0
 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();
 }
Example #4
0
 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;
         }
     }
 }
Example #5
0
 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
     }
 }
Example #6
0
 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
     }
 }
Example #7
0
 /**
  * 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();
     }
 }
Example #8
0
 /**
  * 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;
 }
Example #9
0
 /**
  * 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;
 }
Example #10
0
 /**
  * Call parent::PEAR() for destuctor to be called, and initialize vars
  *
  * @return: void
  * @access: public
  */
 function I18N_Common()
 {
     parent::PEAR();
     $this->_codes = array();
 }
Example #11
0
 /**
  * PEAR_Command_Common constructor.
  *
  * @access public
  */
 function PEAR_Command_Common(&$ui, &$config)
 {
     parent::PEAR();
     $this->config =& $config;
     $this->ui =& $ui;
 }
Example #12
0
File: Base.php Project: rolwi/koala
 /**
  * Constructor.
  *
  * @param string $faultcode  Error code.
  */
 function SOAP_Base_Object($faultcode = 'Client')
 {
     $this->_myfaultcode = $faultcode;
     parent::PEAR('SOAP_Fault');
 }
Example #13
0
 /**
  * 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');
 }
Example #14
0
 function __construct()
 {
     parent::PEAR();
 }
Example #15
0
 function PEAR_Frontend_Web()
 {
     parent::PEAR();
     $GLOBALS['_PEAR_Frontend_Web_log'] = '';
     $this->config = $GLOBALS['_PEAR_Frontend_Web_config'];
 }
Example #16
0
 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();
 }
Example #18
0
 /**
  * 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;
 }
Example #19
0
 /**
  * Constructor
  *
  * @access public
  */
 public function Net_NNTP_Protocol_Client()
 {
     // Init PEAR.
     parent::PEAR();
 }
Example #20
0
 /**
  * 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;
     }
 }
Example #21
0
 /**
  * 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();
 }
Example #22
0
 /**
  * PEAR_Common constructor
  *
  * @access public
  */
 function PEAR_Common()
 {
     parent::PEAR();
     $this->config =& PEAR_Config::singleton();
     $this->debug = $this->config->get('verbose');
 }
Example #23
0
 /**
  * ???
  *
  * @param    string  error code 
  * @see  $debug_data, debug()
  */
 function SOAP_Base($faultcode)
 {
     $this->myfaultcode = $faultcode;
     parent::PEAR('SOAP_Fault');
 }