clean up auto-loader registrations.

This commit is contained in:
Taylor Otwell 2012-02-20 15:50:09 -06:00
parent e996093b72
commit 1ff9deb150
1 changed files with 5 additions and 2 deletions

View File

@ -67,8 +67,11 @@ public static function register($bundle, $config = array())
// It is possible for the develoepr to specify auto-loader mappings // It is possible for the develoepr to specify auto-loader mappings
// directly on the bundle registration. This provides a convenient // directly on the bundle registration. This provides a convenient
// way to register mappings withuot a bootstrap. // way to register mappings withuot a bootstrap.
if (isset($config['autoloads']))
{
static::autoloading($bundle, $config); static::autoloading($bundle, $config);
} }
}
/** /**
* Load a bundle by running it's start-up script. * Load a bundle by running it's start-up script.
@ -141,7 +144,7 @@ protected static function autoloading($bundle, $config)
{ {
$path = trim(Bundle::path($bundle), DS); $path = trim(Bundle::path($bundle), DS);
foreach (array_get($config, 'autoloads', array()) as $type => $mappings) foreach ($config['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