remove debug from routes.php

This commit is contained in:
Aaron Moses 2019-12-22 22:58:11 +00:00
parent ce75d6bca8
commit e8e46f253c

View File

@ -1,26 +1,18 @@
<?php
#$fp = fopen('/config/data/sql.log', 'a');
#$route_time_start = microtime(true);
use \Grocy\Middleware\JsonMiddleware;
use \Grocy\Middleware\SessionAuthMiddleware;
use \Grocy\Middleware\ApiKeyAuthMiddleware;
use \Tuupola\Middleware\CorsMiddleware;
#fwrite($fp, "*** routing - dep load time : " . round((microtime(true) - $route_time_start),6) . "\n");
$main_route_time_start = microtime(true);
$session_cookie_name = $appContainer->LoginControllerInstance->GetSessionCookieName();
#fwrite($fp, "*** routing - session cookie name time : " . $session_cookie_name . "\n");
#fwrite($fp, "*** routing - get session cookie name time : " . round((microtime(true) - $main_route_time_start),6) . "\n");
$session_auth_middelware = new SessionAuthMiddleware($appContainer, $session_cookie_name);
#fwrite($fp, "*** routing - create session auth middleware time : " . round((microtime(true) - $main_route_time_start),6) . "\n");
$app->group('', function()
{
#$fp = fopen('/config/data/sql.log', 'a');
#$time_start = microtime(true);
// System routes
$this->get('/', '\Grocy\Controllers\SystemController:Root')->setName('root');
@ -44,9 +36,6 @@ $app->group('', function()
$this->get('/users', '\Grocy\Controllers\UsersController:UsersList');
$this->get('/user/{userId}', '\Grocy\Controllers\UsersController:UserEditForm');
#fwrite($fp, "*** routing - main route add base routes load time : " . round((microtime(true) - $time_start),6) . "\n");
#$stock_time_start = microtime(true);
// Stock routes
if (GROCY_FEATURE_FLAG_STOCK)
{
@ -68,8 +57,6 @@ $app->group('', function()
$this->get('/locationcontentsheet', '\Grocy\Controllers\StockController:LocationContentSheet');
$this->get('/quantityunitpluraltesting', '\Grocy\Controllers\StockController:QuantityUnitPluralFormTesting');
}
#fwrite($fp, "*** routing - main route add stock routes load time : " . round((microtime(true) - $stock_time_start),6) . "\n");
#$shopping_time_start = microtime(true);
// Shopping list routes
if (GROCY_FEATURE_FLAG_SHOPPINGLIST)
@ -78,8 +65,6 @@ $app->group('', function()
$this->get('/shoppinglistitem/{itemId}', '\Grocy\Controllers\StockController:ShoppingListItemEditForm');
$this->get('/shoppinglist/{listId}', '\Grocy\Controllers\StockController:ShoppingListEditForm');
}
#fwrite($fp, "*** routing - main route add shopping routes load time : " . round((microtime(true) - $shopping_time_start),6) . "\n");
#$recipies_time_start = microtime(true);
// Recipe routes
if (GROCY_FEATURE_FLAG_RECIPES)
@ -89,8 +74,6 @@ $app->group('', function()
$this->get('/recipe/{recipeId}/pos/{recipePosId}', '\Grocy\Controllers\RecipesController:RecipePosEditForm');
$this->get('/mealplan', '\Grocy\Controllers\RecipesController:MealPlan');
}
#fwrite($fp, "*** routing - main route add recipies routes load time : " . round((microtime(true) - $recipies_time_start),6) . "\n");
#$chores_time_start = microtime(true);
// Chore routes
if (GROCY_FEATURE_FLAG_CHORES)
@ -102,8 +85,6 @@ $app->group('', function()
$this->get('/chore/{choreId}', '\Grocy\Controllers\ChoresController:ChoreEditForm');
$this->get('/choressettings', '\Grocy\Controllers\ChoresController:ChoresSettings');
}
#fwrite($fp, "*** routing - main route add chores routes load time : " . round((microtime(true) - $chores_time_start),6) . "\n");
#$batteries_time_start = microtime(true);
// Battery routes
if (GROCY_FEATURE_FLAG_BATTERIES)
@ -115,8 +96,6 @@ $app->group('', function()
$this->get('/battery/{batteryId}', '\Grocy\Controllers\BatteriesController:BatteryEditForm');
$this->get('/batteriessettings', '\Grocy\Controllers\BatteriesController:BatteriesSettings');
}
#fwrite($fp, "*** routing - main route add batteries routes load time : " . round((microtime(true) - $batteries_time_start),6) . "\n");
#$tasks_time_start = microtime(true);
// Task routes
if (GROCY_FEATURE_FLAG_TASKS)
@ -127,8 +106,6 @@ $app->group('', function()
$this->get('/taskcategory/{categoryId}', '\Grocy\Controllers\TasksController:TaskCategoryEditForm');
$this->get('/taskssettings', '\Grocy\Controllers\TasksController:TasksSettings');
}
#fwrite($fp, "*** routing - main route add tasks routes load time : " . round((microtime(true) - $tasks_time_start),6) . "\n");
#$equipment_time_start = microtime(true);
// Equipment routes
if (GROCY_FEATURE_FLAG_EQUIPMENT)
@ -136,29 +113,20 @@ $app->group('', function()
$this->get('/equipment', '\Grocy\Controllers\EquipmentController:Overview');
$this->get('/equipment/{equipmentId}', '\Grocy\Controllers\EquipmentController:EditForm');
}
#fwrite($fp, "*** routing - main route add equipment routes load time : " . round((microtime(true) - $equipment_time_start),6) . "\n");
#$calendar_time_start = microtime(true);
// Calendar routes
if (GROCY_FEATURE_FLAG_CALENDAR)
{
$this->get('/calendar', '\Grocy\Controllers\CalendarController:Overview');
}
#fwrite($fp, "*** routing - main route add calendar routes load time : " . round((microtime(true) - $calendar_time_start),6) . "\n");
#$openapi_time_start = microtime(true);
// OpenAPI routes
$this->get('/api', '\Grocy\Controllers\OpenApiController:DocumentationUi');
$this->get('/manageapikeys', '\Grocy\Controllers\OpenApiController:ApiKeysList');
$this->get('/manageapikeys/new', '\Grocy\Controllers\OpenApiController:CreateNewApiKey');
#fwrite($fp, "*** routing - main route add open api routes load time : " . round((microtime(true) - $openapi_time_start),6) . "\n");
#fwrite($fp, "*** routing - main route add all routes load time : " . round((microtime(true) - $time_start),6) . "\n");
#fclose($fp);
})->add($session_auth_middelware);
#fwrite($fp, "*** routing - main route load time : " . round((microtime(true) - $main_route_time_start),6) . "\n");
#$api_route_time_start = microtime(true);
$app->group('/api', function()
{
@ -278,7 +246,3 @@ $app->group('/api', function()
'credentials' => false,
'cache' => 0,
]));
#fwrite($fp, "*** routing - api route load time : " . round((microtime(true) - $api_route_time_start),6) . "\n");
#fwrite($fp, "*** routing - total load time : " . round((microtime(true) - $route_time_start),6) . "\n");
#fclose($fp);