本文整理汇总了PHP中ModuleLoader::unLoadModule方法的典型用法代码示例。如果您正苦于以下问题:PHP ModuleLoader::unLoadModule方法的具体用法?PHP ModuleLoader::unLoadModule怎么用?PHP ModuleLoader::unLoadModule使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ModuleLoader
的用法示例。
在下文中一共展示了ModuleLoader::unLoadModule方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ModuleLoader
<?php
/*
* cron job controller script
* it reads the cronjob table and runs command based on the command settings
*/
if ($argc < 2) {
echo "usage: php load_module.php module_name\n";
exit;
}
include_once "../app.inc";
if (!defined("CLI")) {
exit;
}
include_once MODULE_PATH . "/system/lib/ModuleLoader.php";
$moduleName = $argv[1];
$loader = new ModuleLoader($moduleName);
echo "Start unloading {$moduleName} module ...\n";
$loader->unLoadModule();
//echo $loader->logs . "\n";
echo "End unloading {$moduleName} module\n";
示例2: DeleteRecord
public function DeleteRecord($id = null, $deleteFiles = false)
{
//delete menu items
if ($this->resource != "" && !$this->allowAccess($this->resource . ".delete")) {
return Openbiz::$app->getClientProxy()->redirectView(OPENBIZ_ACCESS_DENIED_VIEW);
}
if ($id == null || $id == '') {
$id = Openbiz::$app->getClientProxy()->getFormInputs('_selectedId');
}
$selIds = Openbiz::$app->getClientProxy()->getFormInputs('row_selections', false);
if ($selIds == null) {
$selIds[] = $id;
}
foreach ($selIds as $id) {
$dataRec = $this->getDataObj()->fetchById($id);
//echo var_dump($dataRec);
// take care of exception
try {
//also delete menu items
Openbiz::getObject("menu.do.MenuDO", 1)->deleteRecords("[module]='" . $dataRec->objectName . "'");
$dataRec->delete();
//unload module
$mod = new ModuleLoader($dataRec['name']);
$mod->unLoadModule();
if ($deleteFiles) {
$modPath = Openbiz::$app->getModulePath() . DIRECTORY_SEPARATOR . $dataRec['name'];
$this->rrmdir($modPath);
}
} catch (Openbiz\data\Exception $e) {
// call $this->processDataException($e);
$this->processDataException($e);
return;
}
}
if (strtoupper($this->formType) == "LIST") {
$this->rerender();
}
$this->runEventLog();
$this->processPostAction();
}