PocketMine-MP 5.21.3 git-fcef015f32c0b0709cfd4d6f1b3c32f484b25bde
Loading...
Searching...
No Matches
pocketmine\thread\ThreadSafeClassLoader Class Reference
+ Inheritance diagram for pocketmine\thread\ThreadSafeClassLoader:
+ Collaboration diagram for pocketmine\thread\ThreadSafeClassLoader:

Public Member Functions

 addPath (string $namespacePrefix, string $path, bool $prepend=false)
 
 findClass (string $name)
 
 loadClass (string $name)
 
 register (bool $prepend=false)
 

Protected Member Functions

 appendOrPrependLookupEntry (ThreadSafeArray $list, string $entry, bool $prepend)
 
 getAndRemoveLookupEntries (ThreadSafeArray $list)
 
 normalizePath (string $path)
 

Detailed Description

This autoloader can be used and updated from multiple threads. Useful if classes need to be dynamically added after threads have already been started.

This is used to facilitate loading plugin classes, enabling plugins to be loaded after the server has started.

Definition at line 48 of file ThreadSafeClassLoader.php.

Constructor & Destructor Documentation

◆ __construct()

pocketmine\thread\ThreadSafeClassLoader::__construct ( )

Definition at line 61 of file ThreadSafeClassLoader.php.

Member Function Documentation

◆ addPath()

pocketmine\thread\ThreadSafeClassLoader::addPath ( string $namespacePrefix,
string $path,
bool $prepend = false )

Definition at line 74 of file ThreadSafeClassLoader.php.

◆ appendOrPrependLookupEntry()

pocketmine\thread\ThreadSafeClassLoader::appendOrPrependLookupEntry ( ThreadSafeArray $list,
string $entry,
bool $prepend )
protected

@phpstan-param ThreadSafeArray<int, string> $list

Definition at line 95 of file ThreadSafeClassLoader.php.

References pocketmine\thread\ThreadSafeClassLoader\getAndRemoveLookupEntries().

+ Here is the call graph for this function:

◆ findClass()

pocketmine\thread\ThreadSafeClassLoader::findClass ( string $name)

Returns the path for the class, if any

Definition at line 151 of file ThreadSafeClassLoader.php.

◆ getAndRemoveLookupEntries()

pocketmine\thread\ThreadSafeClassLoader::getAndRemoveLookupEntries ( ThreadSafeArray $list)
protected
Returns
string[]

@phpstan-param ThreadSafeArray<int, string> $list @phpstan-return list<string>

Definition at line 113 of file ThreadSafeClassLoader.php.

Referenced by pocketmine\thread\ThreadSafeClassLoader\appendOrPrependLookupEntry().

+ Here is the caller graph for this function:

◆ loadClass()

pocketmine\thread\ThreadSafeClassLoader::loadClass ( string $name)

Called when there is a class to load

Definition at line 130 of file ThreadSafeClassLoader.php.

◆ normalizePath()

pocketmine\thread\ThreadSafeClassLoader::normalizePath ( string $path)
protected

Definition at line 66 of file ThreadSafeClassLoader.php.

◆ register()

pocketmine\thread\ThreadSafeClassLoader::register ( bool $prepend = false)

Definition at line 121 of file ThreadSafeClassLoader.php.


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