Definition at line 35 of file StandardAutoloader.php.
◆ __construct()
__construct |
( |
|
$options = null | ) |
|
◆ autoload()
Defined by Autoloadable; autoload a class
- Parameters
-
- Returns
- false|string
Implements Zend_Loader_SplAutoloader.
Definition at line 226 of file StandardAutoloader.php.
229 if (
false !== strpos(
$class, self::NS_SEPARATOR)) {
237 if (
false !== strpos(
$class, self::PREFIX_SEPARATOR)) {
elseif(isset( $params[ 'redirect_parent']))
$_option $_optionId $class
◆ handleError()
handleError |
( |
|
$errno, |
|
|
|
$errstr |
|
) |
| |
◆ isFallbackAutoloader()
◆ loadClass()
loadClass |
( |
|
$class, |
|
|
|
$type |
|
) |
| |
|
protected |
Load a class, based on its type (namespaced or prefixed)
- Parameters
-
- Returns
- void
Definition at line 306 of file StandardAutoloader.php.
308 if (!in_array(
$type, array(self::LOAD_NS, self::LOAD_PREFIX, self::ACT_AS_FALLBACK))) {
309 #require_once dirname(__FILE__) . '/Exception/InvalidArgumentException.php'; 314 if (
$type === self::ACT_AS_FALLBACK) {
317 if (version_compare(PHP_VERSION,
'5.3.2',
'>=')) {
318 $resolvedName = stream_resolve_include_path($filename);
319 if ($resolvedName !==
false) {
320 return include $resolvedName;
324 $this->error =
false;
325 set_error_handler(array($this,
'handleError'), E_WARNING);
327 restore_error_handler();
336 if (0 === strpos(
$class, $leader)) {
338 $trimmedClass = substr(
$class, strlen($leader));
342 if (file_exists($filename)) {
343 return include $filename;
transformClassNameToFilename($class, $directory)
$_option $_optionId $class
◆ normalizeDirectory()
normalizeDirectory |
( |
|
$directory | ) |
|
|
protected |
Normalize the directory to include a trailing directory separator
- Parameters
-
- Returns
- string
Definition at line 357 of file StandardAutoloader.php.
359 $last = $directory[strlen($directory) - 1];
360 if (in_array($last, array(
'/',
'\\'))) {
361 $directory[strlen($directory) - 1] = DIRECTORY_SEPARATOR;
364 $directory .= DIRECTORY_SEPARATOR;
◆ register()
◆ registerNamespace()
registerNamespace |
( |
|
$namespace, |
|
|
|
$directory |
|
) |
| |
◆ registerNamespaces()
registerNamespaces |
( |
|
$namespaces | ) |
|
◆ registerPrefix()
registerPrefix |
( |
|
$prefix, |
|
|
|
$directory |
|
) |
| |
◆ registerPrefixes()
registerPrefixes |
( |
|
$prefixes | ) |
|
◆ setFallbackAutoloader()
setFallbackAutoloader |
( |
|
$flag | ) |
|
◆ setOptions()
Configure autoloader
Allows specifying both "namespace" and "prefix" pairs, using the following structure: array( 'namespaces' => array( 'Zend' => '/path/to/Zend/library', 'Doctrine' => '/path/to/Doctrine/library', ), 'prefixes' => array( 'Phly_' => '/path/to/Phly/library', ), 'fallback_autoloader' => true, )
- Parameters
-
array | Traversable | $options | |
- Returns
- Zend_Loader_StandardAutoloader
Implements Zend_Loader_SplAutoloader.
Definition at line 98 of file StandardAutoloader.php.
101 #require_once dirname(__FILE__) . '/Exception/InvalidArgumentException.php'; 113 if (is_array($pairs) || $pairs instanceof Traversable) {
118 if (is_array($pairs) || $pairs instanceof Traversable) {
setFallbackAutoloader($flag)
defined('MTF_BOOT_FILE')||define('MTF_BOOT_FILE' __FILE__
registerNamespaces($namespaces)
registerPrefix($prefix, $directory)
registerPrefixes($prefixes)
◆ transformClassNameToFilename()
transformClassNameToFilename |
( |
|
$class, |
|
|
|
$directory |
|
) |
| |
|
protected |
Transform the class name to a filename
- Parameters
-
string | $class | |
string | $directory | |
- Returns
- string
Definition at line 283 of file StandardAutoloader.php.
288 preg_match(
'/(?P<namespace>.+\\\)?(?P<class>[^\\\]+$)/',
$class, $matches);
290 $class = (isset($matches[
'class'])) ? $matches[
'class'] :
'';
291 $namespace = (isset($matches[
'namespace'])) ? $matches[
'namespace'] :
'';
294 . str_replace(self::NS_SEPARATOR,
'/', $namespace)
295 . str_replace(self::PREFIX_SEPARATOR,
'/',
$class)
$_option $_optionId $class
◆ $error
◆ $fallbackAutoloaderFlag
$fallbackAutoloaderFlag = false |
|
protected |
◆ $namespaces
◆ $prefixes
◆ ACT_AS_FALLBACK
const ACT_AS_FALLBACK = 'fallback_autoloader' |
◆ AUTOREGISTER_ZF
const AUTOREGISTER_ZF = 'autoregister_zf' |
◆ LOAD_NS
const LOAD_NS = 'namespaces' |
◆ LOAD_PREFIX
const LOAD_PREFIX = 'prefixes' |
◆ NS_SEPARATOR
const NS_SEPARATOR = '\\' |
◆ PREFIX_SEPARATOR
const PREFIX_SEPARATOR = '_' |
The documentation for this class was generated from the following file: