命名空间下Config.php
namespace Auth\Config;
final class Config{
const AK=”adhsjskndhjasha”;
const SK=”ahdjkshaksjahdk”;
}
文件自动加载函数;
{
$path = str_replace('\\', DIRECTORY_SEPARATOR, $class);
$file = __DIR__ . '/Auth/' . $path . '.php';
if (file_exists($file)) {
require_once $file;
}
}
spl_autoload_register("classLoader");
use Auth\Config;
echo Config::AK;
这里写代码片