Skip to content

Commit

Permalink
feat: increase base performance
Browse files Browse the repository at this point in the history
  • Loading branch information
mychidarko committed Aug 13, 2024
1 parent 3bc74f4 commit c929c0c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ public function __construct(array $userSettings = [])
$this->container = new Helpers\Container();
$this->loadConfig($userSettings);

if (!empty($this->config('scripts'))) {
foreach ($this->config('scripts') as $script) {
if (!empty(Config::get('scripts'))) {
foreach (Config::get('scripts') as $script) {
\call_user_func($script, $this, Config::get());
}

Expand Down Expand Up @@ -72,7 +72,7 @@ protected function setupErrorHandler()
*/
public function setErrorHandler($handler)
{
if (Anchor::toBool($this->config('debug')) === false) {
if (Anchor::toBool(Config::get('debug')) === false) {
if ($this->errorHandler instanceof Exception\Run) {
$this->errorHandler->unregister();
}
Expand Down Expand Up @@ -124,9 +124,10 @@ private function setupDefaultContainer()
return new Http\Headers();
});

Config::set('mode', _env('APP_ENV', $this->config('mode')));
Config::set('app.instance', $this);
Config::set('app.container', $this->container);

$this->config('mode', _env('APP_ENV', Config::get('mode')));
}

public function __get($name)
Expand Down
2 changes: 2 additions & 0 deletions src/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ class View
public static function attach($className, $name = null)
{
$class = new $className();

static::$engines[$name ?? static::getDiIndex($class)] = $class;

Config::set('views.engine', $name ?? static::getDiIndex($class));
}

Expand Down

0 comments on commit c929c0c

Please sign in to comment.