function __autoload($class) { /* * Look through the include path to see if a file for this class can be found */ $class_path = preg_replace('/_/', DIRECTORY_SEPARATOR, $class) . '.php'; foreach (explode(PATH_SEPARATOR, get_include_path()) as $path) { if (file_exists($path . DIRECTORY_SEPARATOR . $class_path)) { require_once $path . DIRECTORY_SEPARATOR . $class_path; return; } } /* * If we have gotten to this point the requested class is nowhere in the include path * ...time to look for a few patterns that might make this a "special class" */ if (preg_match('/Model$/', $class)) { $model_path = implode(DIRECTORY_SEPARATOR, array(APPLICATION_PATH, 'models', $class . '.php')); if (file_exists($model_path)) { require_once $model_path; return; } } DOMPDF_autoload($class); }
function __autoload($class_name) { if(function_exists('DOMPDF_autoload')) { DOMPDF_autoload($class_name); } if(file_exists("../obj/" . $class_name . '.php')){ include_once("../obj/" . $class_name . '.php'); } }
/** * Class autoloader * * Include classes automatically when they are instantiated. * @param string */ function __autoload($strClassName) { $objCache = FileCache::getInstance('autoload'); // Try to load the class name from the session cache if (!$GLOBALS['TL_CONFIG']['debugMode'] && isset($objCache->{$strClassName})) { if (@(include_once TL_ROOT . '/' . $objCache->{$strClassName})) { return; // The class could be loaded } else { unset($objCache->{$strClassName}); // The class has been removed } } $strLibrary = TL_ROOT . '/system/libraries/' . $strClassName . '.php'; // Check for libraries first if (file_exists($strLibrary)) { include_once $strLibrary; $objCache->{$strClassName} = 'system/libraries/' . $strClassName . '.php'; return; } // Then check the modules folder foreach (scan(TL_ROOT . '/system/modules/') as $strFolder) { if (substr($strFolder, 0, 1) == '.') { continue; } $strModule = TL_ROOT . '/system/modules/' . $strFolder . '/' . $strClassName . '.php'; if (file_exists($strModule)) { include_once $strModule; $objCache->{$strClassName} = 'system/modules/' . $strFolder . '/' . $strClassName . '.php'; return; } } // HOOK: include Swift classes if (class_exists('Swift', false)) { Swift::autoload($strClassName); return; } // HOOK: include DOMPDF classes if (function_exists('DOMPDF_autoload')) { DOMPDF_autoload($strClassName); return; } trigger_error(sprintf('Could not load class %s', $strClassName), E_USER_ERROR); }
/** * Default __autoload() function * * @param string $class */ function __autoload($class) { DOMPDF_autoload($class); }
/** * Handles the dompdf autoload for the given class name * * @param sfEvent $event * @access public * @static */ public static function autoload($className) { require_once dirname(__FILE__) . '/vendor/dompdf/dompdf_config.inc.php'; DOMPDF_autoload($className); return true; }