Commits

Eric Barnes  committed dc9dda8

Fixed logic and removed the error supressing

  • Participants
  • Parent commits 0c37e2e

Comments (0)

Files changed (8)

File system/core/Hooks.php

 		// 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);
 		}
 
 

File system/core/Router.php

 		}
 
 		// Load the routes.php file.
-
-		if (file_exists(APPPATH.'config/'.ENVIRONMENT.'/routes'.EXT))
+		if (is_file(APPPATH.'config/'.ENVIRONMENT.'/routes'.EXT))
 		{
 			include(APPPATH.'config/'.ENVIRONMENT.'/routes'.EXT);
 		}
-		else
+		elseif (is_file(APPPATH.'config/routes'.EXT))
 		{
-			@include(APPPATH.'config/routes'.EXT);
+			include(APPPATH.'config/routes'.EXT);
 		}
+		
 		$this->routes = ( ! isset($route) OR ! is_array($route)) ? array() : $route;
 		unset($route);
 

File system/helpers/download_helper.php

 		$extension = end($x);
 
 		// Load the mime types
-		if (file_exists(APPPATH.'config/'.ENVIRONMENT.'/mimes'.EXT))
+		if (is_file(APPPATH.'config/'.ENVIRONMENT.'/mimes'.EXT))
 		{
 			include(APPPATH.'config/'.ENVIRONMENT.'/mimes'.EXT);
 		}
-		else
+		elseif (is_file(APPPATH.'config/mimes'.EXT))
 		{
-			@include(APPPATH.'config/mimes'.EXT);
+			include(APPPATH.'config/mimes'.EXT);
 		}
 
 		// Set a default mime if we can't find it

File system/helpers/file_helper.php

 
 		if ( ! is_array($mimes))
 		{
-			if (file_exists(APPPATH.'config/'.ENVIRONMENT.'/mimes'.EXT))
+			if (is_file(APPPATH.'config/'.ENVIRONMENT.'/mimes'.EXT))
 			{
 				include(APPPATH.'config/'.ENVIRONMENT.'/mimes'.EXT);
 			}
-			else
+			elseif (is_file(APPPATH.'config/mimes'.EXT))
 			{
-				@include(APPPATH.'config/mimes'.EXT);
+				include(APPPATH.'config/mimes'.EXT);
 			}
 
 			if ( ! is_array($mimes))

File system/helpers/html_helper.php

 
 		if ( ! is_array($_doctypes))
 		{
-			if (file_exists(APPPATH.'config/'.ENVIRONMENT.'/doctypes'.EXT))
+			if (is_file(APPPATH.'config/'.ENVIRONMENT.'/doctypes'.EXT))
 			{
 				include(APPPATH.'config/'.ENVIRONMENT.'/doctypes'.EXT);
 			}
-			else
+			elseif (is_file(APPPATH.'config/doctypes'.EXT))
 			{
-				@include(APPPATH.'config/doctypes'.EXT);
+				include(APPPATH.'config/doctypes'.EXT);
 			}
 
 			if ( ! is_array($_doctypes))

File system/helpers/text_helper.php

 {
 	function convert_accented_characters($str)
 	{
-		if ( ! file_exists(APPPATH.'config/foreign_chars'.EXT) AND ! file_exists(APPPATH.'config/'.ENVIRONMENT.'/foreign_chars'.EXT))
+		if (is_file(APPPATH.'config/'.ENVIRONMENT.'/foreign_chars'.EXT))
 		{
-			return $str;
+			include(APPPATH.'config/'.ENVIRONMENT.'/foreign_chars'.EXT);
 		}
-
-		if (file_exists(APPPATH.'config/'.ENVIRONMENT.'/foreign_chars'.EXT))
+		elseif (is_file(APPPATH.'config/foreign_chars'.EXT))
 		{
-			include APPPATH.'config/'.ENVIRONMENT.'/foreign_chars'.EXT;
-		}
-		else
-		{
-			include APPPATH.'config/foreign_chars'.EXT;
+			include(APPPATH.'config/foreign_chars'.EXT);
 		}
 
 		if ( ! isset($foreign_characters))

File system/libraries/Upload.php

 
 		if (count($this->mimes) == 0)
 		{
-			if (file_exists(APPPATH.'config/'.ENVIRONMENT.'/mimes'.EXT))
+			if (is_file(APPPATH.'config/'.ENVIRONMENT.'/mimes'.EXT))
 			{
-				$_mimes_path = APPPATH.'config/'.ENVIRONMENT.'/mimes'.EXT;
+				include(APPPATH.'config/'.ENVIRONMENT.'/mimes'.EXT);
+			}
+			elseif (is_file(APPPATH.'config/mimes'.EXT))
+			{
+				include(APPPATH.'config//mimes'.EXT);
 			}
 			else
 			{
-				$_mimes_path = APPPATH.'config/mimes'.EXT;
+				return FALSE;
 			}
 
-			if (@require($_mimes_path))
-			{
-				$this->mimes = $mimes;
-				unset($mimes);
-			}
+			$this->mimes = $mimes;
+			unset($mimes);
 		}
 
 		return ( ! isset($this->mimes[$mime])) ? FALSE : $this->mimes[$mime];

File system/libraries/User_agent.php

 	 */
 	private function _load_agent_file()
 	{
-		if (file_exists(APPPATH.'config/'.ENVIRONMENT.'/user_agents'.EXT))
+		if (is_file(APPPATH.'config/'.ENVIRONMENT.'/user_agents'.EXT))
 		{
-			$_ua_path = APPPATH.'config/'.ENVIRONMENT.'/user_agents'.EXT;
+			include(APPPATH.'config/'.ENVIRONMENT.'/user_agents'.EXT);
+		}
+		elseif (is_file(APPPATH.'config/user_agents'.EXT))
+		{
+			include(APPPATH.'config/user_agents'.EXT);
 		}
 		else
 		{
-			$_ua_path = APPPATH.'config/user_agents'.EXT;
-		}
-
-		if ( ! @include($_ua_path))
-		{
 			return FALSE;
 		}