Abstracting the loading of files in the config directory depending on environments.
diff --git a/system/libraries/User_agent.php b/system/libraries/User_agent.php
index a007ace..4a29d7d 100644
--- a/system/libraries/User_agent.php
+++ b/system/libraries/User_agent.php
@@ -96,15 +96,10 @@
*/
private function _load_agent_file()
{
- if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/user_agents.php'))
- {
- include(APPPATH.'config/'.ENVIRONMENT.'/user_agents.php');
- }
- elseif (is_file(APPPATH.'config/user_agents.php'))
- {
- include(APPPATH.'config/user_agents.php');
- }
- else
+ load_environ_config('user_agents');
+
+ // Return FALSE if we still have no mimes after trying to load them up.
+ if (count($this->mimes) === 0)
{
return FALSE;
}