PFinal\Wechat\ClassLoader::autoload PHP Method

autoload() public method

public autoload ( string $className )
$className string 完整类名
    public function autoload($className)
    {
        if (0 === strpos($className, $this->prefix)) {
            $parts = explode('\\', substr($className, $this->prefixLength));
            $filePath = $this->directory . DIRECTORY_SEPARATOR . implode(DIRECTORY_SEPARATOR, $parts) . '.php';
            if (is_file($filePath)) {
                require $filePath;
            }
        }
    }