From 7b0fa4900805cd88eea3ebf406eae6f795db83af Mon Sep 17 00:00:00 2001 From: Chris Alfano Date: Sat, 25 Apr 2020 16:35:12 +0000 Subject: [PATCH] refactor: fix spelling of degradations --- .../{degredations.tpl => degradations.tpl} | 12 +++++----- php-classes/Emergence/Dwoo/Engine.php | 2 +- .../{degredations.php => degradations.php} | 22 +++++++++---------- 3 files changed, 18 insertions(+), 18 deletions(-) rename html-templates/site-admin/tasks/configuration/{degredations.tpl => degradations.tpl} (72%) rename site-tasks/configuration/{degredations.php => degradations.php} (73%) diff --git a/html-templates/site-admin/tasks/configuration/degredations.tpl b/html-templates/site-admin/tasks/configuration/degradations.tpl similarity index 72% rename from html-templates/site-admin/tasks/configuration/degredations.tpl rename to html-templates/site-admin/tasks/configuration/degradations.tpl index a9860f2df..5ab466122 100644 --- a/html-templates/site-admin/tasks/configuration/degredations.tpl +++ b/html-templates/site-admin/tasks/configuration/degradations.tpl @@ -3,7 +3,7 @@ {block content} {if $changes} {/block} \ No newline at end of file diff --git a/php-classes/Emergence/Dwoo/Engine.php b/php-classes/Emergence/Dwoo/Engine.php index b4547c9c4..8c02cb41f 100644 --- a/php-classes/Emergence/Dwoo/Engine.php +++ b/php-classes/Emergence/Dwoo/Engine.php @@ -114,7 +114,7 @@ protected function initRuntimeVars(\Dwoo_ITemplate $tpl) // set site information $this->globals['Site'] = array( 'title' => Site::$title - ,'degredations' => Site::getConfig('degredations') + ,'degradations' => Site::getConfig('degradations') ); // add magic globals diff --git a/site-tasks/configuration/degredations.php b/site-tasks/configuration/degradations.php similarity index 73% rename from site-tasks/configuration/degredations.php rename to site-tasks/configuration/degradations.php index fb8e3a13f..3f8f2d7c2 100644 --- a/site-tasks/configuration/degredations.php +++ b/site-tasks/configuration/degradations.php @@ -1,19 +1,19 @@ 'Manage Degredations', + 'title' => 'Manage Degradations', 'description' => 'Enable or disable degredation flags that can be used to reduce the functionality of sites live while under failure or high load', 'icon' => 'power-off', 'handler' => function () { $config = Site::getConfig(); - $degredations = !empty($config['degredations']) ? $config['degredations'] : []; + $degradations = !empty($config['degradations']) ? $config['degradations'] : []; $changes = []; if ($_SERVER['REQUEST_METHOD'] == 'POST') { // parse degredation changes from request input - if (!empty($_POST['degredations']) && is_array($_POST['degredations'])) { - foreach ($_POST['degredations'] AS $key => $value) { + if (!empty($_POST['degradations']) && is_array($_POST['degradations'])) { + foreach ($_POST['degradations'] AS $key => $value) { if ($key && is_string($key)) { $changes[$key] = $value == 'on'; } @@ -37,26 +37,26 @@ } - // apply degredations + // apply degradations if (count($changes)) { foreach ($changes AS $key => $value) { - if (isset($degredations[$key]) && $degredations[$key] == $value) { + if (isset($degradations[$key]) && $degradations[$key] == $value) { unset($changes[$key]); continue; } - $degredations[$key] = $value; + $degradations[$key] = $value; } - $config['degredations'] = $degredations; + $config['degradations'] = $degradations; // update cached site config Cache::rawStore(Site::$rootPath, $config); } } - - return static::respond('degredations', [ - 'degredations' => $degredations, + + return static::respond('degradations', [ + 'degradations' => $degradations, 'changes' => $changes ]); }