Pop\Loader\Autoloader::splAutoloadRegister PHP Method

splAutoloadRegister() public method

Register the autoloader instance with the SPL
public splAutoloadRegister ( boolean $suppress = true, boolean $fallback = false ) : Autoloader
$suppress boolean
$fallback boolean
return Autoloader
    public function splAutoloadRegister($suppress = true, $fallback = false)
    {
        $this->suppress = $suppress;
        $this->fallback = $fallback;
        if ($this->fallback) {
            spl_autoload_register($this, true, false);
        } else {
            spl_autoload_register($this, true, true);
        }
        return $this;
    }

Usage Example

Esempio n. 1
0
 public function testFallback()
 {
     $a = new Autoloader();
     $a->splAutoloadRegister(false, true);
     $this->assertInstanceOf('Pop\\Loader\\Autoloader', $a);
 }