Commits

Gökhan ÖZTÜRK committed 100ed40

Added extending Driver library

  • Participants
  • Parent commits 3361a45

Comments (0)

Files changed (1)

File system/core/Loader.php

 	 */
 	public function driver($library = '', $params = NULL, $object_name = NULL)
 	{
-		if ( ! class_exists('CI_Driver_Library'))
+		$prefix = config_item('subclass_prefix');
+		
+		if ( ! class_exists('CI_Driver_Library') || ! class_exists($prefix . 'Driver_Library') )
 		{
 			// we aren't instantiating an object here, that'll be done by the Library itself
+			// This file must be called before extended library, for extends syntax.
 			require BASEPATH.'libraries/Driver.php';
+			
+			// Driver library extending implementation.
+			// If there is a Driver library extending, we call this file.
+			if (file_exists(APPPATH.'libraries/' . $prefix . 'Driver.php'))
+			{
+				require APPPATH.'libraries/' . $prefix . 'Driver.php';
+			}
 		}
 
 		// We can save the loader some time since Drivers will *always* be in a subfolder,