示例#1
0
try {
    $ret = Loader\Module::pathBelongsTo($path3, $top);
} catch (\Exception $e) {
    $success = false;
}
if ($success) {
    echo "Success! Identifier: {$ret}\n";
} else {
    echo "Failure...\n";
}
echo "    Get From Path (firstModule/subModule2) -> ";
$success = true;
unset($ret);
$ret = null;
try {
    $ret = Loader\Module::getFromModuleIdentityPath($top, 'firstModule/subModule2');
} catch (\Exception $e) {
    $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');
示例#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);
 }