/** * Take a root Module, parse the path, and add the given Module * * Takes a root Module, calls getFromModulePath, and then adds * the newModule to the resulting Module. * * @param Falcraft\Data\Components\File\Resource\DirectoryInterface $rootModule * @param string $path * @param Falcraft\Data\Components\File\Resource\DirectoryInterface $newModule * */ public static function addToModuleIdentityPath(LoaderResource\ModuleInterface $rootModule, $path, LoaderResource\ModuleInterface $newModule, $newModuleIdentifier = '') { File\Folder::addToFolderIdentityPath($rootModule, $path, $newModule, $newModuleIdentifier); }
$success = false; } if ($success) { echo "Success! Identifier: {$ret->getIdentifier()}\n"; } else { echo "Failure...\n"; } unset($ret); echo " Add To Folder Identity Path (data5, grandchild2) -- \n"; $success = true; $granchild2 = null; try { echo " Instantiate grandchild2 -> "; $grandchild2 = new File\Folder('data5', 'grandchild2'); echo "Success!\n"; echo " Add to Path (topFolder/childFolder2) -> "; File\Folder::addToFolderIdentityPath($top, 'topFolder/childFolder2', $grandchild2, $grandchild2->getIdentifier()); } catch (\Exception $e) { $success = false; } if ($success) { echo "Success!\n\n"; } else { echo "Failure...\n\n"; } $paths = File\Folder::getFolderIdentityPaths($top); echo "Paths: \n"; foreach ($paths as $path) { echo " {$path}\n"; } echo "\n";