register() public method

Attaches the ClassLoader to the PHP runtime
public register ( boolean $prepend = false ) : boolean
$prepend boolean
return boolean
コード例 #1
0
ファイル: AsyncWorker.php プロジェクト: boybook/PocketMine-MP
 public function run()
 {
     if (!interface_exists("ClassLoader", false)) {
         require \pocketmine\PATH . "src/spl/ClassLoader.php";
     }
     if (!class_exists("BaseClassLoader", false)) {
         require \pocketmine\PATH . "src/spl/BaseClassLoader.php";
     }
     $autoloader = new \BaseClassLoader();
     $autoloader->addPath(\pocketmine\PATH . "src");
     $autoloader->register(true);
 }
コード例 #2
0
 public function run()
 {
     if (!\interface_exists("ClassLoader", \false)) {
         require \pocketmine\PATH . "src/spl/ClassLoader.php";
     }
     if (!\class_exists("BaseClassLoader", \false)) {
         require \pocketmine\PATH . "src/spl/BaseClassLoader.php";
     }
     $autoloader = new \BaseClassLoader();
     $autoloader->addPath(\pocketmine\PATH . "src");
     $autoloader->addPath(\pocketmine\PATH . "src" . DIRECTORY_SEPARATOR . "spl");
     $autoloader->register(\true);
 }