Most *nix systems have a 255-byte filename limit.
Creating a static cache file for a request uri over this limit will throw an exception.

@return bool
543180
protected function _requestUriTooLong() {
        $reqUri = basename($this->getRequest()->getRequestUri());
        return strlen($reqUri) > self::MAX_REQUEST_LENGTH;
    }
897421
public function accept()
    {
        $filename = $this->current()->getRelativePathname();

        if ('\\' === \DIRECTORY_SEPARATOR) {
            $filename = str_replace('\\', '/', $filename);
        }

        return $this->isAccepted($filename);
    }
1257980
public static function getMaxFilesize()
    {
        $max = trim(ini_get('upload_max_filesize'));

        if ('' === $max) {
            return PHP_INT_MAX;
        }

        $unit = strtolower(substr($max, -1));
        $max = (int)substr($max, 0, -1);

        if (in_array($unit, array('g', 'm', 'k'), true)) {
            $max *= 1024;
        }

        return $max;
    }
1226810
public function getMaxFileSize(): int
    {
        if ($this->maxFileSize === null) {
            $value = ini_get("upload_max_filesize");
            $units = "BKMGT";
            $unit = preg_replace("/[^$units]/i", "", $value);
            $value = floatval($value);
            if ($unit) {
                $value *= pow(1024, stripos($units, $unit[0]));
            }
            $this->maxFileSize = (int) $value;
        }
        return $this->maxFileSize;
    }
1002586
public function getMaxHostHex()
    {
        if ($this->network_size === 32 || $this->network_size === 31) {
            return implode('', array_map(
                function ($quad) {
                    return sprintf(self::FORMAT_HEX, $quad);
                },
                $this->quads
            ));
        }
        return $this->maxHostCalculation(self::FORMAT_HEX);
    }
234459
public function actionReadFile()
	{
        $target_path = $this->get['path'];
		$target_fullpath = $this->getFullPath($target_path, true);
        Log::info('reading file "' . $target_fullpath . '"');

        if(is_dir($target_fullpath)) {
            $this->error('FORBIDDEN_ACTION_DIR');
        }

        // check if the name is not in "excluded" list
        if(!$this->is_allowed_name($target_fullpath, false)) {
            $this->error('INVALID_DIRECTORY_OR_FILE');
        }

		$filesize = filesize($target_fullpath);
		$length = $filesize;
		$context = null;

		if(isset($_SERVER['HTTP_RANGE'])) {
			if(!preg_match('/bytes=(\d+)-(\d+)?/', $_SERVER['HTTP_RANGE'], $matches)) {
				header('HTTP/1.1 416 Requested Range Not Satisfiable');
				header('Content-Range: bytes */' . $filesize);
				exit;
			}

			$offset = intval($matches[1]);

			if(isset($matches[2])) {
				$end = intval($matches[2]);
				if($offset > $end) {
					header('HTTP/1.1 416 Requested Range Not Satisfiable');
					header('Content-Range: bytes */' . $filesize);
					exit;
				}
				$length = $end - $offset;
			} else {
				$length = $filesize - $offset;
			}

			$bytes_start = $offset;
			$bytes_end = $offset + $length - 1;
			$context = stream_context_create([
				's3' => [
					'seekable' => true,
					'Range' => "bytes={$bytes_start}-{$bytes_end}",
				]
			]);

			header('HTTP/1.1 206 Partial Content');
			// A full-length file will indeed be "bytes 0-x/x+1", think of 0-indexed array counts
			header('Content-Range: bytes ' . $bytes_start . '-' . $bytes_end . '/' . $filesize);
			// While playing media by direct link (not via FM) FireFox and IE doesn't allow seeking (rewind) it in player
			// This header can fix this behavior if to put it out of this condition, but it breaks PDF preview
			header('Accept-Ranges: bytes');
		}

		header('Content-Type: ' . $this->getMimeType($target_fullpath));
		header("Content-Transfer-Encoding: binary");
		header("Content-Length: " . $length);
		header('Content-Disposition: inline; filename="' . basename($target_fullpath) . '"');

		readfile($target_fullpath, null, $context);
		exit;
	}
1339785
public static function getRecursionLimit(): int
    {
        if (self::$recursionLimit) {
            return self::$recursionLimit;
        }

        self::$recursionLimit = self::$recursionLimitFallback;

        if (self::$objectManager instanceof ObjectManagerInterface) {
            $configurationManager = self::$objectManager->get(ConfigurationManager::class);
            if ($configurationManager instanceof ConfigurationManager) {
                $recursionLimitFromSettings = $configurationManager->getConfiguration('Settings', 'Neos.Flow.error.debugger.recursionLimit');
                if (is_int($recursionLimitFromSettings)) {
                    self::$recursionLimit = $recursionLimitFromSettings;
                }
            }
        }

        return self::$recursionLimit;
    }
165183
private function maxLength()
	{
		$max = mb_strlen($this->value);
		if (!$ret = $max <= $this->options->max) {
			$this->error(1);
		}

		return $ret;
	}
442360
public function checkBackupIsPossible()
    {
        $size = 0;
        if (preg_match('/^(\d+)(.)$/', ini_get('memory_limit'), $matches)) {
            switch (strtolower($matches[2])) {
                case 'k':
                    $size = $matches[1] / 1024;
                    break;
                case 'm':
                    $size = $matches[1];
                    break;
                case 'g':
                    $size = $matches[1] * 1024;
                    break;
            }
        }

        if ($this->getDataBaseSize() > ($size - 64) / 8) {
            return false;
        }

        return true;
    }
77514
protected function checkCacheVersion()
    {
        $fileName = $this->getVersionFileName();

        if (!file_exists($fileName)) {
            return false;
        }

        $version = md5($this->boltVersion);
        $cached = file_get_contents($fileName);

        if ($version === $cached) {
            return true;
        }
        $this->versionChange = true;

        return false;
    }
262878
public function getSizeLimit()
    {
        // Get the lowest between post_max_size and upload_max_filesize, log a warning if the first is < than the latter
        $limit = $this->sizeToBytes(ini_get('upload_max_filesize'));
        $postLimit = $this->sizeToBytes(ini_get('post_max_size'));
        if ($postLimit > 0 && $postLimit < $limit) {
            Yii::warning('PHP.ini\'s \'post_max_size\' is less than \'upload_max_filesize\'.', __METHOD__);
            $limit = $postLimit;
        }
        if ($this->maxSize !== null && $limit > 0 && $this->maxSize < $limit) {
            $limit = $this->maxSize;
        }

        if (($request = Yii::getApp()->getRequest()) instanceof \yii\web\Request) {
            $maxFileSize = Yii::getApp()->getRequest()->getParsedBodyParam('MAX_FILE_SIZE', 0);
            if ($maxFileSize > 0 && $maxFileSize < $limit) {
                $limit = (int)$maxFileSize;
            }
        }

        return $limit;
    }
1242583
public static function maxBytesUpload ()
		{
			$values = [
				ini_get('post_max_size'),
				ini_get('upload_max_filesize'),
				ini_get('memory_limit'),
			];

			$min = false;
			foreach ($values as $v)
			{
				if ($v != -1)
				{
					$bytes = self::toBytes($v);
					if ($bytes != null)
						$min = $min ? min($min, $bytes) : $bytes;
				}
			}

			return $min ? $min : null;
		}
730716
public function limit()
    {
        // get limit from config file
        $limit = $this->getMaximumLimit();
        // get the limit from the request if available else get the the default predefined limit from the config file
        if (Input::get('limit') && is_numeric(Input::get('limit'))) {
            $limit = Input::get('limit');
        }

        // validate the limit does not exceed the allowed value
        return $this->validateRequestedLimitValue($limit);
    }
519118
public function isValidExtension()
    {
        return !count($this->allowedExtensions)
            || in_array($this->getFileExtension(), $this->allowedExtensions, true);
    }
547540
public function accept()
	{
		$this->numberScanned++;
		if( !parent::accept() )
			return FALSE;
		$this->numberFound++;
		if( !$this->contentPattern )
			return TRUE;
		$filePath	= $this->current()->getPathname();
		$realPath	= realpath( $this->current()->getPathname() );
		if( $realPath )
			$filePath	= $realPath;
		$content	= FS_File_Reader::load( $filePath );
		$found		= preg_match( $this->contentPattern, $content );
		return $found;
	}
334673
private static function getUploadMaxFileSizeInBytes() {
    $val = trim(ini_get('upload_max_filesize'));
    $unit = strtolower(substr($val, -1));
    switch ($unit) {
      case 'g':
        $val *= 1024;
        // Fall through
      case 'm':
        $val *= 1024;
        // Fall through
      case 'k':
        $val *= 1024;
        break;
    }
    return intval($val);
  }
329832
public function getMaxChunks()
	{
		return ceil(($this->name !== null ? filesize($this->name) : 0) / $this->size);
	}