public function publish() { $exportPath = __Paths::get('CACHE') . 'export/'; $mediaPath = $exportPath . 'media/'; $zipPath = __Paths::get('BASE') . 'export/' . 'mobileContents.zip'; org_glizy_helpers_Files::deleteDirectory($exportPath); @unlink($zipPath); @mkdir($exportPath); @mkdir($mediaPath); $exportService = org_glizy_ObjectFactory::createObject('movio.modules.publishApp.service.ExportService'); $exportService->export(); $medias = $exportService->getMedias(); foreach ($medias as $id => $fileName) { $media = org_glizycms_mediaArchive_MediaManager::getMediaById($id); copy($media->getFileName(), $mediaPath . $fileName); } $dbHost = __Config::get('DB_HOST'); $dbUser = __Config::get('DB_USER'); $dbPass = __Config::get('DB_PSW'); $dbName = __Config::get('DB_NAME'); $tableName = __Config::get('movio.modules.publishApp.mobileContentsTable'); $sqliteDb = $exportPath . __Config::get('movio.modules.publishApp.sqliteDbName'); $mysql2SqliteService = org_glizy_ObjectFactory::createObject('movio.modules.publishApp.service.Mysql2SqliteService'); $mysql2SqliteService->convert($dbHost, $dbUser, $dbPass, $dbName, $tableName, $sqliteDb); $this->createZip($exportPath, $zipPath); org_glizy_Registry::set('movio/modules/publishApp/lastUpdate', time()); }
function execute($exportPath, $zipFile) { if ($this->user->isLogged()) { require_once __Paths::get('APPLICATION') . '/libs/dZip.inc.php'; $zip = new dZip($zipFile); $this->addFolderToZip($zip, $exportPath, $exportPath); $zip->save(); org_glizy_Registry::set('movio/modules/publishApp/lastUpdate', strval(time())); } }
public function execute($data) { $data = json_decode($data); $newData = array(); $newData['title'] = $data->title; $newData['address'] = $data->address; $newData['copyright'] = $data->copyright; $newData['slideShow'] = $data->slideShow; $newData['analytics'] = $data->analytics; org_glizy_Registry::set(__Config::get('REGISTRY_SITE_PROP') . $this->application->getEditingLanguage(), serialize($newData)); return true; }
private function setData() { org_glizy_Registry::set(__Config::get('REGISTRY_TEMPLATE_VALUES') . $this->getSelectedTemplate(), json_encode($this->templateValues)); }
public static function setSharingButtonList($shareButtons) { org_glizy_Registry::set(__Config::get('BASE_REGISTRY_PATH') . self::REGISTRY_SHAREBUTTONS, serialize($shareButtons)); }
private function readSiteProperties() { $siteProp = unserialize(org_glizy_Registry::get(__Config::get('REGISTRY_SITE_PROP') . $this->getLanguage(), '')); if (!is_array($siteProp)) { // if the site properties are not defined // try to read the properties from default language $ar = org_glizy_ObjectFactory::createModel('org.glizycms.core.models.Language'); $ar->language_isDefault = 1; $ar->find(); $siteProp = org_glizy_Registry::get(__Config::get('REGISTRY_SITE_PROP') . $ar->language_code, ''); org_glizy_Registry::set(__Config::get('REGISTRY_SITE_PROP') . $this->getLanguage(), $siteProp); $siteProp = unserialize($siteProp); } if (!is_array($siteProp)) { $siteProp = array(); } $this->_siteProperty = $siteProp; }
/** * @param $state */ function setModulesState($state) { org_glizy_Registry::set(__Config::get('BASE_REGISTRY_PATH') . '/modules', serialize($state)); org_glizy_cache_CacheFile::cleanPHP(); }