本文整理汇总了PHP中Pimcore\Config::setSystemConfig方法的典型用法代码示例。如果您正苦于以下问题:PHP Config::setSystemConfig方法的具体用法?PHP Config::setSystemConfig怎么用?PHP Config::setSystemConfig使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pimcore\Config
的用法示例。
在下文中一共展示了Config::setSystemConfig方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
public function init()
{
// Disable plugin if the allowed domain is not yet set
$settingDomain = WebsiteSetting::getByName("subdomainAdmin");
if (!is_object($settingDomain) || $settingDomain->getData() == "") {
return;
}
// Create temporary request object - not available yet in front controller
$currentUrl = 'http' . (isset($_SERVER['HTTPS']) ? 's' : '') . '://' . "{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}";
$request = new \Zend_Controller_Request_Http($currentUrl);
// Disable main domain setting to allow admin access on another domain
$conf = Config::getSystemConfig();
$mainDomain = $conf->general->domain;
if (Tool::isRequestToAdminBackend($request) && Tool::isDomainAllowedToAdminBackend($request)) {
$confArr = $conf->toArray();
$mainDomain = $confArr['general']['domain'];
$confArr['general']['domain'] = "";
Config::setSystemConfig(new \Zend_Config($confArr));
}
// Register plugin
\Pimcore::getEventManager()->attach("system.startup", function ($event) use(&$mainDomain) {
$front = \Zend_Controller_Front::getInstance();
$frontControllerPlugin = new FrontControllerPlugin();
$front->registerPlugin($frontControllerPlugin);
// Restore main domain
$conf = Config::getSystemConfig();
$confArr = $conf->toArray();
$confArr['general']['domain'] = $mainDomain;
Config::setSystemConfig(new \Zend_Config($confArr));
});
}