Commits

Phil Sturgeon committed 222a97b

Package paths can now be auto-loaded in autoload.php.

Comments (0)

Files changed (2)

application/config/autoload.php

 |
 | These are the things you can load automatically:
 |
-| 1. Libraries
-| 2. Helper files
-| 3. Custom config files
-| 4. Language files
-| 5. Models
+| 1. Packages
+| 2. Libraries
+| 3. Helper files
+| 4. Custom config files
+| 5. Language files
+| 6. Models
 |
 */
 
 /*
 | -------------------------------------------------------------------
+|  Auto-load Packges
+| -------------------------------------------------------------------
+| Prototype:
+|
+|  $autoload['packages'] = array(APPPATH.'third_party', '/usr/local/shared');
+|
+*/
+
+$autoload['packages'] = array(APPPATH.'third_party');
+
+
+/*
+| -------------------------------------------------------------------
 |  Auto-load Libraries
 | -------------------------------------------------------------------
 | These are the classes located in the system/libraries folder
 $autoload['model'] = array();
 
 
-
 /* End of file autoload.php */
 /* Location: ./application/config/autoload.php */

system/core/Loader.php

 			return FALSE;
 		}
 
+		// Autoload packages
+		if (isset($autoload['packages']))
+		{
+			foreach ($autoload['packages'] as $package_path)
+			{
+				$this->add_package_path($package_path);
+			}
+		}
+
 		// Load any custom config file
 		if (count($autoload['config']) > 0)
 		{