Exemple #1
0
 /**
  * Register the PEAR2 autoload class with spl_autoload_register
  * 
  * @return void
  */
 protected static function register()
 {
     if (!self::$registered) {
         // set up __autoload
         $autoload = spl_autoload_functions();
         spl_autoload_register('PEAR2\\Autoload::load');
         if (function_exists('__autoload') && $autoload === false) {
             // __autoload() was being used, but now would be ignored, add
             // it to the autoload stack
             spl_autoload_register('__autoload');
         }
     }
     self::$registered = true;
 }
Exemple #2
0
 /**
  * Register the PEAR2 autoload class with spl_autoload_register
  *
  * @param bool $prepend Whether to prepend the load function to the
  * autoload stack instead of appending it.
  *
  * @return void
  */
 protected static function register($prepend = false)
 {
     if (!self::$registered) {
         // set up __autoload
         $autoload = spl_autoload_functions();
         spl_autoload_register('PEAR2\\Autoload::load', true, $prepend);
         if (function_exists('__autoload') && $autoload === false) {
             // __autoload() was being used, but now would be ignored,
             // add it to the autoload stack
             spl_autoload_register('__autoload');
         }
         if (function_exists('trait_exists')) {
             self::$checkFunctions[] = 'trait_exists';
         }
         self::$registered = true;
     }
 }