gpac.php 466 B

123456789101112131415161718192021222324
  1. <?php namespace Gogs;
  2. define('GPAC_BASE_PATH', realpath(dirname(__FILE__)));
  3. spl_autoload_register(function($class) {
  4. $prefix = "Gogs\\";
  5. $len = strlen($prefix);
  6. if (strncmp($prefix, $class, $len) !== 0) {
  7. return;
  8. }
  9. $file = GPAC_BASE_PATH . DIRECTORY_SEPARATOR;
  10. $file .= str_replace(
  11. "\\", DIRECTORY_SEPARATOR, substr($class, $len)
  12. ) . ".php";
  13. if (file_exists($file))
  14. require_once $file;
  15. });
  16. return;
  17. ?>