Skip to content

Commit ad5ea26

Browse files
committed
Merge pull request #7779 in SW/shopware from sw-24135/5.5/add-support-for-open_basedir-envs to 5.5
* commit '002f22b9d3487b7a8919328f28e7c5d29d16a336': SW-24135 - Add support for environments using `open_basedir` for restricting access to the filesystem
2 parents f4f31ad + 002f22b commit ad5ea26

File tree

3 files changed

+37
-27
lines changed

3 files changed

+37
-27
lines changed

UPGRADE-5.5.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,15 @@ This changelog references changes done in Shopware 5.5 patch versions.
44

55
## 5.5.10
66

7-
[View all changes from v5.5.8...v5.5.9](https://github.com/shopware/shopware/compare/v5.5.9...v5.5.10)
7+
[View all changes from v5.5.9...v5.5.10](https://github.com/shopware/shopware/compare/v5.5.9...v5.5.10)
8+
9+
### Additions
10+
11+
* Added support for environments using `open_basedir` for restricting access to the filesystem
812

913
### Changes
1014

11-
- Changed `\Shopware\Bundle\StoreFrontBundle\Gateway\DBAL\CategoryGateway::get` to support `int` and `array` parameters
15+
* Changed `\Shopware\Bundle\StoreFrontBundle\Gateway\DBAL\CategoryGateway::get` to support `int` and `array` parameters
1216

1317
### Deprecations
1418

engine/Shopware/Components/Check/Requirements.php

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -277,18 +277,22 @@ private function checkOpcache()
277277
'error' => '',
278278
]];
279279

280-
if (fileinode('/') > 2) {
281-
$validateRootOption = $this->compare('opcache.validate_root', ini_get('opcache.validate_root'), '1');
282-
$opcacheRequirements[] = [
283-
'name' => 'opcache.validate_root',
284-
'group' => 'core',
285-
'required' => 1,
286-
'version' => ini_get('opcache.validate_root'),
287-
'result' => ini_get('opcache.validate_root'),
288-
'notice' => '',
289-
'check' => $this->compare('opcache.validate_root', ini_get('opcache.validate_root'), '1'),
290-
'error' => '',
291-
];
280+
try {
281+
if (fileinode('/') > 2) {
282+
$validateRootOption = $this->compare('opcache.validate_root', ini_get('opcache.validate_root'), '1');
283+
$opcacheRequirements[] = [
284+
'name' => 'opcache.validate_root',
285+
'group' => 'core',
286+
'required' => 1,
287+
'version' => ini_get('opcache.validate_root'),
288+
'result' => ini_get('opcache.validate_root'),
289+
'notice' => '',
290+
'check' => $this->compare('opcache.validate_root', ini_get('opcache.validate_root'), '1'),
291+
'error' => '',
292+
];
293+
}
294+
} catch (\ErrorException $x) {
295+
// Systems that have an 'open_basedir' defined might not allow an access of '/'
292296
}
293297

294298
return $opcacheRequirements;

recovery/install/src/Requirements.php

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,6 @@ private function checkOpcache()
233233
return [];
234234
}
235235

236-
$useCwdOption = $this->compare('opcache.use_cwd', ini_get('opcache.use_cwd'), '1');
237236
$opcacheRequirements = [[
238237
'name' => 'opcache.use_cwd',
239238
'group' => 'core',
@@ -245,18 +244,21 @@ private function checkOpcache()
245244
'error' => '',
246245
]];
247246

248-
if (fileinode('/') > 2) {
249-
$validateRootOption = $this->compare('opcache.validate_root', ini_get('opcache.validate_root'), '1');
250-
$opcacheRequirements[] = [
251-
'name' => 'opcache.validate_root',
252-
'group' => 'core',
253-
'required' => 1,
254-
'version' => ini_get('opcache.validate_root'),
255-
'result' => ini_get('opcache.validate_root'),
256-
'notice' => '',
257-
'check' => $this->compare('opcache.validate_root', ini_get('opcache.validate_root'), '1'),
258-
'error' => '',
259-
];
247+
try {
248+
if (fileinode('/') > 2) {
249+
$opcacheRequirements[] = [
250+
'name' => 'opcache.validate_root',
251+
'group' => 'core',
252+
'required' => 1,
253+
'version' => ini_get('opcache.validate_root'),
254+
'result' => ini_get('opcache.validate_root'),
255+
'notice' => '',
256+
'check' => $this->compare('opcache.validate_root', ini_get('opcache.validate_root'), '1'),
257+
'error' => '',
258+
];
259+
}
260+
} catch (\ErrorException $x) {
261+
// Systems that have an 'open_basedir' defined might not allow an access of '/'
260262
}
261263

262264
return $opcacheRequirements;

0 commit comments

Comments
 (0)