public function loadClass($className)
    {

        foreach ($this->definitions as $def) {

            $nameSpace = $def->getNameSpace();
            $path = $def->getPath();
            $name = $className;
            if ($nameSpace) {

                $ns = rtrim($nameSpace, '\\').'\\';

                $nameLen = strlen($className);
                $nsLen = strlen($ns);

                if ($nameLen < $nsLen || substr($className, 0, $nsLen) !== $ns)
                    return false;

                $name = substr($name, $nsLen);
            }

            $ds = DIRECTORY_SEPARATOR;
            $path = $path ? $path.$ds : '';
            $path .= str_replace(['_', '\\'], $ds, $name).'.php';

            if (($path = stream_resolve_include_path($path)) !== false)
                include $path;

            if (class_exists($className, false))
                return true;
        }

        return false;
    }