public static function onAutoLoad($class)
    {
        if (isset(self::$customMappings[$class])) {
            require_once(self::$customMappings[$class]);

            return true;
        }

        if (self::$_namespaces !== null) {
            foreach (self::$_namespaces as $data) {
                $ns = $data[0];

                $nsl = $data[2];


                if (substr($class, 0, $nsl) !== $ns) {
                    continue;
                }

                $dir = $data[1];
                $ext = $data[3];

                $file = $dir . str_replace('\\', '/', substr($class, $nsl)) . $ext;

                if (is_file($file)) {
                    require_once($file);

                    return true;
                }
            }
        }

        return false;
    }