From 2bf4a0ee5b54a451a923f3e593dc762bffc8aaf7 Mon Sep 17 00:00:00 2001 From: Aaron Moses Date: Sun, 22 Dec 2019 21:28:38 +0000 Subject: [PATCH] Clean up app.php --- app.php | 51 ++------------------------------------------------- 1 file changed, 2 insertions(+), 49 deletions(-) diff --git a/app.php b/app.php index 11a27c12..57bb74ff 100644 --- a/app.php +++ b/app.php @@ -1,7 +1,4 @@ function($container) { - #$view_time_start = microtime(true); - #$view = new \Slim\Views\Blade(__DIR__ . '/views', GROCY_DATAPATH . '/viewcache'); - if (!apcu_exists("views")) - { - apcu_store("views", new \Slim\Views\Blade(__DIR__ . '/views', GROCY_DATAPATH . '/viewcache')); - } - - $view = apcu_fetch("views"); - - #$fp = fopen('/config/data/sql.log', 'a'); - #fwrite($fp, "!!!App - view load time : " . round((microtime(true) - $view_time_start),6) . "\n"); - #fclose($fp); - return $view; + return new \Slim\Views\Blade(__DIR__ . '/views', GROCY_DATAPATH . '/viewcache'); }, 'LoginControllerInstance' => function($container) { @@ -83,45 +65,16 @@ $appContainer = new \Slim\Container([ }, 'UrlManager' => function($container) { - if (!apcu_exists("UrlManager")) - { - apcu_store("UrlManager", new UrlManager(GROCY_BASE_URL)); - } - - return apcu_fetch("UrlManager"); + return new UrlManager(GROCY_BASE_URL); }, 'ApiKeyHeaderName' => function($container) { return 'GROCY-API-KEY'; } ]); -#fwrite($fp, "!!!App - Container build time in seconds: " . round((microtime(true) - $app_time_start),6) . "\n"); -#$app_build_time_start = microtime(true); $app = new \Slim\App($appContainer); -#fwrite($fp, "!!!App - App object build time in seconds: " . round((microtime(true) - $app_time_start),6) . "\n"); - -#$fp = fopen('/www/data/sql.log', 'a'); -#fwrite($fp, "!!!Starting up loading app\n"); -#fwrite($fp, "!!!".print_r(ini_get_all(),True)."\n"); -#fwrite($fp, "!!!".print_r(opcache_get_status(),True)."\n"); -#fclose($fp); - -#phpinfo(); - -#$route_load_time_start = microtime(true); // Load routes from separate file require_once __DIR__ . '/routes.php'; -#fwrite($fp, "!!!App - Route load time in seconds: " . round((microtime(true) - $route_load_time_start),6) . "\n"); -#fwrite($fp, "!!!App - App build time in seconds: " . round((microtime(true) - $app_time_start),6) . "\n"); -#$fp = fopen('/config/data/sql.log', 'a'); -#fwrite($fp, "!!!App starting run\n"); -#$run_time_start = microtime(true); $app->run(); -#fwrite($fp, "!!!App - Total run time in seconds: " . round((microtime(true) - $run_time_start),6) . "\n"); -#fwrite($fp, "!!!App - Total execution time in seconds: " . round((microtime(true) - $time_start),6) . "\n"); -#fwrite($fp, "!!!APP - ini: ".print_r(ini_get_all(),TRUE)."\n"); -#fwrite($fp, "!!!APP - opcache status: ".print_r(opcache_get_status(),TRUE)."\n"); -#fwrite($fp, "!!!APP - opcache config: ".print_r(opcache_get_configuration(),TRUE)."\n"); -#fclose($fp);