creolab/laravel-modules — pull request #60 by henrikmartinsson (2014-05-31 19:28:53+00:00)
Title: Fixed bug with multiple paths in manifest and manual mode

Hi, I was going to use multiple paths but it didn't work as I expected. The "manual()" method in Finder doesn't take multiple paths into account. I guess this is a bug? Here's a possible fix.

First let's look at the "manual" mode. The purpose of this mode is optimization and to avoid scanning for directories. For this to work with multiple paths I chose to add the path to the modules array in the configuration like this:

'modules' => array(
'app/modules' => array(
'system' => array('enabled' => true),
),
'another/modules/path' => array(
'pages' => array('enabled' => false),
'seo' => array('enabled' => true),
),
),

Then there's the "manifest" mode. I moved the part that instantiates the modules into its own function. The manual function can then properly handle the new configuration options for modules as well as the the manifest mode.

Tested all three modes with both multiple and single module paths.

Cheers!