Static methods for loading classes and files.
category | Zend |
---|---|
package | Zend_Loader |
copyright | Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) |
license | New BSD License |
autoload(string $class) : string | false
Attach to spl_autoload() using the following:
spl_autoload_register(array('Zend_Loader', 'autoload'));
deprecated | Since 1.8.0 |
---|
string
string
false
Class name on success; false on failureexplodeIncludePath(string|null $path = null
) : array
If no path provided, uses current include_path. Works around issues that occur when the path includes stream schemas.
string
null
array
isReadable(string $filename) : boolean
This function uses the PHP include_path, where PHP's is_readable() does not.
Note from ZF-2900: If you use custom error handler, please check whether return value from error_reporting() is zero or not. At mark of fopen() can not suppress warning if the handler is used.
string
boolean
loadClass(string $class, string|array $dirs = null
) : void
If $dirs is a string or an array, it will search the directories in the order supplied, and attempt to load the first matching file.
If $dirs is null, it will split the class name at underscores to generate a path hierarchy (e.g., "Zend_Example_Class" will map to "Zend/Example/Class.php").
If the file was not found in the $dirs, or if no $dirs were specified, it will attempt to load it from PHP's include_path.
string
string
array
\Zend_Exception |
---|
loadFile(string $filename, string|array $dirs= null
, boolean $once= false
) : boolean
$filename must be the complete filename, including any extension such as ".php". Note that a security check is performed that does not permit extended characters in the filename. This method is intended for loading Zend Framework files.
If $dirs is a string or an array, it will search the directories in the order supplied, and attempt to load the first matching file.
If the file was not found in the $dirs, or if no $dirs were specified, it will attempt to load it from PHP's include_path.
If $once is TRUE, it will use include_once() instead of include().
string
string
array
boolean
\Zend_Exception |
---|
boolean
registerAutoload(string $class= 'Zend_Loader'
, boolean $enabled= true
) : void
deprecated | Since 1.8.0 |
---|
string
(optional)
boolean
(optional)
\Zend_Exception |
if spl_autoload() is not found or if the specified class does not have an autoload() method. |
---|
standardiseFile(string $file) : string
Convert the supplied filename into the namespace-aware standard, based on the Framework Interop Group reference implementation: http://groups.google.com/group/php-standards/web/psr-0-final-proposal
The filename must be formatted as "$file.php".
string
string
_includeFile(string $filespec, boolean $once = false
) : boolean
include() is not prefixed with the @ operator because if the file is loaded and contains a parse error, execution will halt silently and this is difficult to debug.
Always set display_errors = Off on production servers!
deprecated | Since 1.5.0; use loadFile() instead |
---|
string
boolean
boolean
_securityCheck(string $filename) : void
string
\Zend_Exception |
---|