Skip to content

Commit

Permalink
Merge branch '8.1' into 8.2
Browse files Browse the repository at this point in the history
  • Loading branch information
kitsunet committed Nov 22, 2023
2 parents 82bd7ca + 474ab2d commit a444c46
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 5 deletions.
6 changes: 5 additions & 1 deletion Neos.Cache/Classes/Backend/FileBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,11 +245,15 @@ public function findIdentifiersByTag(string $searchedTag): array
* specified tags.
*
* @param string[] $tags The tags to search for
* @return string[] An array with identifiers of all matching entries. An empty array if no entries matched
* @return string[] An array with identifiers of all matching entries. An empty array if no entries matched or no tags were provided
* @api
*/
public function findIdentifiersByTags(array $tags): array
{
if (empty($tags)) {
return [];
}

$entryIdentifiers = [];
$now = $_SERVER['REQUEST_TIME'];
$cacheEntryFileExtensionLength = strlen($this->cacheEntryFileExtension);
Expand Down
12 changes: 12 additions & 0 deletions Neos.Eel/Resources/Private/PHP/php-peg/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
* the bracket if a failed match + restore has moved the current position backwards - so we have to check that too.
*/
class ParserRegexp {
protected $parser = null;
protected $rx = '';
protected $matches = null;
protected $match_pos = null;
protected $check_pos = null;

function __construct($parser, $rx) {
$this->parser = $parser;
Expand Down Expand Up @@ -50,6 +55,10 @@ function match() {
* for result construction and building
*/
class Parser {
public $string = '';
public $pos = 0;
protected $depth = 0;
protected $regexps = [];

function __construct($string) {
$this->string = $string;
Expand Down Expand Up @@ -211,6 +220,9 @@ function store(&$result, $subres, $storetag = NULL) {
* @author Hamish Friedlander
*/
class Packrat extends Parser {
protected $packstatebase = '';
protected $packstate = [];
protected $packres = [];

function __construct($string) {
parent::__construct($string);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,11 @@ public function resourceStat()
*/
public function pathStat($path, $flags)
{
return @stat($this->evaluateResourcePath($path));
$evaluatedResourcePath = $this->evaluateResourcePath($path);
if (is_resource($evaluatedResourcePath)) {
return @fstat($evaluatedResourcePath);
}
return @stat($evaluatedResourcePath);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@
*/
class InvalidHashException extends \Neos\Flow\Security\Exception
{
protected $statusCode = 400;
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ But let's start with an easy example:
``name`` is optional, but it's recommended to set a name for all routes to make debugging
easier.

If you insert these lines at the beginning of the file ``Configurations/Routes.yaml``,
If you insert these lines at the beginning of the file ``Configuration/Routes.yaml``,
the ``indexAction`` of the ``StandardController`` in your *My.Demo* package will be called
when you open up the homepage of your Flow installation (``http://localhost/``).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ SetHandler default-handler
SetHandler default-handler
</Files>

<IfModule mod_php5.c>
<IfModule mod_php7.c>
php_flag engine off
</IfModule>
<IfModule mod_php7.c>
<IfModule mod_php.c>
php_flag engine off
</IfModule>
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,22 @@ public function openResolvesAnUpperCaseSha1HashUsingTheResourceManager()
self::assertSame($tempFile, ObjectAccess::getProperty($this->resourceStreamWrapper, 'handle', true));
}

/**
* @test
*/
public function resourceStreamWrapperAllowsStatOfValidResourceLinks()
{
$sha1Hash = '68ac906495480a3404beee4874ed853a037a7a8f';

$tempFile = tmpfile();

$mockResource = $this->getMockBuilder(PersistentResource::class)->disableOriginalConstructor()->getMock();
$this->mockResourceManager->expects(self::once())->method('getResourceBySha1')->with($sha1Hash)->will(self::returnValue($mockResource));
$this->mockResourceManager->expects(self::once())->method('getStreamByResource')->with($mockResource)->will(self::returnValue($tempFile));

self::assertIsArray($this->resourceStreamWrapper->pathStat('resource://' . $sha1Hash, 0));
}

/**
* @test
*/
Expand Down

0 comments on commit a444c46

Please sign in to comment.