diff options
author | Andrey Andreev <narf@bofh.bg> | 2013-01-29 14:05:02 +0100 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2013-01-29 14:05:02 +0100 |
commit | 0687911229be13e100724dbf8b15b95146b591a9 (patch) | |
tree | 0a843814096d353120efd4a2e648cc3cab05293e /system/libraries | |
parent | c26d34ff12458760eb843454d3224e1dad1fb2e0 (diff) |
Replace is_file() with the faster file_exists()
(where it makes sense)
Also:
- Implemented caching of configuration arrays for smileys, foreign characters and doctypes.
- Implemented cascading-style loading of configuration files (except for library configs, DB and constants.php).
Diffstat (limited to 'system/libraries')
-rw-r--r-- | system/libraries/User_agent.php | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/system/libraries/User_agent.php b/system/libraries/User_agent.php index 3fe2e0519..2f6f81909 100644 --- a/system/libraries/User_agent.php +++ b/system/libraries/User_agent.php @@ -175,15 +175,18 @@ class CI_User_agent { */ protected function _load_agent_file() { - if (is_file(APPPATH.'config/'.ENVIRONMENT.'/user_agents.php')) + if (($found = file_exists(APPPATH.'config/user_agents.php'))) { - include(APPPATH.'config/'.ENVIRONMENT.'/user_agents.php'); + include(APPPATH.'config/user_agents.php'); } - elseif (is_file(APPPATH.'config/user_agents.php')) + + if (file_exists(APPPATH.'config/'.ENVIRONMENT.'/user_agents.php')) { - include(APPPATH.'config/user_agents.php'); + include(APPPATH.'config/'.ENVIRONMENT.'/user_agents.php'); + $found = TRUE; } - else + + if ($found !== TRUE) { return FALSE; } |