Example #1
0
    $success = false;
}
if ($success) {
    echo "Success! Identifier: {$ret->getIdentifier()}\n";
} else {
    echo "Failure...\n";
}
unset($ret);
echo "    Add To Module Identity Path (path5, subModule4) -- \n";
$success = true;
$granchild2 = null;
try {
    echo "        Instantiate subModule4 -> ";
    $grandchild2 = new Loader\Module('path/to/last/module', 'subModule4');
    echo "Success!\n";
    echo "        Add to Path (firstModule/subModule2) -> ";
    Loader\Module::addToModuleIdentityPath($top, 'firstModule/subModule2', $grandchild2, $grandchild2->getIdentifier());
} catch (\Exception $e) {
    $success = false;
}
if ($success) {
    echo "Success!\n\n";
} else {
    echo "Failure...\n\n";
}
$paths = Loader\Module::getModuleIdentityPaths($top);
echo "Identity Paths: \n";
foreach ($paths as $path) {
    echo "    {$path}\n";
}
echo "\n";
Example #2
0
 /**
  * Removes a Module from the internal libraries using a Module path
  * 
  * @param string $modulePath The Module path starting at the base library
  * 
  */
 public function removeModule($modulePath)
 {
     $path = explode('/', $modulePath);
     $moduleName = array_pop($path);
     $path = implode('/', $path);
     $module = Loader\Module::getFromModuleIdentityPath($this->libraries, $path);
     $module->removeModule($moduleName);
 }