123456789101112131415161718192021222324 |
- <?php namespace Gogs;
- define('GPAC_BASE_PATH', realpath(dirname(__FILE__)));
- spl_autoload_register(function($class) {
- $prefix = "Gogs\\";
- $len = strlen($prefix);
- if (strncmp($prefix, $class, $len) !== 0) {
- return;
- }
- $file = GPAC_BASE_PATH . DIRECTORY_SEPARATOR;
- $file .= str_replace(
- "\\", DIRECTORY_SEPARATOR, substr($class, $len)
- ) . ".php";
- if (file_exists($file))
- require_once $file;
- });
- return;
- ?>
|