From 0ea04149bbae0fdcde92b7362e7cbd76f0df3865 Mon Sep 17 00:00:00 2001 From: bubbafoley Date: Thu, 17 Mar 2011 14:55:41 -0500 Subject: load config files from environment specific locations in core classes, helpers and libraries --- system/core/Hooks.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'system/core/Hooks.php') diff --git a/system/core/Hooks.php b/system/core/Hooks.php index 75fd811b0..e4f8cfa53 100644 --- a/system/core/Hooks.php +++ b/system/core/Hooks.php @@ -65,7 +65,15 @@ class CI_Hooks { // Grab the "hooks" definition file. // If there are no hooks, we're done. - @include(APPPATH.'config/hooks'.EXT); + if (file_exists(APPPATH.'config/'.ENVIRONMENT.'/hooks'.EXT)) + { + @include(APPPATH.'config/'.ENVIRONMENT.'/hooks'.EXT); + } + else + { + @include(APPPATH.'config/hooks'.EXT); + } + if ( ! isset($hook) OR ! is_array($hook)) { -- cgit v1.2.3-24-g4f1b From 928083406322821a35a7d8a4205620c3854772a6 Mon Sep 17 00:00:00 2001 From: Eric Barnes Date: Fri, 18 Mar 2011 09:02:37 -0400 Subject: Fixed coding to match standards from previous releases --- system/core/Hooks.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'system/core/Hooks.php') diff --git a/system/core/Hooks.php b/system/core/Hooks.php index e4f8cfa53..b41c645ae 100644 --- a/system/core/Hooks.php +++ b/system/core/Hooks.php @@ -67,13 +67,13 @@ class CI_Hooks { if (file_exists(APPPATH.'config/'.ENVIRONMENT.'/hooks'.EXT)) { - @include(APPPATH.'config/'.ENVIRONMENT.'/hooks'.EXT); + include(APPPATH.'config/'.ENVIRONMENT.'/hooks'.EXT); } else { @include(APPPATH.'config/hooks'.EXT); } - + if ( ! isset($hook) OR ! is_array($hook)) { -- cgit v1.2.3-24-g4f1b From fdd5b11b62f127901ddff2e5dc7923b063371070 Mon Sep 17 00:00:00 2001 From: Eric Barnes Date: Mon, 21 Mar 2011 21:28:58 -0400 Subject: Fixed logic and removed the error supressing --- system/core/Hooks.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'system/core/Hooks.php') diff --git a/system/core/Hooks.php b/system/core/Hooks.php index b41c645ae..d1e5586de 100644 --- a/system/core/Hooks.php +++ b/system/core/Hooks.php @@ -65,13 +65,13 @@ class CI_Hooks { // Grab the "hooks" definition file. // If there are no hooks, we're done. - if (file_exists(APPPATH.'config/'.ENVIRONMENT.'/hooks'.EXT)) + if (is_file(APPPATH.'config/'.ENVIRONMENT.'/hooks'.EXT)) { include(APPPATH.'config/'.ENVIRONMENT.'/hooks'.EXT); } - else + elseif (is_file(APPPATH.'config/hooks'.EXT)) { - @include(APPPATH.'config/hooks'.EXT); + include(APPPATH.'config/hooks'.EXT); } -- cgit v1.2.3-24-g4f1b From 05fa61144667c85b0463f7e8baa6af00aa195dc6 Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Wed, 6 Apr 2011 22:57:43 +0100 Subject: Made Environment Support optional. Comment out or delete the constant to stop environment checks. --- system/core/Hooks.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/core/Hooks.php') diff --git a/system/core/Hooks.php b/system/core/Hooks.php index d1e5586de..24fa1055b 100644 --- a/system/core/Hooks.php +++ b/system/core/Hooks.php @@ -65,7 +65,7 @@ class CI_Hooks { // Grab the "hooks" definition file. // If there are no hooks, we're done. - if (is_file(APPPATH.'config/'.ENVIRONMENT.'/hooks'.EXT)) + if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/hooks'.EXT)) { include(APPPATH.'config/'.ENVIRONMENT.'/hooks'.EXT); } -- cgit v1.2.3-24-g4f1b From 3a746655e92ec59ee7e731c3535673a9aedc5d3e Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Tue, 19 Apr 2011 10:59:47 -0500 Subject: Removing internal references to the EXT constant. Additionally, marked the constant as deprecated. Use ".php" instead. Also adding upgrade notes from 2.0.2 to 2.0.3. --- system/core/Hooks.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'system/core/Hooks.php') diff --git a/system/core/Hooks.php b/system/core/Hooks.php index 24fa1055b..fd6380f0a 100644 --- a/system/core/Hooks.php +++ b/system/core/Hooks.php @@ -65,13 +65,13 @@ class CI_Hooks { // Grab the "hooks" definition file. // If there are no hooks, we're done. - if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/hooks'.EXT)) + if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/hooks.php')) { - include(APPPATH.'config/'.ENVIRONMENT.'/hooks'.EXT); + include(APPPATH.'config/'.ENVIRONMENT.'/hooks.php'); } - elseif (is_file(APPPATH.'config/hooks'.EXT)) + elseif (is_file(APPPATH.'config/hooks.php')) { - include(APPPATH.'config/hooks'.EXT); + include(APPPATH.'config/hooks.php'); } -- cgit v1.2.3-24-g4f1b From 114ab0988e20ac6be39ad363ff897a1a3b85e565 Mon Sep 17 00:00:00 2001 From: Razican Date: Mon, 25 Apr 2011 17:26:45 +0200 Subject: Fixed double-space typo. --- system/core/Hooks.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'system/core/Hooks.php') diff --git a/system/core/Hooks.php b/system/core/Hooks.php index fd6380f0a..ffb3258d8 100644 --- a/system/core/Hooks.php +++ b/system/core/Hooks.php @@ -1,4 +1,4 @@ -