예제 #1
0
 /**
  * Loads a PEAR class.
  *
  * @param  string   classname to load
  * @param  bool     if errors should be supressed from the stack
  * @return bool  true success or false on failure
  *
  * @access public
  */
 function loadClass($classname, $supress_error = false)
 {
     if (!LiveUser::classExists($classname)) {
         $filename = str_replace('_', '/', $classname) . '.php';
         @(include_once $filename);
         if (!LiveUser::classExists($classname) && !$supress_error) {
             if (!LiveUser::fileExists($filename)) {
                 $msg = 'File for the class does not exist ' . $classname;
             } else {
                 $msg = 'Parse error in the file for class' . $classname;
             }
             PEAR_ErrorStack::staticPush('LiveUser', LIVEUSER_ERROR_CONFIG, 'exception', array(), $msg);
             return false;
         }
     }
     return true;
 }