命名空間下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;
這裏寫代碼片