diff --git a/HttpServer/Application.php b/HttpServer/Application.php index 4f32c5f4..947848a7 100644 --- a/HttpServer/Application.php +++ b/HttpServer/Application.php @@ -22,7 +22,7 @@ class Application extends HttpService */ protected function write($message, $category = 'app') { - $logger = Snowflake::app()->logger; + $logger = Snowflake::app()->getLogger(); $logger->write($message, $category); $logger->insert(); } diff --git a/HttpServer/Command.php b/HttpServer/Command.php index c25f4985..91118a1d 100644 --- a/HttpServer/Command.php +++ b/HttpServer/Command.php @@ -33,7 +33,7 @@ class Command extends \Console\Command */ public function onHandler(Input $dtl): string { - $manager = Snowflake::app()->server; + $manager = Snowflake::app()->getServer(); $manager->setDaemon($dtl->get('daemon', 0)); if (!in_array($dtl->get('action'), self::ACTIONS)) { diff --git a/HttpServer/Events/OnRequest.php b/HttpServer/Events/OnRequest.php index a05cd1b0..043803d4 100644 --- a/HttpServer/Events/OnRequest.php +++ b/HttpServer/Events/OnRequest.php @@ -88,7 +88,7 @@ class OnRequest extends Callback $response->end($message); } } catch (\ErrorException $exception) { - $logger = Snowflake::app()->logger; + $logger = Snowflake::app()->getLogger(); $logger->write($exception->getMessage(), 'shutdown'); } finally { unset($response); diff --git a/HttpServer/config.php b/HttpServer/config.php index 5ac7fb81..cb74f957 100644 --- a/HttpServer/config.php +++ b/HttpServer/config.php @@ -20,7 +20,7 @@ return [ ], 'events' => [ Event::SERVER_WORKER_START => function () { - $router = Snowflake::app()->router; + $router = Snowflake::app()->getRouter(); $router->loadRouterSetting(); }, ] diff --git a/System/Abstracts/Config.php b/System/Abstracts/Config.php index 117c8257..90e8273e 100644 --- a/System/Abstracts/Config.php +++ b/System/Abstracts/Config.php @@ -55,7 +55,7 @@ class Config extends Component */ public static function get($key, $try = FALSE, $default = null): mixed { - $instance = Snowflake::app()->config->getData(); + $instance = Snowflake::app()->getConfig()->getData(); if (!str_contains($key, '.')) { return isset($instance[$key]) ? $instance[$key] : $default; } @@ -85,7 +85,7 @@ class Config extends Component */ public static function set($key, $value): mixed { - $config = Snowflake::app()->config; + $config = Snowflake::app()->getConfig(); return $config->setData($key, $value); } @@ -96,7 +96,7 @@ class Config extends Component */ public static function has($key, $must_not_null = false): bool { - $config = Snowflake::app()->config; + $config = Snowflake::app()->getConfig(); if (!isset($config->data[$key])) { return false; } diff --git a/System/Error/Logger.php b/System/Error/Logger.php index b5d1c449..56942c5f 100644 --- a/System/Error/Logger.php +++ b/System/Error/Logger.php @@ -242,7 +242,7 @@ class Logger extends Component $code = $exception->getCode() == 0 ? 500 : $exception->getCode(); - $logger = Snowflake::app()->logger; + $logger = Snowflake::app()->getLogger(); $string = 'Exception: ' . PHP_EOL; $string .= '#. message: ' . $errorInfo['message'] . PHP_EOL;