/**
  * Checks if a class exists and try to load it.
  * Will return the default class name back if the
  * file for some subclass is not available
  *
  * @param string $class The class name to check
  *
  * @return string
  */
 private static function _checkClass($class)
 {
     $class = sprintf(self::$_namespace, $class);
     if (!class_exists($class) && !Psr4Autoloader::getInstance()->loadClass($class)) {
         $class = sprintf(self::$_namespace, 'Node');
         trigger_error(sprintf(__('Could not load class "%1$s"'), $class), E_USER_ERROR);
     }
     return $class;
 }
Пример #2
0
<?php

require_once './libraries/Psr4Autoloader.php';
// instantiate the loader
$loader = \PMA\Psr4Autoloader::getInstance();
// register the autoloader
$loader->register();
// register the base directories for the namespace prefix
$loader->addNamespace('PMA', '.');
$loader->addNamespace('SqlParser', './libraries/sql-parser/src');