| 1234567891011121314151617181920212223242526272829 |
- <?php
- declare(strict_types=1);
- use Glacier\Core\Config;
- /** HTML 转义(输出安全)。 */
- if (!function_exists('e')) {
- function e(mixed $value): string
- {
- return htmlspecialchars((string) $value, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8');
- }
- }
- /** 读取配置(点号路径)。 */
- if (!function_exists('config')) {
- function config(string $key, mixed $default = null): mixed
- {
- return Config::get($key, $default);
- }
- }
- /** 应用根目录(绝对路径)。 */
- if (!function_exists('app_root')) {
- function app_root(): string
- {
- return APP_ROOT;
- }
- }
|