示例#1
0
			Symphony::Log()->pushToLog('[CDI] ' . $e->getMessage(), E_ERROR, true);
		}
	}
	
	// CDI Export
	else if(isset($_POST["action"]["cdi_export"])) {
		try {
			if(isset($_POST['ref']) && $_POST['ref'] == "overwrite"){
				Symphony::Configuration()->set('manual-backup-overwrite', 'yes', 'cdi');
			} else {
				Symphony::Configuration()->set('manual-backup-overwrite', 'no', 'cdi');
			}

			CdiDumpDB::backup('manual');
			$result["status"] = 'success';
			$result["result"] = htmlspecialchars(CdiPreferences::appendRestore()->generate());
		} catch(Exception $e) {
			$result["status"] = "error";
			$result["message"] = $e->getMessage();
			Symphony::Log()->pushToLog('[CDI] ' . $e->getMessage(), E_ERROR, true);
		}
	} 

	// CDI Restore
	else if(isset($_POST["action"]["cdi_restore"])) {
		try {
			CdiDumpDB::restore();
			$result["status"] = 'success';
		} catch(Exception $e) {
			$result["status"] = "error";
			$result["message"] = $e->getMessage();
示例#2
0
		public function savePreferences($context){
			if(CdiPreferences::save()) {
				// apply config changes
				if(CdiUtil::isCdiSlave()) { CdiSlave::install(); } 
				else if (CdiUtil::isCdiMaster()) { CdiMaster::install(); }
				else { CdiDBSync::install(); }
			} else {
				Administration::instance()->Page->pageAlert(_('An unknown error occurred while saving preferences for CDI. Your changes have not been saved.'));
				return false;
			}
		}