Fetches the archive day from the url.

@return null|int
198281
public function getArchiveDay()
    {
        $day = $this->request->param('Day');

        if (preg_match('/^[0-9]{1,2}$/', $day)) {
            if (checkdate($this->getArchiveMonth(), $day, $this->getArchiveYear())) {
                return (int) $day;
            }
        }

        return null;
    }
459426
public function aggregateDayReport()
    {
        $rankingQueryLimit = ArchivingHelper::getRankingQueryLimit();
        ArchivingHelper::reloadConfig();

        $this->initActionsTables();

        $this->archiveDayPageActions($rankingQueryLimit);
        $this->archiveDaySiteSearchActions($rankingQueryLimit);
        $this->archiveDayEntryActions($rankingQueryLimit);
        $this->archiveDayExitActions($rankingQueryLimit);
        $this->archiveDayActionsTime($rankingQueryLimit);

        $this->insertDayReports();

        return true;
    }
395288
public function getDate()
    {
        global $wpdb;
        return $wpdb->get_var($wpdb->prepare('SELECT post_date FROM ' . $wpdb->prefix . 'posts WHERE ID = %d',
            $this->ID));
    }
486018
public static function getArchiveSlug()
    {
        global $wp_query;

        if ($wp_query && !is_tax() && (is_post_type_archive() || is_archive() || is_home() || is_search() || is_404())) {
            $postType = get_post_type();

            if (isset($wp_query->query_vars['post_type']) && !empty($wp_query->query_vars['post_type'])) {
                $postType = $wp_query->query_vars['post_type'];
            }

            if (is_home()) {
                $archiveSlug = 'archive-post';
            } elseif (is_post_type_archive() && is_search()) {
                $archiveSlug = 'archive-' . get_post_type_object($postType)->name;
            } elseif (is_search()) {
                $archiveSlug = 'search';
            } elseif (is_404()) {
                $archiveSlug = 'e404';
            } elseif (is_author()) {
                $archiveSlug = 'author';
            } else {
                $archiveSlug = 'archive-' . get_post_type_object($postType)->name;
            }

            return $archiveSlug;
        }

        return false;
    }
1295131
public function getDate() : ?string 
    {
        if ( ! $this->hasDate()) {
            $this->setDate($this->getDefaultDate());
        }
        return $this->date;
    }
1023001
public function get()
    {
        // Pre-populating the 'calendardata' is optional, if we don't have it
        // already we fetch it from the backend.
        if (!isset($this->objectData['calendardata'])) {
            $this->objectData = $this->caldavBackend->getCalendarObject($this->calendarInfo['id'], $this->objectData['uri']);
        }

        return $this->objectData['calendardata'];
    }
172105
public function getReleaseDate() : ?string
    {
        if (null === $this->releaseDate) {
            $success = null;

            try {
                $releaseDate = $this->getItem('browscap.releaseDate', false, $success);
            } catch (InvalidArgumentException $e) {
                $this->logger->error(new \InvalidArgumentException('an error occured while reading the data release date from the cache', 0, $e));
                $releaseDate = null;
            }

            if (null !== $releaseDate && $success) {
                $this->releaseDate = $releaseDate;
            }
        }

        return $this->releaseDate;
    }
510036
public function viewArchive($request)
    {
        $year = $request->param('Year');
        $month = $request->param('Month');


        $this->blogPosts = $this->getArchives();

        if (!$this->blogPosts->count()) {
            return $this->httpError(404);
        }

        $title = $year;
        if ($month) {
            $title = $month . '/' . $year;
        }

        $orig_title = $this->dataRecord->Title;

        $this->Title = 'Archived posts for "' . $title . '" | ' . $orig_title;

        $this->ArchivePeriod = $title;

        return $this->render();
    }
708077
public function getExpires() {
        if (!isset($this->metadata[OSSHeaders::EXPIRES])) {
            return null;
        }
        return DateUtils::parseDate($this->metadata[OSSHeaders::EXPIRES]);
    }
1147935
protected function parseTar()
	{
		$tarLength = strlen( $this->content );																// Read Files from archive
		$mainOffset = 0;
		while( $mainOffset < $tarLength )
		{
			if(substr($this->content,$mainOffset,512) == str_repeat(chr(0),512))							// If we read a block of 512 nulls, we are at the end of the archive
				break;
			$fileName		= $this->parseNullPaddedString(substr($this->content,$mainOffset,100));			// Parse file name
			$fileMode		= substr($this->content,$mainOffset + 100,8);									// Parse the file mode
			$fileUid		= octdec(substr($this->content,$mainOffset + 108,8));							// Parse the file user ID
			$fileGid		= octdec(substr($this->content,$mainOffset + 116,8));							// Parse the file group ID
			$fileSize		= octdec(substr($this->content,$mainOffset + 124,12));							// Parse the file size
			$fileTime		= octdec(substr($this->content,$mainOffset + 136,12));							// Parse the file update time - unix timestamp format
			$fileChksum	= octdec(substr($this->content,$mainOffset + 148,6));								// Parse Checksum
			$fileUname		= $this->parseNullPaddedString(substr($this->content,$mainOffset + 265,32));	// Parse user name
			$fileGname		= $this->parseNullPaddedString(substr($this->content,$mainOffset + 297,32));	// Parse Group name
			if($this->computeUnsignedChecksum(substr($this->content,$mainOffset,512)) != $fileChksum)		// Make sure our file is valid
				return false;
			$filecontents		= substr($this->content,$mainOffset + 512,$fileSize);						// Parse File Contents
			if( $fileSize > 0 )
			{
				if(!$this->containsFile( $fileName ) )
				{
					$this->numFiles++;																		// Increment number of files
					$activeFile = &$this->files[];															// Create us a new file in our array
					$activeFile['name']			= $fileName;												// Asign Values
					$activeFile['mode']			= $fileMode;
					$activeFile['size']			= $fileSize;
					$activeFile['time']			= $fileTime;
					$activeFile['user_id']		= $fileUid;
					$activeFile['group_id']		= $fileGid;
					$activeFile['user_name']	= $fileUname;
					$activeFile['group_name']	= $fileGname;
					$activeFile['checksum']		= $fileChksum;
					$activeFile['file']			= $filecontents;
				}
			}
			else
			{
				if( !$this->containsFolder( $fileName ) )
				{
					$this->numFolders++;																	// Increment number of directories
					$activeDir = &$this->folders[];															// Create a new folder in our array
					$activeDir['name']			= $fileName;												// Assign values
					$activeDir['mode']			= $fileMode;
					$activeDir['time']			= $fileTime;
					$activeDir['user_id']		= $fileUid;
					$activeDir['group_id']		= $fileGid;
					$activeDir['user_name']		= $fileUname;
					$activeDir['group_name']	= $fileGname;
					$activeDir['checksum']		= $fileChksum;
				}
			}
			$mainOffset += 512 + ( ceil( $fileSize / 512 ) * 512 );												// Move our offset the number of blocks we have processed
		}
		return true;
	}
7348
public function getMonthlyArchiveLink($type = 'day')
    {
        /** @var DBDatetime $date */
        $date = $this->dbObject('PublishDate');

        if ($type !== 'year') {
            if ($type === 'day') {
                return Controller::join_links(
                    $this->Parent()->Link('archive'),
                    $date->format('Y'),
                    $date->format('M'),
                    $date->format('d')
                );
            }

            return Controller::join_links($this->Parent()->Link('archive'), $date->format('Y'), $date->format('M'));
        }

        return Controller::join_links($this->Parent()->Link('archive'), $date->format('Y'));
    }
892912
public function getArchives()
    {
        $all_posts = $this->getBlogPosts();
        $years = [];
        $months = [];

        foreach ($all_posts as $post) {
            if (preg_match('/^(\d\d\d\d)-(\d\d)-/', $post->PublishDate, $match)) {
                if (empty($years[$match[1]])) {
                    $years[$match[1]] = 1;
                } else {
                    $years[$match[1]]++;
                }
                if (empty($months[$match[1] . '-' . $match[2]])) {
                    $months[$match[1] . '-' . $match[2]] = 1;
                } else {
                    $months[$match[1] . '-' . $match[2]]++;
                }
            }
        }
        $output = ArrayData::create([
            'Years' => ArrayList::create(),
            'Months' => ArrayList::create(),
        ]);
        $link_base = $this->Link() . 'archive/';

        foreach ($years as $year => $count) {
            $yr = DBYear::create();
            $yr->setValue($year);
            $cnt = DBInt::create();
            $cnt->setValue($count);
            $result = ArrayData::create([
                'Year' => $yr,
                'Count' => $cnt,
                'Link' => $link_base . $year . '/'
            ]);
            $output->Years->push($result);
        }

        foreach ($months as $month => $count) {
            $mth = DBDate::create();
            $mth->setValue($month . '-01');
            $cnt = DBInt::create();
            $cnt->setValue($count);
            $result = ArrayData::create([
                'Month' => $mth,
                'Count' => $cnt,
                'Link' => $link_base . str_replace('-', '/', $month) . '/'
            ]);
            $output->Months->push($result);
        }

        return $output;
    }
168685
public function fetch()
    {
        $this->query->where(implode(' AND ', $this->where));
        $record = DB::fetch($this->query);

        if (!$record)
        {
            return null;
        }

        $banner = Banners_Factory::createFromArray($record);
        return $banner;
    }
195185
public function getArchiveDate()
    {
        $year = $this->getArchiveYear();
        $month = $this->getArchiveMonth();
        $day = $this->getArchiveDay();

        if ($year) {
            if ($month) {
                $date = sprintf('%s-%s-01', $year, $month);

                if ($day) {
                    $date = sprintf('%s-%s-%s', $year, $month, $day);
                }
            } else {
                $date = sprintf('%s-01-01', $year);
            }

            $obj = DBDatetime::create('date');
            $obj->setValue($date);
            return $obj;
        }

        return null;
    }
640298
public function getDeathDate(): Date
    {
        foreach ($this->getAllDeathDates() as $date) {
            if ($date->isOK()) {
                return $date;
            }
        }

        return new Date('');
    }
508770
public function CurrentCalendar()
    {
        $url = Convert::raw2url($this->request->param('ID'));

        $cal = PublicCalendar::get()
            ->filter('URLSegment', $url)
            ->First();
        return $cal;
    }
590779
private function getDelayBetweenPeriodsArchives()
    {
        if (empty($this->forceTimeoutPeriod)) {
            return self::SECONDS_DELAY_BETWEEN_PERIOD_ARCHIVES;
        }

        // Ensure the cache for periods is at least as high as cache for today
        if ($this->forceTimeoutPeriod > $this->todayArchiveTimeToLive) {
            return $this->forceTimeoutPeriod;
        }

        $this->logger->info("WARNING: Automatically increasing --force-timeout-for-periods from {$this->forceTimeoutPeriod} to "
            . $this->todayArchiveTimeToLive
            . " to match the cache timeout for Today's report specified in Matomo UI > Settings > General Settings");

        return $this->todayArchiveTimeToLive;
    }