示例#1
0
 public function saveAction()
 {
     try {
         if ($this->getParam("id")) {
             $folder = Document\Folder::getById($this->getParam("id"));
             $folder->setModificationDate(time());
             $folder->setUserModification($this->getUser()->getId());
             if ($folder->isAllowed("publish")) {
                 $this->setValuesToDocument($folder);
                 $folder->save();
                 $this->_helper->json(["success" => true]);
             }
         }
     } catch (\Exception $e) {
         \Logger::log($e);
         if (Pimcore\Tool\Admin::isExtJS6() && $e instanceof Element\ValidationException) {
             $this->_helper->json(["success" => false, "type" => "ValidationException", "message" => $e->getMessage(), "stack" => $e->getTraceAsString(), "code" => $e->getCode()]);
         }
         throw $e;
     }
     $this->_helper->json(false);
 }
示例#2
0
    foreach ($initInfo["steps"] as $step) {
        if (!is_array($step[1])) {
            $step[1] = array();
        }
        verboseMessage("execute: " . $step[0] . " | with the following parameters: " . implode(",", $step[1]));
        $return = call_user_func_array(array($backup, $stepMethodMapping[$step[0]]), $step[1]);
        if ($return["filesize"]) {
            verboseMessage("current filesize of the backup is: " . $return["filesize"]);
        }
    }
}
// maintenance
if ($config["maintenance"] == true) {
    verboseMessage("------------------------------------------------");
    verboseMessage("set maintenance mode off");
    Pimcore\Tool\Admin::deactivateMaintenanceMode();
}
verboseMessage("------------------------------------------------");
verboseMessage("------------------------------------------------");
/*
 * do not remove the string "backup finished"
 * deployment will check for this string to ensure that the backup has been successfully created
 * and no fatal error occurred during backup-creation
 */
verboseMessage("backup finished, you can find your backup here: " . $backupFile);
function verboseMessage($m)
{
    $config = \Zend_Registry::get("config");
    if ($config["verbose"]) {
        echo $m . "\n";
    }