Skip to content

Commit 771242c

Browse files
authored
Merge pull request #5656 from magento-trigger/web-api-pr
[Trigger] Fixes for Web-Api tests
2 parents 488f3b9 + 599ef16 commit 771242c

File tree

4 files changed

+18
-212
lines changed

4 files changed

+18
-212
lines changed

.travis.yml.sample

Lines changed: 0 additions & 68 deletions
This file was deleted.

dev/tests/static/testsuite/Magento/Test/Integrity/HhvmCompatibilityTest.php

Lines changed: 0 additions & 141 deletions
This file was deleted.

lib/internal/Magento/Framework/App/DeploymentConfig/Reader.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ public function load($fileKey = null)
100100
if ($fileKey) {
101101
$filePath = $path . '/' . $this->configFilePool->getPath($fileKey);
102102
if ($fileDriver->isExists($filePath)) {
103+
$this->refreshCache($filePath);
103104
$result = include $filePath;
104105
if (!is_array($result)) {
105106
throw new RuntimeException(new Phrase("Invalid configuration file: '%1'", [$filePath]));
@@ -110,6 +111,7 @@ public function load($fileKey = null)
110111
foreach ($configFiles as $file) {
111112
$configFile = $path . '/' . $file;
112113
if ($fileDriver->isExists($configFile)) {
114+
$this->refreshCache($configFile);
113115
$fileData = include $configFile;
114116
if (!is_array($fileData)) {
115117
throw new RuntimeException(new Phrase("Invalid configuration file: '%1'", [$configFile]));
@@ -124,4 +126,17 @@ public function load($fileKey = null)
124126
}
125127
return $result ?: [];
126128
}
129+
130+
/**
131+
* Invalidate cache
132+
*
133+
* @param string $filePath
134+
*/
135+
private function refreshCache(string $filePath): void
136+
{
137+
if (function_exists('opcache_invalidate')
138+
&& filter_var(ini_get('opcache.enable'), FILTER_VALIDATE_BOOLEAN)) {
139+
opcache_invalidate($filePath);
140+
}
141+
}
127142
}

lib/internal/Magento/Framework/View/Helper/PathPattern.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function translatePatternFromGlob($path)
3939
protected function translateGroupsFromGlob($pattern)
4040
{
4141
preg_match_all('~\\\\\\{[^,\\}]+(?:,[^,\\}]*)*\\\\\\}~', $pattern, $matches, PREG_OFFSET_CAPTURE);
42-
for ($index = count($matches[0]) - 1; $index >= 0; $index -= 1) {
42+
for ($index = count($matches[0]) - 1; $index >= 0; $index--) {
4343
list($match, $offset) = $matches[0][$index];
4444
$replacement = substr_replace($match, '(?:', 0, 2);
4545
$replacement = substr_replace($replacement, ')', -2);
@@ -65,9 +65,9 @@ protected function translateGroupsFromGlob($pattern)
6565
protected function translateCharacterGroupsFromGlob($pattern)
6666
{
6767
preg_match_all('~\\\\\\[(\\\\\\!)?[^\\]]+\\\\\\]~i', $pattern, $matches, PREG_OFFSET_CAPTURE);
68-
for ($index = count($matches[0]) - 1; $index >= 0; $index -= 1) {
68+
for ($index = count($matches[0]) - 1; $index >= 0; $index--) {
6969
list($match, $offset) = $matches[0][$index];
70-
$exclude = !empty($matches[1][$index]);
70+
$exclude = !(empty($matches[1][$index]) || empty($matches[1][$index][0]));
7171
$replacement = substr_replace($match, '[' . ($exclude ? '^' : ''), 0, $exclude ? 4 : 2);
7272
$replacement = substr_replace($replacement, ']', -2);
7373
$replacement = str_replace('\\-', '-', $replacement);

0 commit comments

Comments
 (0)