From 9b44b001e09d4a14fdbac52dba9df9a50c146ea6 Mon Sep 17 00:00:00 2001 From: Angry Meow Date: Sun, 18 Dec 2022 14:47:00 +0800 Subject: [PATCH 1/4] Update `composer.lock` --- composer.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.lock b/composer.lock index 9e256e4..77eb039 100644 --- a/composer.lock +++ b/composer.lock @@ -11,12 +11,12 @@ "version": "3.8.1", "source": { "type": "git", - "url": "https://github.com/bcosca/fatfree-core.git", + "url": "https://github.com/f3-factory/fatfree-core.git", "reference": "f6ea45472f55a1ecabd4ced74cb56f0efd6af34e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bcosca/fatfree-core/zipball/f6ea45472f55a1ecabd4ced74cb56f0efd6af34e", + "url": "https://api.github.com/repos/f3-factory/fatfree-core/zipball/f6ea45472f55a1ecabd4ced74cb56f0efd6af34e", "reference": "f6ea45472f55a1ecabd4ced74cb56f0efd6af34e", "shasum": "" }, @@ -36,8 +36,8 @@ "description": "A powerful yet easy-to-use PHP micro-framework designed to help you build dynamic and robust Web applications - fast!", "homepage": "http://fatfreeframework.com/", "support": { - "issues": "https://github.com/bcosca/fatfree-core/issues", - "source": "https://github.com/bcosca/fatfree-core/tree/3.8.1" + "issues": "https://github.com/f3-factory/fatfree-core/issues", + "source": "https://github.com/f3-factory/fatfree-core/tree/3.8.1" }, "time": "2022-11-04T23:15:19+00:00" }, From adcea469f9e1597ac26e26705658adc46717e80c Mon Sep 17 00:00:00 2001 From: Angry Meow Date: Sun, 18 Dec 2022 14:51:30 +0800 Subject: [PATCH 2/4] Class name / file name consistency --- config/webtools_config.ini | 4 ++-- controllers/Index_Controller.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config/webtools_config.ini b/config/webtools_config.ini index 03c30ba..d4f4848 100644 --- a/config/webtools_config.ini +++ b/config/webtools_config.ini @@ -10,7 +10,7 @@ PROJECT_CONFIG = {{ @PROJECT_DATA_DIR.'project_config' }} CACHE = false [routes] -GET / = n0nag0n\Root_Controller->index +GET / = n0nag0n\Index_Controller->index GET /init-environment = n0nag0n\Init_Environment_Controller->indexAction GET /init-environment/build = n0nag0n\Init_Environment_Controller->build GET /init-environment/@page = n0nag0n\Init_Environment_Controller->pageAction @@ -40,4 +40,4 @@ GET /manage-composer = n0nag0n\Manage_Composer_Controller->indexAction [maps] -[redirects] \ No newline at end of file +[redirects] diff --git a/controllers/Index_Controller.php b/controllers/Index_Controller.php index 4e85357..ad18015 100644 --- a/controllers/Index_Controller.php +++ b/controllers/Index_Controller.php @@ -3,7 +3,7 @@ namespace n0nag0n; -class Root_Controller extends Base_Controller { +class Index_Controller extends Base_Controller { public function index(\Base $fw): void { From 616ceaf3e43a09d345cab35e259666ee72a84f88 Mon Sep 17 00:00:00 2001 From: Angry Meow Date: Sun, 18 Dec 2022 14:53:43 +0800 Subject: [PATCH 3/4] Fixed `inited` spelling --- controllers/Base_Controller.php | 14 +++++++------- controllers/Index_Controller.php | 8 ++++---- ui/layout.htm | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/controllers/Base_Controller.php b/controllers/Base_Controller.php index 1e0aacd..fc25fb5 100644 --- a/controllers/Base_Controller.php +++ b/controllers/Base_Controller.php @@ -9,13 +9,13 @@ abstract class Base_Controller { public function __construct(\Base $fw) { $this->fw = $fw; - $has_been_initted = $this->hasBeenInitted(); - if($this->hasBeenInitted() === false && strpos($this->fw->URI, '/init-environment') === false) { + $has_been_inited = $this->hasBeenInited(); + if($this->hasBeenInited() === false && strpos($this->fw->URI, '/init-environment') === false) { $this->fw->reroute('/init-environment', false); } - $this->fw->set('has_been_initted', $has_been_initted); - if($has_been_initted) { + $this->fw->set('has_been_inited', $has_been_inited); + if($has_been_inited) { $project_config = new Project_Config($fw->DB); $project_config->load(); $this->fw->set('project_config', $project_config); @@ -28,8 +28,8 @@ public function renderHtml(string $file_path, array $hive = []): void { echo \Template::instance()->render('layout.htm'); } - public function hasBeenInitted(): bool { + public function hasBeenInited(): bool { return file_exists($this->fw->PROJECT_CONFIG); } - -} \ No newline at end of file + +} diff --git a/controllers/Index_Controller.php b/controllers/Index_Controller.php index 4e85357..92b0641 100644 --- a/controllers/Index_Controller.php +++ b/controllers/Index_Controller.php @@ -6,13 +6,13 @@ class Root_Controller extends Base_Controller { public function index(\Base $fw): void { - + // if the main config file is missing, start initing this bad boy - if(!$fw->has_been_initted) { - $fw->reroute('/init-environment', false); + if(!$fw->has_been_inited) { + $fw->reroute('/init-environment'); } $this->renderHtml('index/index.htm'); } -} \ No newline at end of file +} diff --git a/ui/layout.htm b/ui/layout.htm index 0045785..0a709b8 100644 --- a/ui/layout.htm +++ b/ui/layout.htm @@ -18,7 +18,7 @@