refactoring for dependency injection and testability.

This commit is contained in:
Taylor Otwell
2011-08-25 22:53:05 -05:00
parent 0b86c94551
commit 1e7850d9ba
75 changed files with 1441 additions and 1461 deletions

View File

@@ -23,13 +23,14 @@ class Package {
* </code>
*
* @param string|array $packages
* @param string $path
* @return void
*/
public static function load($packages)
public static function load($packages, $path = PACKAGE_PATH)
{
foreach ((array) $packages as $package)
{
if ( ! static::loaded($package) and file_exists($bootstrap = PACKAGE_PATH.$package.'/bootstrap'.EXT))
if ( ! static::loaded($package) and file_exists($bootstrap = $path.$package.'/bootstrap'.EXT))
{
require $bootstrap;
}