當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Piwik::serveStaticFile方法代碼示例

本文整理匯總了PHP中Piwik::serveStaticFile方法的典型用法代碼示例。如果您正苦於以下問題:PHP Piwik::serveStaticFile方法的具體用法?PHP Piwik::serveStaticFile怎麽用?PHP Piwik::serveStaticFile使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Piwik的用法示例。


在下文中一共展示了Piwik::serveStaticFile方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getJs

 /**
  * Output the merged JavaScript file.
  * This method is called when the asset manager is enabled.
  * 
  * @see core/AssetManager.php
  */
 public function getJs()
 {
     $jsMergedFile = Piwik_AssetManager::getMergedJsFileLocation();
     Piwik::serveStaticFile($jsMergedFile, "application/javascript; charset=UTF-8");
 }
開發者ID:neolf,項目名稱:PIWIK4MOBILE,代碼行數:11,代碼來源:Controller.php

示例2: define

<?php

/**
 * Piwik - Open source web analytics
 *
 * @link http://piwik.org
 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
 * @version $Id: index.php 4151 2011-03-20 11:51:09Z vipsoft $
 */
/**
 * Tracker proxy
 */
if ($_SERVER['REQUEST_METHOD'] == 'POST' || !empty($_SERVER['QUERY_STRING'])) {
    include '../piwik.php';
    exit;
}
/**
 * piwik.js proxy
 *
 * @see core/Piwik.php
 */
define('PIWIK_INCLUDE_PATH', '..');
define('PIWIK_DOCUMENT_ROOT', '..');
define('PIWIK_USER_PATH', '..');
require_once PIWIK_INCLUDE_PATH . '/libs/upgradephp/upgrade.php';
require_once PIWIK_INCLUDE_PATH . '/core/Piwik.php';
$file = '../piwik.js';
Piwik::serveStaticFile($file, "application/javascript; charset=UTF-8");
exit;
開發者ID:Gninety,項目名稱:Microweber,代碼行數:29,代碼來源:index.php

示例3: getPieHtc

 public function getPieHtc()
 {
     Piwik::serveStaticFile(PIWIK_INCLUDE_PATH . "/libs/CSS3PIE/PIE.htc", "text/x-component");
 }
開發者ID:Gninety,項目名稱:Microweber,代碼行數:4,代碼來源:Controller.php

示例4: define

    define("PIWIK_USER_PATH", PIWIK_PATH_TEST_TO_ROOT);
    require_once PIWIK_PATH_TEST_TO_ROOT . '/core/Piwik.php';
    switch ($staticFileServerMode) {
        // The static file server calls Piwik::serveStaticFile with a null file
        case NULL_FILE_SRV_MODE:
            Piwik::serveStaticFile(null, TEST_FILE_CONTENT_TYPE);
            break;
            // The static file server calls Piwik::serveStaticFile with a non-existing file
        // The static file server calls Piwik::serveStaticFile with a non-existing file
        case GHOST_FILE_SRV_MODE:
            Piwik::serveStaticFile(TEST_FILE_LOCATION . ".ghost", TEST_FILE_CONTENT_TYPE);
            break;
            // The static file server calls Piwik::serveStaticFile with the test file
        // The static file server calls Piwik::serveStaticFile with the test file
        case TEST_FILE_SRV_MODE:
            Piwik::serveStaticFile(TEST_FILE_LOCATION, TEST_FILE_CONTENT_TYPE);
            break;
    }
    // Stops the execution of the whole file
    exit;
}
if (!defined('PIWIK_CONFIG_TEST_INCLUDED')) {
    require_once PIWIK_PATH_TEST_TO_ROOT . "/tests/config_test.php";
}
// If the static file server has not been requested, the standard unit test case class is defined
class Test_Piwik_serveStaticFile extends UnitTestCase
{
    public function tearDown()
    {
        parent::tearDown();
        chmod(TEST_FILE_LOCATION, 0644);
開發者ID:nnnnathann,項目名稱:piwik,代碼行數:31,代碼來源:serveStaticFile.test.php

示例5: define

 * @version $Id: index.php 4642 2011-05-05 21:23:12Z matt $
 */

/**
 * Tracker proxy
 */
if($_SERVER['REQUEST_METHOD'] == 'POST' || !empty($_SERVER['QUERY_STRING'])) {
	include '../piwik.php';
	exit;
}

/**
 * piwik.js proxy
 *
 * @see core/Piwik.php
 */
define('PIWIK_INCLUDE_PATH', '..');
define('PIWIK_DOCUMENT_ROOT', '..');
define('PIWIK_USER_PATH', '..');

require_once PIWIK_INCLUDE_PATH . '/libs/upgradephp/upgrade.php';
require_once PIWIK_INCLUDE_PATH . '/core/Piwik.php';

$file = '../piwik.js';

// There is no cache buster parameter so we don't set Expires: header 
$expireFarFuture = false;
Piwik::serveStaticFile($file, "application/javascript; charset=UTF-8", $expireFarFuture);

exit;
開發者ID:BackupTheBerlios,項目名稱:oos-svn,代碼行數:30,代碼來源:index.php


注:本文中的Piwik::serveStaticFile方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。