Esempio n. 1
0
 function checkIfDoExists($table)
 {
     OA_Dal::_setupDataObjectOptions();
     global $_DB_DATAOBJECT;
     if (!is_array($_DB_DATAOBJECT['CONFIG']['class_location'])) {
         $location = $_DB_DATAOBJECT['CONFIG']['class_location'];
         $fileExists = DB_DataObject::findTableFile($location, $table);
     } else {
         foreach ($_DB_DATAOBJECT['CONFIG']['class_location'] as $k => $location) {
             $fileExists = DB_DataObject::findTableFile($location, $table);
             if ($fileExists) {
                 break;
             }
         }
     }
     return $fileExists;
 }
Esempio n. 2
0
 /**
  * autoload Class
  *
  * @param  string  $class  Class
  * @access private
  * @return string classname on Success
  */
 function _autoloadClass($class)
 {
     global $_DB_DATAOBJECT;
     if (empty($_DB_DATAOBJECT['CONFIG'])) {
         DB_DataObject::_loadConfig();
     }
     $class_prefix = empty($_DB_DATAOBJECT['CONFIG']['class_prefix']) ? '' : $_DB_DATAOBJECT['CONFIG']['class_prefix'];
     $table = substr($class, strlen($class_prefix));
     // only include the file if it exists - and barf badly if it has parse errors :)
     if (!empty($_DB_DATAOBJECT['CONFIG']['proxy']) || empty($_DB_DATAOBJECT['CONFIG']['class_location'])) {
         return false;
     }
     // CHANGED FOR PLUGINS
     // array of plugin class locations
     // see DAL _setupDataObjectOptions
     if (!is_array($_DB_DATAOBJECT['CONFIG']['class_location'])) {
         $location = $_DB_DATAOBJECT['CONFIG']['class_location'];
         $file = DB_DataObject::findTableFile($location, $table);
     } else {
         foreach ($_DB_DATAOBJECT['CONFIG']['class_location'] as $k => $location) {
             $file = DB_DataObject::findTableFile($location, $table);
             if ($file) {
                 break;
             }
         }
     }
     if (!$file) {
         DB_DataObject::raiseError("autoload:Could not find class {$class} using class_location value", DB_DATAOBJECT_ERROR_INVALIDCONFIG);
         return false;
     }
     include_once $file;
     $ce = substr(phpversion(), 0, 1) > 4 ? class_exists($class, false) : class_exists($class);
     if (!$ce) {
         DB_DataObject::raiseError("autoload:Could not autoload {$class}", DB_DATAOBJECT_ERROR_INVALIDCONFIG);
         return false;
     }
     return $class;
 }