当前位置: 首页>>代码示例>>PHP>>正文


PHP Phprojekt::removeControllersFolders方法代码示例

本文整理汇总了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);
     }
 }
开发者ID:RainyBlueSky,项目名称:PHProjekt,代码行数:58,代码来源:ModuleController.php


注:本文中的Phprojekt::removeControllersFolders方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。