本文整理汇总了PHP中Piwik\SettingsServer::isArchivePhpTriggered方法的典型用法代码示例。如果您正苦于以下问题:PHP SettingsServer::isArchivePhpTriggered方法的具体用法?PHP SettingsServer::isArchivePhpTriggered怎么用?PHP SettingsServer::isArchivePhpTriggered使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Piwik\SettingsServer
的用法示例。
在下文中一共展示了SettingsServer::isArchivePhpTriggered方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getSelectQueryString
public function getSelectQueryString(SegmentExpression $segmentExpression, $select, $from, $where, $bind, $groupBy, $orderBy, $limit)
{
$result = parent::getSelectQueryString($segmentExpression, $select, $from, $where, $bind, $groupBy, $orderBy, $limit);
$prefixParts = array();
if (SettingsServer::isArchivePhpTriggered()) {
$prefixParts[] = 'trigger = CronArchive';
}
$idSegments = $this->getSegmentIdOfExpression($segmentExpression);
if (!empty($idSegments)) {
$prefixParts[] = "idSegments = [" . implode(', ', $idSegments) . "]";
}
if (!empty($prefixParts)) {
$result['sql'] = "/* " . implode(', ', $prefixParts) . " */\n" . $result['sql'];
}
return $result;
}
示例2: getPiwikUrl
/**
* Returns the URL to this Piwik instance, eg. **http://demo.piwik.org/** or **http://example.org/piwik/**.
*
* @return string
* @api
*/
public static function getPiwikUrl()
{
$url = Option::get(self::OPTION_PIWIK_URL);
$isPiwikCoreDispatching = defined('PIWIK_ENABLE_DISPATCH') && PIWIK_ENABLE_DISPATCH;
if (Common::isPhpCliMode() || SettingsServer::isArchivePhpTriggered() || !$isPiwikCoreDispatching) {
return $url;
}
$currentUrl = Common::sanitizeInputValue(Url::getCurrentUrlWithoutFileName());
// when script is called from /misc/cron/archive.php, Piwik URL is /index.php
$currentUrl = str_replace("/misc/cron", "", $currentUrl);
if (empty($url) || $currentUrl != $url) {
if (strlen($currentUrl) >= strlen('http://a/')) {
self::overwritePiwikUrl($currentUrl);
}
$url = $currentUrl;
}
if (ProxyHttp::isHttps()) {
$url = str_replace("http://", "https://", $url);
}
return $url;
}
示例3: shouldRethrowException
public static function shouldRethrowException()
{
// If we are in no dispatch mode, eg. a script reusing Piwik libs,
// then we should return the exception directly, rather than trigger the event "bad config file"
// which load the HTML page of the installer with the error.
return defined('PIWIK_ENABLE_DISPATCH') && !PIWIK_ENABLE_DISPATCH || Common::isPhpCliMode() || SettingsServer::isArchivePhpTriggered();
}
示例4: isRequestAuthorizedToArchive
public static function isRequestAuthorizedToArchive()
{
return Rules::isBrowserTriggerEnabled() || SettingsServer::isArchivePhpTriggered();
}
示例5: getPiwikUrl
/**
* Returns the URL to this Piwik instance, eg. **http://demo.piwik.org/** or **http://example.org/piwik/**.
*
* @return string
* @api
*/
public static function getPiwikUrl()
{
// Only set in tests
if (self::$piwikUrlCache !== null) {
return self::$piwikUrlCache;
}
$key = 'piwikUrl';
$url = Option::get($key);
if (Common::isPhpCliMode() || SettingsServer::isArchivePhpTriggered() || defined('PIWIK_MODE_ARCHIVE')) {
return $url;
}
$currentUrl = Common::sanitizeInputValue(Url::getCurrentUrlWithoutFileName());
if (empty($url) || $currentUrl != $url) {
if (strlen($currentUrl) >= strlen('http://a/')) {
Option::set($key, $currentUrl, $autoLoad = true);
}
$url = $currentUrl;
}
return $url;
}
示例6: define
<?php
// Good old test proxy endpoints have some commons
if (!defined('PIWIK_INCLUDE_PATH')) {
define('PIWIK_INCLUDE_PATH', realpath(dirname(__FILE__)) . '/../../../');
}
if (!defined('PIWIK_USER_PATH')) {
define('PIWIK_USER_PATH', PIWIK_INCLUDE_PATH);
}
require_once file_exists(PIWIK_INCLUDE_PATH . '/vendor/autoload.php') ? PIWIK_INCLUDE_PATH . '/vendor/autoload.php' : PIWIK_INCLUDE_PATH . '/../../autoload.php';
// Piwik is installed as a dependency
require_once PIWIK_INCLUDE_PATH . '/core/EventDispatcher.php';
require_once PIWIK_INCLUDE_PATH . '/core/Piwik.php';
require_once PIWIK_INCLUDE_PATH . '/libs/upgradephp/upgrade.php';
require_once PIWIK_INCLUDE_PATH . '/tests/PHPUnit/TestingEnvironment.php';
if (file_exists(PIWIK_INCLUDE_PATH . '/vendor/autoload.php')) {
$vendorDirectory = PIWIK_INCLUDE_PATH . '/vendor';
} else {
$vendorDirectory = PIWIK_INCLUDE_PATH . '/../..';
}
require_once $vendorDirectory . '/autoload.php';
require_once $vendorDirectory . '/mustangostang/spyc/Spyc.php';
require_once $vendorDirectory . '/piwik/device-detector/DeviceDetector.php';
\Piwik\SettingsServer::setMaxExecutionTime(0);
// Make sure Data processed in cron core:archive command is not being purged instantly (useful for: Integration/ArchiveCronTest)
if (\Piwik\SettingsServer::isArchivePhpTriggered()) {
\Piwik\ArchiveProcessor\Rules::disablePurgeOutdatedArchives();
}
示例7: isRequestAuthorizedToArchive
protected static function isRequestAuthorizedToArchive()
{
return !self::$archivingDisabledByTests && (Rules::isBrowserTriggerEnabled() || Common::isPhpCliMode() || Piwik::isUserIsSuperUser() && SettingsServer::isArchivePhpTriggered());
}