本文整理汇总了PHP中Phprojekt::removeControllersFolders方法的典型用法代码示例。如果您正苦于以下问题:PHP Phprojekt::removeControllersFolders方法的具体用法?PHP Phprojekt::removeControllersFolders怎么用?PHP Phprojekt::removeControllersFolders使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Phprojekt
的用法示例。
在下文中一共展示了Phprojekt::removeControllersFolders方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: jsonDeleteAction
/**
* Deletes a module.
*
* Deletes the module entries, the module itself,
* the databasemanager entry and the table itself.
*
* REQUIRES request parameters:
* <pre>
* - integer <b>id</b> id of the item to delete.
* </pre>
*
* The return is a string in JSON format with:
* <pre>
* - type => 'success'.
* - message => Success message.
* - id => id of the deleted item.
* </pre>
*
* @throws Zend_Controller_Action_Exception On missing or wrong id, or on error in the action delete.
*
* @return void
*/
public function jsonDeleteAction()
{
$id = (int) $this->getRequest()->getParam('id');
if (empty($id)) {
throw new Zend_Controller_Action_Exception(self::ID_REQUIRED_TEXT, 400);
}
$model = $this->getModelObject()->find($id);
if ($model instanceof Phprojekt_ActiveRecord_Abstract) {
if (is_dir(PHPR_CORE_PATH . $model->name)) {
throw new Zend_Controller_Action_Exception(self::CAN_NOT_DELETE_SYSTEM_MODULE, 422);
}
$databaseModel = Phprojekt_Loader::getModel($model->name, $model->name);
if ($databaseModel instanceof Phprojekt_Item_Abstract) {
$databaseManager = new Phprojekt_DatabaseManager($databaseModel);
if (Default_Helpers_Delete::delete($model)) {
$return = $databaseManager->deleteModule();
} else {
$return = false;
}
} else {
$return = Default_Helpers_Delete::delete($model);
}
if ($return === false) {
$message = Phprojekt::getInstance()->translate('The module can not be deleted');
$type = 'error';
} else {
Phprojekt::removeControllersFolders();
$message = Phprojekt::getInstance()->translate('The module was deleted correctly');
$type = 'success';
}
$return = array('type' => $type, 'message' => $message, 'id' => $id);
Phprojekt_Converter_Json::echoConvert($return);
} else {
throw new Zend_Controller_Action_Exception(self::NOT_FOUND, 404);
}
}