Get the page that blocks other pages at a specific timestamp.

Look for a page whose lock was gained before that timestamp, and released after that timestamp.

@param  float $time Time before session lock starts.
@return array|null
350115
public static function get_locked_page_at($time) {
        $recentsessionlocks = self::get_recent_session_locks();
        foreach ($recentsessionlocks as $recentsessionlock) {
            if ($time >= $recentsessionlock['gained'] &&
                $time <= $recentsessionlock['released']) {
                return $recentsessionlock;
            }
        }
    }
1025612
public function getRetryAfter($requestTime)
    {
        if (isset($this->headers['retry-after'])) {
            if (is_numeric($this->headers['retry-after'])) {
                return intval($this->headers['retry-after']);
            } elseif (($time = $this->parseHttpDate($this->headers['retry-after'])) !== false) {
                return max(0, $time - $requestTime);
            }
        }
        // If no valid Retry-after header is found, retry after 15 minutes
        return 900;
    }
1313125
public function setTimeout($time=null)
    {
        if (!is_null($time)) {
           set_time_limit($time)||ini_set("max_execution_time", $time);
        }
        return $this;
    }
1264964
protected function setTime($time) {

        if ($time === null) {
            $time = 0;
        }

        $this->time = new \DateTime('@' . $time);
        return $this;

    }
985668
public function getTime(string $time, string $pattern = "H:i:s")
    {
        if (!$time) {
            $this->data = date($pattern);
        } else {
            $this->prepareTime($time);
        }

        if ($this->erro) {
            return null;

        } else {
            $strtoTime = "";
            if (isset($this->data['h']) && $this->data['h'] > 11) {
                $this->data['h'] -= 12;
                $strtoTime = "+12hours";
            }

            return date($pattern, strtotime(($this->data['h'] ?? 0) . ":" . ($this->data['i'] ?? 0) . ":" . ($this->data['s'] ?? 0) . $strtoTime));
        }
    }
1112827
public function status(DateTime $time = null)
    {
        if ($this->isPendingApproval()) {
            return 'pending approval';
        } elseif ($this->isDraft()) {
            return 'draft';
        } elseif ($this->isPublished($time)) {
            return 'published';
        } elseif ($this->isEmbargoed($time)) {
            return 'embargoed';
        }
    }
676638
public function expires($time)
    {
        if (!empty($time) && is_string($time) && !$timestamp = strtotime($time)) {
            throw new \Ergo\Routing\Exception("Invalid expiry time: $timestamp");
        } else if (is_numeric($time)) {
            $timestamp = $time;
        } else if ($time == false) {
            return $this;
        }

        $this->addHeader('Expires', date('r', $timestamp));

        return $this;
    }
790137
public static function csrfExpirated($time = null)
    {
        if (Session::getInstance()->has('__bow.csrf')) {
            return false;
        }

        if ($time === null) {
            $time = time();
        }

        $csrf = Session::getInstance()->get('__bow.csrf');

        if ($csrf['expirate'] >= (int) $time) {
            return true;
        }

        return false;
    }
1274027
public static function getCurrentDatetime($event)
    {
        $sender = $event->sender;
        /* @var $sender static */
        if ($sender->timeType == static::$timeTypeUtc) {
            return $sender->currentUtcDatetime();
        } elseif ($sender->timeType == static::$timeTypeLocal) {
            return $sender->currentDatetime();
        }
        return null;
    }
44124
private function duration($time){
        if(is_numeric($time)){ 
            return $time;
        }//if
        return (new \DateTime($time))->getTimestamp() - (new \DateTime('now'))->getTimestamp();
    }
937575
public function getTimeFormatBySlug($sSlug)
    {
        $aFormats = $this->getAllTimeFormat();

        foreach ($aFormats as $oFormat) {
            if ($oFormat->slug === $sSlug) {
                return $oFormat;
            }
        }

        return null;
    }
1008218
public static function strtotime($str, $time = null)
    {
        if (is_null($time)) {
            $time = self::time();
        }

        return strtotime($str, $time);
    }
853081
protected function exceededTimeParser($time)
    {
        $tomorrow = Carbon::parse($time)->addMinutes(config('laravel2step.laravel2stepExceededCountdownMinutes'))->format('l, F jS Y h:i:sa');
        $remaining = $time->addMinutes(config('laravel2step.laravel2stepExceededCountdownMinutes'))->diffForHumans(null, true);

        $data = [
            'tomorrow'  => $tomorrow,
            'remaining' => $remaining,
        ];

        return collect($data);
    }
1245708
public function getValue($timestamp = null)
    {
        $values = $this->determine(is_int($timestamp) ? $timestamp : time());
        if (count($values) > 0 &&
            ($rate = max($values)) > 0
        ) {
            return $rate;
        }
        return $this->fallbackValue;
    }
1193933
public static function getMongoDate($time = null) {
        if (is_null($time)) {
            $time = floor(microtime(true) * 1000);
        }
        return new UTCDateTime($time);
    }
1162376
public static function makeTimestamp( $time ) {

		if( is_numeric($time) )
			return (int) $time;

		elseif( $time instanceof \DateTime )
			return $time->getTimestamp();

		$ts = strtotime($time);

		if( $ts === false )
			throw new \LogicException("Unable convert {$time} to a valid timestamp");

		return $ts;

	}
814710
public function getForecast($latitude, $longitude, \DateTime $time = null, array $parameters = null)
    {
        $this->requestedUrl = $this->buildRequestURL($latitude, $longitude, $time, $parameters);

        $this->response = json_decode(file_get_contents($this->requestedUrl), true);
        $this->responseHeaders = $this->parseForecastResponseHeaders($http_response_header);

        return $this->response;
    }