XOOPS  2.6.0
Xoops\Core\Psr4ClassLoader Class Reference

Public Member Functions

 addNamespace ($prefix, $base_dir, $prepend=false)
 
 loadClass ($class)
 
 register ()
 

Static Public Member Functions

static addLoader ($namespace, $path)
 

Protected Member Functions

 loadMappedFile ($prefix, $relative_class)
 
 requireFile ($file)
 

Protected Attributes

 $prefixes = array()
 

Detailed Description

Definition at line 91 of file Psr4ClassLoader.php.

Member Function Documentation

static Xoops\Core\Psr4ClassLoader::addLoader (   $namespace,
  $path 
)
static

addLoader sets all basic options and registers the autoloader

Parameters
type$namespacenamespace
mixed$pathpath(s) to the namespace's directories Can be string - only one directory or array of strings - multiple directories
Returns
SplClassLoader

Definition at line 111 of file Psr4ClassLoader.php.

References $path.

Xoops\Core\Psr4ClassLoader::addNamespace (   $prefix,
  $base_dir,
  $prepend = false 
)

Adds a base directory for a namespace prefix.

Parameters
string$prefixThe namespace prefix.
string$base_dirBase directory for class files in namespace.
bool$prependIf true, prepend the base directory to the stack instead of appending it; this causes it to be searched first rather than last.
Returns
null

Definition at line 147 of file Psr4ClassLoader.php.

References DIRECTORY_SEPARATOR.

Xoops\Core\Psr4ClassLoader::loadClass (   $class)

Loads the class file for a given class name.

Parameters
string$classThe fully-qualified class name.
Returns
string|false The mapped file name on success, or boolean false on failure.

Definition at line 177 of file Psr4ClassLoader.php.

References Xoops\Core\Psr4ClassLoader\loadMappedFile().

Here is the call graph for this function:

Xoops\Core\Psr4ClassLoader::loadMappedFile (   $prefix,
  $relative_class 
)
protected

Load the mapped file for a namespace prefix and relative class.

Parameters
string$prefixThe namespace prefix.
string$relative_classThe relative class name.
Returns
false|string Boolean false if no mapped file can be loaded, or the name of the mapped file that was loaded.

Definition at line 215 of file Psr4ClassLoader.php.

References $file, and Xoops\Core\Psr4ClassLoader\requireFile().

Referenced by Xoops\Core\Psr4ClassLoader\loadClass().

Here is the call graph for this function:

Here is the caller graph for this function:

Xoops\Core\Psr4ClassLoader::register ( )

Register loader with SPL autoloader stack.

Returns
null

Definition at line 131 of file Psr4ClassLoader.php.

Xoops\Core\Psr4ClassLoader::requireFile (   $file)
protected

If a file exists, require it from the file system.

Parameters
string$fileThe file to require.
Returns
bool True if the file exists, false if not.

Definition at line 249 of file Psr4ClassLoader.php.

References $file.

Referenced by Xoops\Core\Psr4ClassLoader\loadMappedFile().

Here is the caller graph for this function:

Member Data Documentation

Xoops\Core\Psr4ClassLoader::$prefixes = array()
protected

Definition at line 99 of file Psr4ClassLoader.php.


The documentation for this class was generated from the following file: