Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions
AutoloaderInterface Interface Reference
Inheritance diagram for AutoloaderInterface:
ClassLoaderWrapper

Public Member Functions

 addPsr4 ($nsPrefix, $paths, $prepend=false)
 
 addPsr0 ($nsPrefix, $paths, $prepend=false)
 
 setPsr0 ($nsPrefix, $paths)
 
 setPsr4 ($nsPrefix, $paths)
 
 loadClass ($className)
 
 findFile ($className)
 

Detailed Description

Interface for an autoloader class that allows the dynamic modification of PSR-0 and PSR-4 mappings

Definition at line 11 of file AutoloaderInterface.php.

Member Function Documentation

◆ addPsr0()

addPsr0 (   $nsPrefix,
  $paths,
  $prepend = false 
)

Adds a PSR-0 mapping from a namespace prefix to directories to search in for the corresponding class

Parameters
string$nsPrefixThe namespace prefix of the PSR-0 mapping
string | array$pathsThe path or paths to look in for the given prefix
bool$prependWhether to append the given path or paths to the paths already associated with the prefix
Returns
void

Implemented in ClassLoaderWrapper.

◆ addPsr4()

addPsr4 (   $nsPrefix,
  $paths,
  $prepend = false 
)

Adds a PSR-4 mapping from a namespace prefix to directories to search in for the corresponding class

Parameters
string$nsPrefixThe namespace prefix of the PSR-4 mapping
string | array$pathsThe path or paths to look in for the given prefix
bool$prependWhether to append the given path or paths to the paths already associated with the prefix
Returns
void

Implemented in ClassLoaderWrapper.

◆ findFile()

findFile (   $className)

Get filepath of class on system or false if it does not exist

Parameters
string$className
Returns
string|bool

Implemented in ClassLoaderWrapper.

◆ loadClass()

loadClass (   $className)

Attempts to load a class and returns true if successful.

Parameters
string$className
Returns
bool

Implemented in ClassLoaderWrapper.

◆ setPsr0()

setPsr0 (   $nsPrefix,
  $paths 
)

Creates new PSR-0 mappings from the given prefix to the given set of paths, eliminating previous mappings

Parameters
string$nsPrefixThe namespace prefix of the PSR-0 mapping
string | array$pathsThe path or paths to look in for the given prefix
Returns
void

Implemented in ClassLoaderWrapper.

◆ setPsr4()

setPsr4 (   $nsPrefix,
  $paths 
)

Creates new PSR-4 mappings from the given prefix to the given set of paths, eliminating previous mappings

Parameters
string$nsPrefixThe namespace prefix of the PSR-0 mapping
string | array$pathsThe path or paths to look in for the given prefix
Returns
void

Implemented in ClassLoaderWrapper.


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