Example #1
0
 protected function _renameObject($oldName, $newName)
 {
     $newFileName = $this->_configMain->get('object_configs') . $newName . '.php';
     //$oldFileName = $this->_configMain->get('object_configs').$oldName.'.php';
     if (file_exists($newFileName)) {
         Response::jsonError($this->_lang->FILL_FORM, array(array('id' => 'name', 'msg' => $this->_lang->SB_UNIQUE)));
     }
     $manager = new Backend_Orm_Manager();
     $renameResult = $manager->renameObject($this->_configMain['object_configs'], $oldName, $newName);
     switch ($renameResult) {
         case 0:
             break;
         case Backend_Orm_Manager::ERROR_FS:
             Response::jsonError($this->_lang->CANT_WRITE_FS);
             break;
         case Backend_Orm_Manager::ERROR_FS_LOCALISATION:
             Response::jsonError($this->_lang->CANT_WRITE_FS . ' (' . $this->_lang->LOCALIZATION_FILE . ')');
             break;
         default:
             Response::jsonError($this->_lang->CANT_EXEC . ' code 5');
     }
     /*
      * Clear cache
      */
     Config::resetCache();
 }
Example #2
0
 /**
  * Reset modules cache
  */
 public function resetCache()
 {
     self::$_classRoutes = false;
     Config::resetCache();
 }