public static function getSiteConfig($site = null) { $siteKey = Pimcore_Tool_Frontend::getSiteKey($site); if (Pimcore_Config::getReportConfig()->webmastertools->sites->{$siteKey}->verification) { return Pimcore_Config::getReportConfig()->webmastertools->sites->{$siteKey}; } return false; }
public static function getSiteConfig($site = null) { $siteKey = Pimcore_Tool_Frontend::getSiteKey($site); if (Pimcore_Config::getReportConfig()->analytics->sites->{$siteKey}) { return Pimcore_Config::getReportConfig()->analytics->sites->{$siteKey}; } return false; }
protected function _handleError(Zend_Controller_Request_Abstract $request) { // remove zend error handler $front = Zend_Controller_Front::getInstance(); $front->unregisterPlugin("Zend_Controller_Plugin_ErrorHandler"); $response = $this->getResponse(); if ($response->isException() && !$this->_isInsideErrorHandlerLoop) { // get errorpage try { // enable error handler $front->setParam('noErrorHandler', false); $siteKey = Pimcore_Tool_Frontend::getSiteKey(); $errorPath = Pimcore_Config::getSystemConfig()->documents->error_pages->{$siteKey}; if (empty($errorPath)) { $errorPath = "/"; } $document = Document::getByPath($errorPath); if (!$document instanceof Document_Page) { // default is home $document = Document::getById(1); } if ($document instanceof Document_Page) { $params = Pimcore_Tool::getRoutingDefaults(); if ($module = $document->getModule()) { $params["module"] = $module; } if ($controller = $document->getController()) { $params["controller"] = $controller; $params["action"] = "index"; } if ($action = $document->getAction()) { $params["action"] = $action; } $this->setErrorHandler($params); $request->setParam("document", $document); Zend_Registry::set("pimcore_error_document", $document); } } catch (Exception $e) { Logger::emergency("error page not found"); } } // call default ZF error handler parent::_handleError($request); }
<?php Pimcore_Model_Cache::disable(); // get db connection $db = Pimcore_Resource::get(); $db->query("ALTER TABLE `sites` ADD COLUMN `mainDomain` varchar(255) NULL DEFAULT NULL AFTER `id`;"); $db->query("ALTER TABLE `sites` ADD COLUMN `errorDocument` varchar(255) NULL DEFAULT NULL;"); $db->query("ALTER TABLE `sites` ADD COLUMN `redirectToMainDomain` tinyint(1) NULL DEFAULT NULL;"); $sites = new Site_List(); $sites->load(); foreach ($sites->getSites() as $site) { $domains = $site->getDomains(); $mainDomain = ""; if (is_array($domains)) { $mainDomain = array_shift($domains); } $site->setMainDomain($mainDomain); $site->setDomains($domains); $siteKey = Pimcore_Tool_Frontend::getSiteKey($site); $errorPath = Pimcore_Config::getSystemConfig()->documents->error_pages->{$siteKey}; if ($errorPath) { $site->setErrorDocument($errorPath); } $site->save(); }