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


PHP Option::clearCache方法代码示例

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


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

示例1: testGetOption

 /**
  * @group Core
  */
 public function testGetOption()
 {
     // empty table, expect false (i.e., not found)
     $this->assertFalse(Option::get('anonymous_defaultReport'));
     // populate table, expect '1' (i.e., found)
     Db::query("INSERT INTO `" . Common::prefixTable('option') . "` VALUES ('anonymous_defaultReport', '1',true)");
     $this->assertSame('1', Option::get('anonymous_defaultReport'));
     // delete row (bypassing API), expect '1' (i.e., from cache)
     Db::query("DELETE FROM `" . Common::prefixTable('option') . "` WHERE option_name = ?", array('anonymous_defaultReport'));
     $this->assertSame('1', Option::get('anonymous_defaultReport'));
     // force cache reload, expect false (i.e., not found)
     Option::clearCache();
     $this->assertFalse(Option::get('anonymous_defaultReport'));
 }
开发者ID:carriercomm,项目名称:piwik,代码行数:17,代码来源:OptionTest.php

示例2: realpath

<?php

/**
 *  Proxy to normal piwik.php, but in testing mode
 *
 *  - Use the tests database to record Tracking data
 *  - Allows to overwrite the Visitor IP, and Server datetime
 *
 */
use Piwik\DataTable\Manager;
use Piwik\Option;
use Piwik\Plugins\UserCountry\LocationProvider\GeoIp;
use Piwik\Site;
use Piwik\Tracker\Cache;
use Piwik\Tracker;
require realpath(dirname(__FILE__)) . "/includes.php";
// Wrapping the request inside ob_start() calls to ensure that the Test
// calling us waits for the full request to process before unblocking
ob_start();
try {
    Piwik_TestingEnvironment::addHooks();
    GeoIp::$geoIPDatabaseDir = 'tests/lib/geoip-files';
    Tracker::setTestEnvironment();
    Manager::getInstance()->deleteAll();
    Option::clearCache();
    Site::clearCache();
    include PIWIK_INCLUDE_PATH . '/piwik.php';
} catch (Exception $ex) {
    echo "Unexpected error during tracking: " . $ex->getMessage() . "\n" . $ex->getTraceAsString() . "\n";
}
ob_end_flush();
开发者ID:a4tunado,项目名称:piwik,代码行数:31,代码来源:piwik.php

示例3: updateDatabase

 public static function updateDatabase($force = false)
 {
     Cache::deleteTrackerCache();
     Option::clearCache();
     if ($force) {
         // remove version options to force update
         Option::deleteLike('version%');
         Option::set('version_core', '0.0');
     }
     $updater = new Updater();
     $componentsWithUpdateFile = CoreUpdater::getComponentUpdates($updater);
     if (empty($componentsWithUpdateFile)) {
         return false;
     }
     $result = CoreUpdater::updateComponents($updater, $componentsWithUpdateFile);
     if (!empty($result['coreError']) || !empty($result['warnings']) || !empty($result['errors'])) {
         throw new \Exception("Failed to update database (errors or warnings found): " . print_r($result, true));
     }
     return $result;
 }
开发者ID:igorclark,项目名称:piwik,代码行数:20,代码来源:Fixture.php

示例4: tearDown

 public function tearDown()
 {
     parent::tearDown();
     Manager::getInstance()->deleteAll();
     Option::clearCache();
     Site::clearCache();
     Cache::deleteTrackerCache();
     ArchiveTableCreator::clear();
     $tempTableName = Common::prefixTable(LogDataPurger::TEMP_TABLE_NAME);
     Db::query("DROP TABLE IF EXISTS " . $tempTableName);
 }
开发者ID:carriercomm,项目名称:piwik,代码行数:11,代码来源:PrivacyManagerTest.php

示例5: resetDatabase

 private function resetDatabase()
 {
     Option::clearCache();
     Db::destroyDatabaseObject();
 }
开发者ID:FluentDevelopment,项目名称:piwik,代码行数:5,代码来源:RequestCommand.php

示例6: performTearDown

 public function performTearDown()
 {
     // Note: avoid run SQL in the *tearDown() metohds because it randomly fails on Travis CI
     // with error Error while sending QUERY packet. PID=XX
     $this->tearDown();
     self::unloadAllPlugins();
     if ($this->dropDatabaseInTearDown) {
         $this->dropDatabase();
     }
     DataTableManager::getInstance()->deleteAll();
     Option::clearCache();
     Site::clearCache();
     Cache::deleteTrackerCache();
     Config::getInstance()->clear();
     ArchiveTableCreator::clear();
     \Piwik\Plugins\ScheduledReports\API::$cache = array();
     \Piwik\Registry::unsetInstance();
     \Piwik\EventDispatcher::getInstance()->clearAllObservers();
     $_GET = $_REQUEST = array();
     Translate::unloadEnglishTranslation();
 }
开发者ID:carriercomm,项目名称:piwik,代码行数:21,代码来源:Fixture.php


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