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


PHP Option::deleteLike方法代码示例

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


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

示例1: clearUserViewDataTableParameters

 public static function clearUserViewDataTableParameters($userLogin)
 {
     Option::deleteLike('viewDataTableParameters_' . $userLogin . '_%');
 }
开发者ID:carriercomm,项目名称:piwik,代码行数:4,代码来源:Manager.php

示例2: deleteSite

 /**
  * Delete user preferences associated with a particular site
  */
 public function deleteSite($idSite)
 {
     Option::deleteLike('%\\_' . API::PREFERENCE_DEFAULT_REPORT, $idSite);
 }
开发者ID:piwik,项目名称:piwik,代码行数:7,代码来源:UsersManager.php

示例3: forgetRememberedArchivedReportsToInvalidateForSite

 public function forgetRememberedArchivedReportsToInvalidateForSite($idSite)
 {
     $id = $this->buildRememberArchivedReportIdForSite($idSite) . '_%';
     Option::deleteLike($id);
 }
开发者ID:bossrabbit,项目名称:piwik,代码行数:5,代码来源:ArchiveInvalidator.php

示例4: 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

示例5: testDeleteLike

 /**
  * @group Core
  */
 public function testDeleteLike()
 {
     // empty table, expect false (i.e., not found)
     $this->assertFalse(Option::get('anonymous_defaultReport'));
     $this->assertFalse(Option::get('admin_defaultReport'));
     $this->assertFalse(Option::get('visitor_defaultReport'));
     // insert guard - to test unescaped underscore
     Option::set('adefaultReport', '0', true);
     $this->assertTrue(Option::get('adefaultReport') === '0');
     // populate table, expect '1'
     Option::set('anonymous_defaultReport', '1', true);
     Option::deleteLike('\\_defaultReport');
     $this->assertSame('1', Option::get('anonymous_defaultReport'));
     $this->assertSame('0', Option::get('adefaultReport'));
     // populate table, expect '2'
     Option::set('admin_defaultReport', '2', false);
     Option::deleteLike('\\_defaultReport');
     $this->assertSame('2', Option::get('admin_defaultReport'));
     $this->assertSame('0', Option::get('adefaultReport'));
     // populate table, expect '3'
     Option::set('visitor_defaultReport', '3', false);
     Option::deleteLike('\\_defaultReport');
     $this->assertSame('3', Option::get('visitor_defaultReport'));
     $this->assertSame('0', Option::get('adefaultReport'));
     // delete with non-matching value, expect '1'
     Option::deleteLike('%\\_defaultReport', '4');
     $this->assertSame('1', Option::get('anonymous_defaultReport'));
     $this->assertSame('0', Option::get('adefaultReport'));
     // delete with matching pattern, expect false
     Option::deleteLike('%\\_defaultReport', '1');
     $this->assertFalse(Option::get('anonymous_defaultReport'));
     $this->assertSame('0', Option::get('adefaultReport'));
     // this shouldn't have been deleted, expect '2' and '3'
     $this->assertSame('2', Option::get('admin_defaultReport'));
     $this->assertSame('3', Option::get('visitor_defaultReport'));
     $this->assertSame('0', Option::get('adefaultReport'));
     // deleted, expect false (except for the guard)
     Option::deleteLike('%\\_defaultReport');
     $this->assertFalse(Option::get('admin_defaultReport'));
     $this->assertFalse(Option::get('visitor_defaultReport'));
     // unescaped backslash (single quotes)
     Option::deleteLike('%\\_defaultReport');
     $this->assertSame('0', Option::get('adefaultReport'));
     // escaped backslash (single quotes)
     Option::deleteLike('%\\_defaultReport');
     $this->assertSame('0', Option::get('adefaultReport'));
     // unescaped backslash (double quotes)
     Option::deleteLike("%\\_defaultReport");
     $this->assertSame('0', Option::get('adefaultReport'));
     // escaped backslash (double quotes)
     Option::deleteLike("%\\_defaultReport");
     $this->assertSame('0', Option::get('adefaultReport'));
 }
开发者ID:carriercomm,项目名称:piwik,代码行数:56,代码来源:OptionTest.php


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