本文整理汇总了PHP中Piwik::isTimezoneSupportEnabled方法的典型用法代码示例。如果您正苦于以下问题:PHP Piwik::isTimezoneSupportEnabled方法的具体用法?PHP Piwik::isTimezoneSupportEnabled怎么用?PHP Piwik::isTimezoneSupportEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Piwik
的用法示例。
在下文中一共展示了Piwik::isTimezoneSupportEnabled方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
function index()
{
$view = Piwik_View::factory('SitesManager');
if (Piwik::isUserIsSuperUser()) {
$sites = Piwik_SitesManager_API::getInstance()->getAllSites();
Piwik_Site::setSites($sites);
$sites = array_values($sites);
} else {
$sites = Piwik_SitesManager_API::getInstance()->getSitesWithAdminAccess();
Piwik_Site::setSitesFromArray($sites);
}
foreach ($sites as &$site) {
$site['alias_urls'] = Piwik_SitesManager_API::getInstance()->getSiteUrlsFromId($site['idsite']);
$site['excluded_ips'] = str_replace(',', '<br/>', $site['excluded_ips']);
$site['excluded_parameters'] = str_replace(',', '<br/>', $site['excluded_parameters']);
}
$view->adminSites = $sites;
$view->adminSitesCount = count($sites);
$timezones = Piwik_SitesManager_API::getInstance()->getTimezonesList();
$view->timezoneSupported = Piwik::isTimezoneSupportEnabled();
$view->timezones = Piwik_Common::json_encode($timezones);
$view->defaultTimezone = Piwik_SitesManager_API::getInstance()->getDefaultTimezone();
$view->currencies = Piwik_Common::json_encode(Piwik_SitesManager_API::getInstance()->getCurrencyList());
$view->defaultCurrency = Piwik_SitesManager_API::getInstance()->getDefaultCurrency();
$view->utcTime = Piwik_Date::now()->getDatetime();
$excludedIpsGlobal = Piwik_SitesManager_API::getInstance()->getExcludedIpsGlobal();
$view->globalExcludedIps = str_replace(',', "\n", $excludedIpsGlobal);
$excludedQueryParametersGlobal = Piwik_SitesManager_API::getInstance()->getExcludedQueryParametersGlobal();
$view->globalExcludedQueryParameters = str_replace(',', "\n", $excludedQueryParametersGlobal);
$view->currentIpAddress = Piwik_IP::getIpFromHeader();
$view->showAddSite = (bool) Piwik_Common::getRequestVar('showaddsite', false);
$this->setBasicVariablesView($view);
$view->menu = Piwik_GetAdminMenu();
echo $view->render();
}
示例2: update
static function update()
{
if(Piwik::isTimezoneSupportEnabled())
{
Piwik_Updater::updateDatabase(__FILE__, self::getSql());
}
}
示例3: index
function index()
{
$view = Piwik_View::factory('SitesManager');
$sites = Piwik_SitesManager_API::getInstance()->getSitesWithAdminAccess();
foreach ($sites as $site) {
$sitesIndexedById[$site['idsite']] = $site;
}
Piwik_Site::setSites($sitesIndexedById);
foreach ($sites as &$site) {
$site['alias_urls'] = Piwik_SitesManager_API::getInstance()->getSiteUrlsFromId($site['idsite']);
$site['excluded_ips'] = str_replace(',', '<br/>', $site['excluded_ips']);
$site['excluded_parameters'] = str_replace(',', '<br/>', $site['excluded_parameters']);
}
$view->adminSites = $sites;
$view->adminSitesCount = count($sites);
$timezones = Piwik_SitesManager_API::getInstance()->getTimezonesList();
$view->timezoneSupported = Piwik::isTimezoneSupportEnabled();
$view->timezones = json_encode($timezones);
$view->defaultTimezone = Piwik_SitesManager_API::getInstance()->getDefaultTimezone();
$view->currencies = json_encode(Piwik_SitesManager_API::getInstance()->getCurrencyList());
$view->defaultCurrency = Piwik_SitesManager_API::getInstance()->getDefaultCurrency();
$view->utcTime = Piwik_Date::now()->getDatetime();
$excludedIpsGlobal = Piwik_SitesManager_API::getInstance()->getExcludedIpsGlobal();
$view->globalExcludedIps = str_replace(',', "\n", $excludedIpsGlobal);
$excludedQueryParametersGlobal = Piwik_SitesManager_API::getInstance()->getExcludedQueryParametersGlobal();
$view->globalExcludedQueryParameters = str_replace(',', "\n", $excludedQueryParametersGlobal);
$view->currentIpAddress = Piwik_Common::getIpString();
$this->setBasicVariablesView($view);
$view->menu = Piwik_GetAdminMenu();
echo $view->render();
}
示例4: testInitTodayToronto
/**
* test of validity of an archive, for today's archive with toronto's timezone
* @group Core
* @group ArchiveProcessing
*/
public function testInitTodayToronto()
{
if (!Piwik::isTimezoneSupportEnabled()) {
$this->markTestSkipped('timezones needs to be supported');
}
$now = time();
$siteTimezone = 'America/Toronto';
$timestamp = Piwik_Date::factory('now', $siteTimezone)->getTimestamp();
$dateLabel = date('Y-m-d', $timestamp);
Piwik_ArchiveProcessing::setBrowserTriggerArchiving(true);
$archiveProcessing = $this->_createArchiveProcessing('day', $dateLabel, $siteTimezone);
$archiveProcessing->time = $now;
// we look at anything processed within the time to live range
$dateMinArchived = $now - Piwik_ArchiveProcessing::getTodayArchiveTimeToLive();
$this->assertEquals($archiveProcessing->getMinTimeArchivedProcessed(), $dateMinArchived);
$this->assertTrue($archiveProcessing->isArchiveTemporary());
// when browsers don't trigger archives, we force ArchiveProcessing
// to fetch any of the most recent archive
Piwik_ArchiveProcessing::setBrowserTriggerArchiving(false);
// see isArchivingDisabled()
// Running in CLI doesn't impact the time to live today's archive we are loading
// From CLI, we will not return data that is 'stale'
if (!Piwik_Common::isPhpCliMode()) {
$dateMinArchived = 0;
}
$this->assertEquals($archiveProcessing->getMinTimeArchivedProcessed(), $dateMinArchived);
// this test varies with DST
$this->assertTrue($archiveProcessing->getStartDatetimeUTC() == date('Y-m-d', $timestamp) . ' 04:00:00' || $archiveProcessing->getStartDatetimeUTC() == date('Y-m-d', $timestamp) . ' 05:00:00');
$this->assertTrue($archiveProcessing->getEndDatetimeUTC() == date('Y-m-d', $timestamp + 86400) . ' 03:59:59' || $archiveProcessing->getEndDatetimeUTC() == date('Y-m-d', $timestamp + 86400) . ' 04:59:59');
$this->assertTrue($archiveProcessing->isArchiveTemporary());
}
示例5: getSystemInformation
//.........这里部分代码省略.........
if(!in_array($desired_extension, $extensions))
{
$infos['missing_desired_extensions'][] = $desired_extension;
}
}
$desired_functions = array(
'set_time_limit',
'mail',
'parse_ini_file',
'glob',
);
$infos['desired_functions'] = $desired_functions;
$infos['missing_desired_functions'] = array();
foreach($desired_functions as $desired_function)
{
if(!self::functionExists($desired_function))
{
$infos['missing_desired_functions'][] = $desired_function;
}
}
$infos['openurl'] = Piwik_Http::getTransportMethod();
$infos['gd_ok'] = false;
if (in_array('gd', $extensions))
{
$gdInfo = gd_info();
$infos['gd_version'] = $gdInfo['GD Version'];
preg_match('/([0-9]{1})/', $gdInfo['GD Version'], $gdVersion);
if($gdVersion[0] >= 2)
{
$infos['gd_ok'] = true;
}
}
$infos['hasMbstring'] = false;
$infos['multibyte_ok'] = true;
if(function_exists('mb_internal_encoding'))
{
$infos['hasMbstring'] = true;
if (((int) ini_get('mbstring.func_overload')) != 0)
{
$infos['multibyte_ok'] = false;
}
}
$serverSoftware = isset($_SERVER['SERVER_SOFTWARE']) ? $_SERVER['SERVER_SOFTWARE'] : '';
$infos['serverVersion'] = addslashes($serverSoftware);
$infos['serverOs'] = @php_uname();
$infos['serverTime'] = date('H:i:s');
$infos['registerGlobals_ok'] = ini_get('register_globals') == 0;
$infos['memoryMinimum'] = $minimumMemoryLimit;
$infos['memory_ok'] = true;
$infos['memoryCurrent'] = '';
$raised = Piwik::raiseMemoryLimitIfNecessary();
if(($memoryValue = Piwik::getMemoryLimitValue()) > 0)
{
$infos['memoryCurrent'] = $memoryValue.'M';
$infos['memory_ok'] = $memoryValue >= $minimumMemoryLimit;
}
$infos['isWindows'] = Piwik_Common::isWindows();
$integrityInfo = Piwik::getFileIntegrityInformation();
$infos['integrity'] = $integrityInfo[0];
$infos['integrityErrorMessages'] = array();
if(isset($integrityInfo[1]))
{
if($infos['integrity'] == false)
{
$infos['integrityErrorMessages'][] = '<b>'.Piwik_Translate('General_FileIntegrityWarningExplanation').'</b>';
}
$infos['integrityErrorMessages'] = array_merge($infos['integrityErrorMessages'], array_slice($integrityInfo, 1));
}
$infos['timezone'] = Piwik::isTimezoneSupportEnabled();
$infos['tracker_status'] = Piwik_Common::getRequestVar('trackerStatus', 0, 'int');
$infos['protocol'] = Piwik_ProxyHeaders::getProtocolInformation();
if(Piwik_Url::getCurrentScheme() == 'http' && $infos['protocol'] !== null)
{
$infos['general_infos']['secure_protocol'] = '1';
}
if(count($headers = Piwik_ProxyHeaders::getProxyClientHeaders()) > 0)
{
$infos['general_infos']['proxy_client_headers'] = $headers;
}
if(count($headers = Piwik_ProxyHeaders::getProxyHostHeaders()) > 0)
{
$infos['general_infos']['proxy_host_headers'] = $headers;
}
return $infos;
}
示例6: getTimezonesList
/**
* Returns the list of timezones supported.
* Used for addSite and updateSite
*
* @TODO NOT COMPATIBLE WITH API RESPONSE AUTO BUILDER
*
* @return array of timezone strings
*/
public function getTimezonesList()
{
if(!Piwik::isTimezoneSupportEnabled())
{
return array('UTC' => $this->getTimezonesListUTCOffsets());
}
$continents = array( 'Africa', 'America', 'Antarctica', 'Arctic', 'Asia', 'Atlantic', 'Australia', 'Europe', 'Indian', 'Pacific');
$timezones = timezone_identifiers_list();
$return = array();
foreach($timezones as $timezone)
{
// filter out timezones not recognized by strtotime()
// @see http://bugs.php.net/46111
$testDate = '2008-09-18 13:00:00 ' . $timezone;
if(!strtotime($testDate))
{
continue;
}
$timezoneExploded = explode('/', $timezone);
$continent = $timezoneExploded[0];
// only display timezones that are grouped by continent
if(!in_array($continent, $continents))
{
continue;
}
$city = $timezoneExploded[1];
if(!empty($timezoneExploded[2]))
{
$city .= ' - '.$timezoneExploded[2];
}
$city = str_replace('_', ' ', $city);
$return[$continent][$timezone] = $city;
}
foreach($continents as $continent)
{
ksort($return[$continent]);
}
$return['UTC'] = $this->getTimezonesListUTCOffsets();
return $return;
}
示例7: testGetDateStartUTCEndDuringDstTimezone
/**
* @group Core
* @group Date
*/
public function testGetDateStartUTCEndDuringDstTimezone()
{
if (Piwik::isTimezoneSupportEnabled()) {
$date = Piwik_Date::factory('2010-03-28');
$date = $date->setTimezone('Europe/Paris');
$utcDayStart = '2010-03-27 23:00:00';
$utcDayEnd = '2010-03-28 21:59:59';
$this->assertEquals($utcDayStart, $date->getDateStartUTC());
$this->assertEquals($utcDayEnd, $date->getDateEndUTC());
}
}