本文整理汇总了PHP中Pimcore\Config::getReportConfig方法的典型用法代码示例。如果您正苦于以下问题:PHP Config::getReportConfig方法的具体用法?PHP Config::getReportConfig怎么用?PHP Config::getReportConfig使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pimcore\Config
的用法示例。
在下文中一共展示了Config::getReportConfig方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dispatchLoopShutdown
/**
*
*/
public function dispatchLoopShutdown()
{
if (!Tool::isHtmlResponse($this->getResponse())) {
return;
}
$siteKey = \Pimcore\Tool\Frontend::getSiteKey();
$reportConfig = \Pimcore\Config::getReportConfig();
if ($this->enabled && isset($reportConfig->tagmanager->sites->{$siteKey}->containerId)) {
$containerId = $reportConfig->tagmanager->sites->{$siteKey}->containerId;
if ($containerId) {
$code = <<<CODE
<!-- Google Tag Manager -->
<noscript><iframe src="//www.googletagmanager.com/ns.html?id={$containerId}"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','{$containerId}');</script>
<!-- End Google Tag Manager -->
CODE;
$body = $this->getResponse()->getBody();
// insert code after the opening <body> tag
$body = preg_replace("@<body(>|.*?[^?]>)@", "<body\$1\n\n" . $code, $body);
$this->getResponse()->setBody($body);
}
}
}
示例2: getSiteConfig
/**
* @param null $site
* @return bool
*/
public static function getSiteConfig($site = null)
{
$siteKey = \Pimcore\Tool\Frontend::getSiteKey($site);
if (Config::getReportConfig()->webmastertools->sites->{$siteKey}->verification) {
return Config::getReportConfig()->webmastertools->sites->{$siteKey};
}
return false;
}
示例3: getSiteConfig
/**
* @param null $site
* @return bool
*/
public static function getSiteConfig($site = null)
{
$siteKey = \Pimcore\Tool\Frontend::getSiteKey($site);
$config = Config::getReportConfig();
if (!$config->analytics) {
return false;
}
if ($config->analytics->sites->{$siteKey}) {
return Config::getReportConfig()->analytics->sites->{$siteKey};
}
return false;
}
示例4: dispatchLoopShutdown
/**
*
*/
public function dispatchLoopShutdown()
{
if (!Tool::isHtmlResponse($this->getResponse())) {
return;
}
$siteKey = \Pimcore\Tool\Frontend::getSiteKey();
$reportConfig = \Pimcore\Config::getReportConfig();
if ($this->enabled && isset($reportConfig->tagmanager->sites->{$siteKey}->containerId)) {
$containerId = $reportConfig->tagmanager->sites->{$siteKey}->containerId;
if ($containerId) {
$codeHead = <<<CODE
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','{$containerId}');</script>
<!-- End Google Tag Manager -->
CODE;
$codeBody = <<<CODE
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id={$containerId}"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
CODE;
$body = $this->getResponse()->getBody();
// search for the end <head> tag, and insert the google tag manager code before
// this method is much faster than using simple_html_dom and uses less memory
$headEndPosition = stripos($body, "</head>");
if ($headEndPosition !== false) {
$body = substr_replace($body, $codeHead . "</head>", $headEndPosition, 7);
}
// insert code after the opening <body> tag
$body = preg_replace("@<body(>|.*?[^?]>)@", "<body\$1\n\n" . $codeBody, $body);
$this->getResponse()->setBody($body);
}
}
}
示例5: routeStartup
/**
* @param \Zend_Controller_Request_Abstract $request
*/
public function routeStartup(\Zend_Controller_Request_Abstract $request)
{
$conf = \Pimcore\Config::getReportConfig();
if (!is_null($conf->webmastertools) && isset($conf->webmastertools->sites)) {
$sites = $conf->webmastertools->sites->toArray();
if (is_array($sites)) {
foreach ($sites as $site) {
if ($site["verification"]) {
if ($request->getRequestUri() == "/" . $site["verification"]) {
echo "google-site-verification: " . $site["verification"];
exit;
}
}
}
}
}
}
示例6: getConfig
/**
* @return \Zend_Config
*/
public function getConfig()
{
return Config::getReportConfig();
}
示例7: indexAction
public function indexAction()
{
// IE compatibility
//$this->getResponse()->setHeader("X-UA-Compatible", "IE=8; IE=9", true);
// clear open edit locks for this session (in the case of a reload, ...)
\Pimcore\Model\Element\Editlock::clearSession(session_id());
// check maintenance
$maintenance_enabled = false;
$manager = Model\Schedule\Manager\Factory::getManager("maintenance.pid");
$lastExecution = $manager->getLastExecution();
if ($lastExecution) {
if (time() - $lastExecution < 610) {
// maintenance script should run at least every 10 minutes + a little tolerance
$maintenance_enabled = true;
}
}
$this->view->maintenance_enabled = \Zend_Json::encode($maintenance_enabled);
// configuration
$sysConfig = Config::getSystemConfig();
$this->view->config = $sysConfig;
//mail settings
$mailIncomplete = false;
if ($sysConfig->email) {
if (!$sysConfig->email->debug->emailaddresses) {
$mailIncomplete = true;
}
if (!$sysConfig->email->sender->email) {
$mailIncomplete = true;
}
if ($sysConfig->email->method == "smtp" && !$sysConfig->email->smtp->host) {
$mailIncomplete = true;
}
}
$this->view->mail_settings_complete = \Zend_Json::encode(!$mailIncomplete);
// report configuration
$this->view->report_config = Config::getReportConfig();
// customviews config
$cvConfig = Tool::getCustomViewConfig();
$cvData = array();
if ($cvConfig) {
foreach ($cvConfig as $node) {
$tmpData = $node;
$rootNode = Model\Object::getByPath($tmpData["rootfolder"]);
if ($rootNode) {
$tmpData["rootId"] = $rootNode->getId();
$tmpData["allowedClasses"] = explode(",", $tmpData["classes"]);
$tmpData["showroot"] = (bool) $tmpData["showroot"];
$cvData[] = $tmpData;
}
}
}
$this->view->customview_config = $cvData;
// upload limit
$max_upload = filesize2bytes(ini_get("upload_max_filesize") . "B");
$max_post = filesize2bytes(ini_get("post_max_size") . "B");
$upload_mb = min($max_upload, $max_post);
$this->view->upload_max_filesize = $upload_mb;
// csrf token
$user = $this->getUser();
$this->view->csrfToken = Tool\Session::useSession(function ($adminSession) use($user) {
if (!isset($adminSession->csrfToken) && !$adminSession->csrfToken) {
$adminSession->csrfToken = sha1(microtime() . $user->getName() . uniqid());
}
return $adminSession->csrfToken;
});
if (\Pimcore\Tool\Admin::isExtJS6()) {
$this->forward("index6");
}
}
示例8: indexAction
public function indexAction()
{
// clear open edit locks for this session (in the case of a reload, ...)
\Pimcore\Model\Element\Editlock::clearSession(session_id());
// check maintenance
$maintenance_enabled = false;
$manager = Model\Schedule\Manager\Factory::getManager("maintenance.pid");
$lastExecution = $manager->getLastExecution();
if ($lastExecution) {
if (time() - $lastExecution < 610) {
// maintenance script should run at least every 10 minutes + a little tolerance
$maintenance_enabled = true;
}
}
$this->view->maintenance_enabled = \Zend_Json::encode($maintenance_enabled);
// configuration
$sysConfig = Config::getSystemConfig();
$this->view->config = $sysConfig;
//mail settings
$mailIncomplete = false;
if ($sysConfig->email) {
if (!$sysConfig->email->debug->emailaddresses) {
$mailIncomplete = true;
}
if (!$sysConfig->email->sender->email) {
$mailIncomplete = true;
}
if ($sysConfig->email->method == "smtp" && !$sysConfig->email->smtp->host) {
$mailIncomplete = true;
}
}
$this->view->mail_settings_complete = \Zend_Json::encode(!$mailIncomplete);
// report configuration
$this->view->report_config = Config::getReportConfig();
$cvData = [];
// still needed when publishing objects
$cvConfig = Tool::getCustomViewConfig();
if ($cvConfig) {
foreach ($cvConfig as $node) {
$tmpData = $node;
// backwards compatibility
$treeType = $tmpData["treetype"] ? $tmpData["treetype"] : "object";
$rootNode = Model\Element\Service::getElementByPath($treeType, $tmpData["rootfolder"]);
if ($rootNode) {
$tmpData["rootId"] = $rootNode->getId();
$tmpData["allowedClasses"] = $tmpData["classes"] ? explode(",", $tmpData["classes"]) : null;
$tmpData["showroot"] = (bool) $tmpData["showroot"];
// Check if a user has privileges to that node
if ($rootNode->isAllowed("list")) {
$cvData[] = $tmpData;
}
}
}
}
$this->view->customview_config = $cvData;
// upload limit
$max_upload = filesize2bytes(ini_get("upload_max_filesize") . "B");
$max_post = filesize2bytes(ini_get("post_max_size") . "B");
$upload_mb = min($max_upload, $max_post);
$this->view->upload_max_filesize = $upload_mb;
// session lifetime (gc)
$session_gc_maxlifetime = ini_get("session.gc_maxlifetime");
if (empty($session_gc_maxlifetime)) {
$session_gc_maxlifetime = 120;
}
$this->view->session_gc_maxlifetime = $session_gc_maxlifetime;
// csrf token
$user = $this->getUser();
$this->view->csrfToken = Tool\Session::useSession(function ($adminSession) use($user) {
if (!isset($adminSession->csrfToken) && !$adminSession->csrfToken) {
$adminSession->csrfToken = sha1(microtime() . $user->getName() . uniqid());
}
return $adminSession->csrfToken;
});
if (\Pimcore\Tool\Admin::isExtJS6()) {
$this->forward("index6");
}
}