当前位置: 首页>>代码示例>>PHP>>正文


PHP Piwik::overrideCacheControlHeaders方法代码示例

本文整理汇总了PHP中Piwik::overrideCacheControlHeaders方法的典型用法代码示例。如果您正苦于以下问题:PHP Piwik::overrideCacheControlHeaders方法的具体用法?PHP Piwik::overrideCacheControlHeaders怎么用?PHP Piwik::overrideCacheControlHeaders使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Piwik的用法示例。


在下文中一共展示了Piwik::overrideCacheControlHeaders方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: sendToBrowserDownload

 public function sendToBrowserDownload($filename)
 {
     $this->epilogue();
     $filename = Piwik_ReportRenderer::appendExtension($filename, "html");
     Piwik::overrideCacheControlHeaders();
     header('Content-Description: File Transfer');
     header('Content-Type: text/html');
     header('Content-Disposition: attachment; filename="' . str_replace('"', '\'', basename($filename)) . '";');
     header('Content-Length: ' . strlen($this->rendering));
     echo $this->rendering;
 }
开发者ID:0h546f6f78696342756e4e59,项目名称:piwik,代码行数:11,代码来源:Html.php

示例2: render

 /**
  * Renders the current view.
  *
  * @return string Generated template
  */
 public function render()
 {
     try {
         $this->currentModule = Piwik::getModule();
         $this->currentAction = Piwik::getAction();
         $userLogin = Piwik::getCurrentUserLogin();
         $this->userLogin = $userLogin;
         // workaround for #1331
         $count = method_exists('Piwik', 'getWebsitesCountToDisplay') ? Piwik::getWebsitesCountToDisplay() : 1;
         $sites = Piwik_SitesManager_API::getInstance()->getSitesWithAtLeastViewAccess($count);
         usort($sites, create_function('$site1, $site2', 'return strcasecmp($site1["name"], $site2["name"]);'));
         $this->sites = $sites;
         $this->url = Piwik_Common::sanitizeInputValue(Piwik_Url::getCurrentUrl());
         $this->token_auth = Piwik::getCurrentUserTokenAuth();
         $this->userHasSomeAdminAccess = Piwik::isUserHasSomeAdminAccess();
         $this->userIsSuperUser = Piwik::isUserIsSuperUser();
         $this->latest_version_available = Piwik_UpdateCheck::isNewestVersionAvailable();
         $this->disableLink = Piwik_Common::getRequestVar('disableLink', 0, 'int');
         $this->isWidget = Piwik_Common::getRequestVar('widget', 0, 'int');
         if (Zend_Registry::get('config')->General->autocomplete_min_sites <= count($sites)) {
             $this->show_autocompleter = true;
         } else {
             $this->show_autocompleter = false;
         }
         // workaround for #1331
         $this->loginModule = method_exists('Piwik', 'getLoginPluginName') ? Piwik::getLoginPluginName() : 'Login';
         $user = Piwik_UsersManager_API::getInstance()->getUser($userLogin);
         $this->userAlias = $user['alias'];
     } catch (Exception $e) {
         // can fail, for example at installation (no plugin loaded yet)
     }
     $this->totalTimeGeneration = Zend_Registry::get('timer')->getTime();
     try {
         $this->totalNumberOfQueries = Piwik::getQueryCount();
     } catch (Exception $e) {
         $this->totalNumberOfQueries = 0;
     }
     // workaround for #1331
     if (method_exists('Piwik', 'overrideCacheControlHeaders')) {
         Piwik::overrideCacheControlHeaders('no-store');
     }
     @header('Content-Type: ' . $this->contentType);
     if ($this->xFrameOptions) {
         @header('X-Frame-Options: ' . $this->xFrameOptions);
     }
     return $this->smarty->fetch($this->template);
 }
开发者ID:neolf,项目名称:PIWIK4MOBILE,代码行数:52,代码来源:View.php

示例3: render

	public function render()
	{
		Piwik::overrideCacheControlHeaders();
		
		$data = array(
			'params' => array(
				'axes' => &$this->axes,
				'series' => &$this->series,
				'seriesColors' => &$this->seriesColors
			),
			'data' => &$this->data,
			'tooltip' => $this->tooltip
		);
		
		return json_encode($data);
	}
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:16,代码来源:Chart.php

示例4: render

 /**
  * Renders the current view.
  *
  * @return string Generated template
  */
 public function render()
 {
     try {
         $this->currentModule = Piwik::getModule();
         $this->currentAction = Piwik::getAction();
         $userLogin = Piwik::getCurrentUserLogin();
         $this->userLogin = $userLogin;
         $count = Piwik::getWebsitesCountToDisplay();
         $sites = Piwik_SitesManager_API::getInstance()->getSitesWithAtLeastViewAccess($count);
         usort($sites, create_function('$site1, $site2', 'return strcasecmp($site1["name"], $site2["name"]);'));
         $this->sites = $sites;
         $this->url = Piwik_Common::sanitizeInputValue(Piwik_Url::getCurrentUrl());
         $this->token_auth = Piwik::getCurrentUserTokenAuth();
         $this->userHasSomeAdminAccess = Piwik::isUserHasSomeAdminAccess();
         $this->userIsSuperUser = Piwik::isUserIsSuperUser();
         $this->latest_version_available = Piwik_UpdateCheck::isNewestVersionAvailable();
         $this->disableLink = Piwik_Common::getRequestVar('disableLink', 0, 'int');
         $this->isWidget = Piwik_Common::getRequestVar('widget', 0, 'int');
         if (Piwik_Config::getInstance()->General['autocomplete_min_sites'] <= count($sites)) {
             $this->show_autocompleter = true;
         } else {
             $this->show_autocompleter = false;
         }
         $this->loginModule = Piwik::getLoginPluginName();
         $user = Piwik_UsersManager_API::getInstance()->getUser($userLogin);
         $this->userAlias = $user['alias'];
     } catch (Exception $e) {
         // can fail, for example at installation (no plugin loaded yet)
     }
     $this->totalTimeGeneration = Zend_Registry::get('timer')->getTime();
     try {
         $this->totalNumberOfQueries = Piwik::getQueryCount();
     } catch (Exception $e) {
         $this->totalNumberOfQueries = 0;
     }
     Piwik::overrideCacheControlHeaders('no-store');
     @header('Content-Type: ' . $this->contentType);
     // always sending this header, sometimes empty, to ensure that Dashboard embed loads (which could call this header() multiple times, the last one will prevail)
     @header('X-Frame-Options: ' . (string) $this->xFrameOptions);
     return $this->smarty->fetch($this->template);
 }
开发者ID:0h546f6f78696342756e4e59,项目名称:piwik,代码行数:46,代码来源:View.php

示例5: renderHeader

 protected function renderHeader()
 {
     @header('Content-Type: application/json; charset=utf-8');
     Piwik::overrideCacheControlHeaders();
 }
开发者ID:0h546f6f78696342756e4e59,项目名称:piwik,代码行数:5,代码来源:Json.php

示例6: renderHeader

	protected static function renderHeader()
	{
		// silent fail otherwise unit tests fail
		@header('Content-Type: application/vnd.ms-excel');
		@header('Content-Disposition: attachment; filename=piwik-report-export.csv');
		Piwik::overrideCacheControlHeaders();
	}
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:7,代码来源:Csv.php

示例7: sendToBrowser

 protected static function sendToBrowser($filename, $extension, $contentType, $content)
 {
     $filename = Piwik_ReportRenderer::appendExtension($filename, $extension);
     Piwik::overrideCacheControlHeaders();
     header('Content-Description: File Transfer');
     header('Content-Type: ' . $contentType);
     header('Content-Disposition: attachment; filename="' . str_replace('"', '\'', basename($filename)) . '";');
     header('Content-Length: ' . strlen($content));
     echo $content;
 }
开发者ID:nnnnathann,项目名称:piwik,代码行数:10,代码来源:ReportRenderer.php

示例8: renderHeader

 /**
  * Sends the http headers for csv file
  */
 protected function renderHeader()
 {
     $fileName = 'Piwik ' . Piwik_Translate('General_Export');
     $period = Piwik_Common::getRequestVar('period', false);
     $date = Piwik_Common::getRequestVar('date', false);
     if ($period || $date) {
         if ($period == 'range') {
             $period = new Piwik_Period_Range($period, $date);
         } else {
             if (strpos($date, ',') !== false) {
                 $period = new Piwik_Period_Range('range', $date);
             } else {
                 $period = Piwik_Period::factory($period, Piwik_Date::factory($date));
             }
         }
         $prettyDate = $period->getLocalizedLongString();
         $meta = $this->getApiMetaData();
         $fileName .= ' _ ' . $meta['name'] . ' _ ' . $prettyDate . '.csv';
     }
     // silent fail otherwise unit tests fail
     @header('Content-Type: application/vnd.ms-excel');
     @header('Content-Disposition: attachment; filename="' . $fileName . '"');
     Piwik::overrideCacheControlHeaders();
 }
开发者ID:nnnnathann,项目名称:piwik,代码行数:27,代码来源:Csv.php

示例9: render

 public function render()
 {
     Piwik::overrideCacheControlHeaders();
     return $this->chart->toPrettyString();
 }
开发者ID:Gninety,项目名称:Microweber,代码行数:5,代码来源:Chart.php

示例10: render

 public function render()
 {
     Piwik::overrideCacheControlHeaders();
     // See http://www.jqplot.com/docs/files/jqPlotOptions-txt.html
     $data = array('params' => array('axes' => &$this->axes, 'series' => &$this->series, 'seriesColors' => &$this->seriesColors), 'data' => &$this->data, 'tooltip' => &$this->tooltip, 'seriesPicker' => &$this->seriesPicker);
     Piwik_PostEvent('Visualization_Chart.render', $data);
     return Piwik_Common::json_encode($data);
 }
开发者ID:josl,项目名称:CGE-File-Sharing,代码行数:8,代码来源:Chart.php


注:本文中的Piwik::overrideCacheControlHeaders方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。