diff --git a/src/Loader.php b/src/Loader.php index ad18530..bd7cb14 100644 --- a/src/Loader.php +++ b/src/Loader.php @@ -20,6 +20,15 @@ class Loader implements LoaderInterface { */ protected static $classMap; + /** + * Seed. + * + * This is the path of the composer.json file that triggered the bootstrap. + * + * @var + */ + protected static $seed; + /** * {@inheritdoc} */ @@ -32,7 +41,7 @@ public static function autoload($class) { $finder = $resolver->resolve(); // Have the path finder require the file and return TRUE or FALSE if it // found the file or not. - $finder->requireFile(); + $finder->requireFile(static::$seed); return TRUE; } catch (ClassLoaderException $e) { @@ -47,4 +56,11 @@ public static function setClassMap(array $class_map) { static::$classMap = $class_map; } + /** + * {@inheritdoc} + */ + public static function setSeed($seed) { + static::$seed = $seed; + } + } diff --git a/src/LoaderInterface.php b/src/LoaderInterface.php index 087046e..b32e607 100644 --- a/src/LoaderInterface.php +++ b/src/LoaderInterface.php @@ -28,4 +28,11 @@ public static function autoload($class); */ public static function setClassMap(array $class_map); + /** + * Sets the seed path. + * + * @param string $seed. + */ + public static function setSeed($seed); + }