本文整理匯總了PHP中Piwik_Site::getExcludedIps方法的典型用法代碼示例。如果您正苦於以下問題:PHP Piwik_Site::getExcludedIps方法的具體用法?PHP Piwik_Site::getExcludedIps怎麽用?PHP Piwik_Site::getExcludedIps使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Piwik_Site
的用法示例。
在下文中一共展示了Piwik_Site::getExcludedIps方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: array
function test_setDefaultTimezoneAndCurrencyAndExcludedQueryParametersAndExcludedIps()
{
// test that they return default values
$defaultTimezone = Piwik_SitesManager_API::getInstance()->getDefaultTimezone();
$this->assertEqual($defaultTimezone, 'UTC');
$defaultCurrency = Piwik_SitesManager_API::getInstance()->getDefaultCurrency();
$this->assertEqual($defaultCurrency, 'USD');
$excludedIps = Piwik_SitesManager_API::getInstance()->getExcludedIpsGlobal();
$this->assertEqual($excludedIps, '');
$excludedQueryParameters = Piwik_SitesManager_API::getInstance()->getExcludedQueryParametersGlobal();
$this->assertEqual($excludedQueryParameters, '');
// test that when not specified, defaults are set as expected
$idsite = Piwik_SitesManager_API::getInstance()->addSite("site1", array('http://example.org'));
$site = new Piwik_Site($idsite);
$this->assertEqual($site->getTimezone(), 'UTC');
$this->assertEqual($site->getCurrency(), 'USD');
$this->assertEqual($site->getExcludedQueryParameters(), '');
$this->assertEqual($site->getExcludedIps(), '');
$this->assertEqual($site->isEcommerceEnabled(), false);
// set the global timezone and get it
$newDefaultTimezone = 'UTC+5.5';
Piwik_SitesManager_API::getInstance()->setDefaultTimezone($newDefaultTimezone);
$defaultTimezone = Piwik_SitesManager_API::getInstance()->getDefaultTimezone();
$this->assertEqual($defaultTimezone, $newDefaultTimezone);
// set the default currency and get it
$newDefaultCurrency = 'EUR';
Piwik_SitesManager_API::getInstance()->setDefaultCurrency($newDefaultCurrency);
$defaultCurrency = Piwik_SitesManager_API::getInstance()->getDefaultCurrency();
$this->assertEqual($defaultCurrency, $newDefaultCurrency);
// set the global IPs to exclude and get it
$newGlobalExcludedIps = '1.1.1.*,1.1.*.*,150.1.1.1';
Piwik_SitesManager_API::getInstance()->setGlobalExcludedIps($newGlobalExcludedIps);
$globalExcludedIps = Piwik_SitesManager_API::getInstance()->getExcludedIpsGlobal();
$this->assertEqual($globalExcludedIps, $newGlobalExcludedIps);
// set the global URL query params to exclude and get it
$newGlobalExcludedQueryParameters = 'PHPSESSID,blabla, TesT';
// removed the space
$expectedGlobalExcludedQueryParameters = 'PHPSESSID,blabla,TesT';
Piwik_SitesManager_API::getInstance()->setGlobalExcludedQueryParameters($newGlobalExcludedQueryParameters);
$globalExcludedQueryParameters = Piwik_SitesManager_API::getInstance()->getExcludedQueryParametersGlobal();
$this->assertEqual($globalExcludedQueryParameters, $expectedGlobalExcludedQueryParameters);
// create a website and check that default currency and default timezone are set
// however, excluded IPs and excluded query Params are not returned
$idsite = Piwik_SitesManager_API::getInstance()->addSite("site1", array('http://example.org'), $ecommerce = 1, '', '', $newDefaultTimezone);
$site = new Piwik_Site($idsite);
$this->assertEqual($site->getTimezone(), $newDefaultTimezone);
$this->assertEqual($site->getCreationDate()->toString(), date('Y-m-d'));
$this->assertEqual($site->getCurrency(), $newDefaultCurrency);
$this->assertEqual($site->getExcludedIps(), '');
$this->assertEqual($site->getExcludedQueryParameters(), '');
$this->assertEqual($site->isEcommerceEnabled(), true);
}