cleaning up bundle registration.

This commit is contained in:
Taylor Otwell 2012-02-20 15:33:19 -06:00
parent 5c66658428
commit e996093b72
1 changed files with 5 additions and 4 deletions

View File

@ -64,6 +64,9 @@ public static function register($bundle, $config = array())
static::$bundles[$bundle] = array_merge($defaults, $config); static::$bundles[$bundle] = array_merge($defaults, $config);
// It is possible for the develoepr to specify auto-loader mappings
// directly on the bundle registration. This provides a convenient
// way to register mappings withuot a bootstrap.
static::autoloading($bundle, $config); static::autoloading($bundle, $config);
} }
@ -138,9 +141,7 @@ protected static function autoloading($bundle, $config)
{ {
$path = trim(Bundle::path($bundle), DS); $path = trim(Bundle::path($bundle), DS);
$autoloads = array_get($config, 'autoloads', array()); foreach (array_get($config, 'autoloads', array()) as $type => $mappings)
foreach ($autoloads as $type => $mappings)
{ {
// When registering each type of mapping we'll replace the (:bundle) // When registering each type of mapping we'll replace the (:bundle)
// place-holder with the path to the bundle's root directory, so // place-holder with the path to the bundle's root directory, so