Checks whether or not a view path is expired

@param string $viewPath The view path to check
@return bool True if the path is expired, otherwise false
513251
private function isExpired(string $viewPath) : bool
    {
        $lastModified = DateTime::createFromFormat('U', filemtime($viewPath));

        return $lastModified < new DateTime('-' . $this->lifetime . ' seconds');
    }
1342256
public function has($path)
    {
        $location = $this->applyPathPrefix($path);

        try {
            $this->share->stat($location);
        } catch (NotFoundException $e) {
            return false;
        }

        return true;
    }
660102
public static function isAbsolutePath($path): bool
    {
        return strspn($path, '/\\', 0, 1)
            || (strlen($path) > 3 && ctype_alpha($path[0])
                && ':' === $path[1]
                && strspn($path, '/\\', 2, 1)
            )
            || null !== parse_url($path, PHP_URL_SCHEME);
    }
45749
private function verify(string $path)
  {
    if (!is_dir($this->cacheDirectory))
      mkdir($this->cacheDirectory, 0777, true);

      if (!is_dir($this->cacheDirectory)) {
        return $this->exception(
          'Caching directory "' . $this->cacheDirectory . '" does not exist.'
        );
      }

    if (!is_dir($this->viewsDirectory))
      return $this->exception(
        'Views directory "' . $this->viewsDirectory . '" does not exist.'
      );

    if (!file_exists($path))
      return $this->exception(
        'View file "' . $path . '" does not exist.'
      );
  }
622148
public function view($viewPath)
    {
        if (is_a($viewPath, ViewInterface::class)) {
            $this->view_path = $viewPath;
            return $this;
            // Old string approach - will be deprecated soon
        } elseif (is_string($viewPath)) {
            //elapsed('['.$this->id.'] Setting view context: ['.$viewPath.']');
            // Find full path to view file
            $this->view_path = $this->findView($viewPath);

            // If we have not found view in current module but we have parent module
            if (isset($this->parent) && $this->view_path === false) {
                //elapsed('['.$this->id.'] Cannot set view['.$viewPath.'] - passing it to parent['.$this->parent->id.']');

                /*
                 * Call parent module view setting and return PARENT module to chain
                 * actually switching current module in chain
                 */
                return $this->parent->view($viewPath);
            } else { // Call default module behaviour
                // Call default module behaviour
                parent::view($this->view_path);

                return $this;
            }
        }
    }
669931
public static function isAbsolutePath($path)
    {
        if (isset($path[0]) and ($path[0] == '/' or $path[0] == '\\')) {
            return true;
        }
        if (preg_match('/^[A-Za-z0-9]+:/', $path) === 1) {
            return true;
        }
        return false;
    }
1160466
private function checkTemplatePath($templatePath, $exitOnError = true)
  {
    if (!is_dir($templatePath)) {

      if ($exitOnError === true) {
        exit();
      }

      return false;
    } else {
      return true;
    }
  }
1313725
function is_expired()
    {
        $now = time();

        foreach ($this->subkeys as $subkey)
            if (!$subkey->expires || $subkey->expires > $now)
                return true;

        return false;
    }
1111076
public function isExpired()
    {
        $payload = $this->getPayload();

        if (isset($payload['exp'])) {
            $now = new \DateTime('now');

            if (is_int($payload['exp'])) {
                return ($now->getTimestamp() - $payload['exp']) > 0;
            }

            if (is_numeric($payload['exp'])) {
                return ($now->format('U') - $payload['exp']) > 0;
            }
        }

        return false;
    }
488353
public static function isAbsolute($path)
    {
        if (empty($path)) {
            return false;
        }

        return $path[0] === '/' ||
            preg_match('/^[A-Z]:\\\\/i', $path) ||
            substr($path, 0, 2) === '\\\\' ||
            self::isRegisteredStreamWrapper($path);
    }
734005
protected function isLockExpired(FilePath $lockPath)
    {
        $expired = time() > $this->getLockExpiry($lockPath);
        if ($expired) {
            $this->removeLockFile($lockPath);
        }

        return $expired;
    }
212396
private function isAllowedPath($path) {
    $unallowed_paths = [
      '/user/logout',
      '/ajax',
    ];
    foreach ($unallowed_paths as $unallowed_path) {
      if ($unallowed_path === substr($path, 0, strlen($unallowed_path))) {
        return FALSE;
      }
    }
    return TRUE;
  }
1150756
public static function checkPath($path)
    {
        if (!is_string($path)) {
            throw new InvalidArgumentException(sprintf("String expected as path, got '%s' instead", gettype($path)));
        }
        if (!file_exists($path)) {
            throw new InvalidArgumentException(sprintf("'%s' does not exist", $path));
        }

        if (!is_dir($path)) {
            throw new InvalidArgumentException(sprintf("'%s' is not a directory", $path));
        }

        if (!is_readable($path)) {
            throw new InvalidArgumentException(sprintf("'%s' is not readable", $path));
        }

        return true;
    }
702817
public function expired($onSessionExpires = false)
    {
        if (!$this->_data['expires'] && $onSessionExpires) {
            return true;
        }

        return $this->_data['expires'] < time() && $this->_data['expires'];
    }
915609
protected function isExpired()
    {
        $exp = \DateTime::createFromFormat( 'U', $this->getClaimOrNull( self::EXPIRY ) );
        return !$exp || $exp <= ( new DateTime );
    }
962776
protected function checkFilePath($filePath)
	{
	    $filePath = rtrim($filePath, '/\\');
	    if (!is_dir($filePath)) {
			mkdir($filePath, 0755, true);
		}
        
		if (!is_writable($filePath)) {
			throw new \RuntimeException(sprintf('The base cache path `%s` is not writable.', $filePath));
		}

		return true;
	}
749126
public static function fileExistsSafe(string $filePath) : bool
    {
        if ($filePath == '') {
            return false;
        }

        if (DirHelper::isDirSafe($filePath)) {
            return false;
        }

        return file_exists($filePath);
    }