58 if ((
null !== $dirs) && !is_string($dirs) && !is_array($dirs)) {
59 #require_once 'Zend/Exception.php'; 60 throw new Zend_Exception(
'Directory argument must be a string or an array');
68 if (is_string($dirs)) {
69 $dirs = explode(PATH_SEPARATOR, $dirs);
71 foreach ($dirs as $key => $dir) {
75 $dir = rtrim($dir,
'\\/');
76 $dirs[$key] = $dir . DIRECTORY_SEPARATOR .
$dirPath;
79 $file = basename($file);
86 #require_once 'Zend/Exception.php'; 87 throw new Zend_Exception(
"File \"$file\" does not exist or class \"$class\" was not found in the file");
114 public static function loadFile($filename, $dirs =
null, $once =
false)
122 if (!empty($dirs) && (is_array($dirs) || is_string($dirs))) {
123 if (is_array($dirs)) {
124 $dirs = implode(PATH_SEPARATOR, $dirs);
126 $incPath = get_include_path();
127 set_include_path($dirs . PATH_SEPARATOR . $incPath);
134 include_once $filename;
143 set_include_path($incPath);
170 if (strtoupper(substr(PHP_OS, 0, 3)) ==
'WIN' 171 && preg_match(
'/^[a-z]:/i', $filename)
178 foreach (self::explodeIncludePath() as
$path) {
185 $file =
$path .
'/' . $filename;
204 if (
null ===
$path) {
205 $path = get_include_path();
208 if (PATH_SEPARATOR ==
':') {
233 trigger_error(__CLASS__ .
'::' . __METHOD__ .
' is deprecated as of 1.8.0 and will be removed with 2.0.0; use Zend_Loader_Autoloader instead', E_USER_NOTICE);
237 }
catch (Exception $e) {
254 trigger_error(__CLASS__ .
'::' . __METHOD__ .
' is deprecated as of 1.8.0 and will be removed with 2.0.0; use Zend_Loader_Autoloader instead', E_USER_NOTICE);
255 #require_once 'Zend/Loader/Autoloader.php'; 257 $autoloader->setFallbackAutoloader(
true);
259 if (
'Zend_Loader' !=
$class) {
262 if (!in_array(
'autoload', (array)
$methods)) {
263 #require_once 'Zend/Exception.php'; 264 throw new Zend_Exception(
"The class \"$class\" does not have an autoload() method");
267 $callback = array(
$class,
'autoload');
270 $autoloader->pushAutoloader($callback);
272 $autoloader->removeAutoloader($callback);
289 if (preg_match(
'/[^a-z0-9\\/\\\\_.:-]/i', $filename)) {
290 #require_once 'Zend/Exception.php'; 291 throw new Zend_Exception(
'Security check: Illegal character in filename');
312 return include_once $filespec;
314 return include $filespec ;
335 if ($lastNsPos = strripos(
$fileName,
'\\')) {
336 $namespace = substr(
$fileName, 0, $lastNsPos);
338 $file = str_replace(
'\\', DIRECTORY_SEPARATOR, $namespace) . DIRECTORY_SEPARATOR;
340 $file .= str_replace(
'_', DIRECTORY_SEPARATOR,
$fileName) .
'.php';
static loadClass($class, $dirs=null)
static explodeIncludePath($path=null)
static isReadable($filename)
static _includeFile($filespec, $once=false)
$_option $_optionId $class
static _securityCheck($filename)
static registerAutoload($class='Zend_Loader', $enabled=true)
static loadFile($filename, $dirs=null, $once=false)
static standardiseFile($file)