Skip to content

Commit eef63bb

Browse files
committed
Merge remote-tracking branch 'origin/MAGETWO-52667-umask-file-dev' into develop
2 parents 8154a2c + 9ab674b commit eef63bb

File tree

4 files changed

+13
-16
lines changed

4 files changed

+13
-16
lines changed

.htaccess

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@
44

55
# SetEnv MAGE_MODE developer
66

7-
############################################
8-
## overrides default umask value to allow using different
9-
## file permissions
10-
11-
# SetEnv MAGE_UMASK 022
12-
137
############################################
148
## uncomment these lines for CGI mode
159
## make sure to specify the correct cgi php binary file name
@@ -281,6 +275,10 @@
281275
order allow,deny
282276
deny from all
283277
</Files>
278+
<Files magento_umask>
279+
order allow,deny
280+
deny from all
281+
</Files>
284282

285283
################################
286284
## If running in cluster environment, uncomment this

.htaccess.sample

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,10 @@
274274
order allow,deny
275275
deny from all
276276
</Files>
277+
<Files magento_umask>
278+
order allow,deny
279+
deny from all
280+
</Files>
277281

278282
################################
279283
## If running in cluster environment, uncomment this

app/bootstrap.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@
1010
error_reporting(E_ALL);
1111
#ini_set('display_errors', 1);
1212

13-
/* Custom umask value may be provided in MAGE_UMASK environment variable */
14-
$mask = isset($_SERVER['MAGE_UMASK']) ? octdec($_SERVER['MAGE_UMASK']) : 002;
15-
umask($mask);
16-
1713
/* PHP version validation */
1814
if (!defined('PHP_VERSION_ID') || PHP_VERSION_ID < 50522) {
1915
if (PHP_SAPI == 'cli') {
@@ -34,6 +30,11 @@
3430
require_once __DIR__ . '/autoload.php';
3531
require_once BP . '/app/functions.php';
3632

33+
/* Custom umask value may be provided in optional mage_umask file in root */
34+
$umaskFile = BP . '/magento_umask';
35+
$mask = file_exists($umaskFile) ? octdec(file_get_contents($umaskFile)) : 002;
36+
umask($mask);
37+
3738
if (!empty($_SERVER['MAGE_PROFILER'])
3839
&& isset($_SERVER['HTTP_ACCEPT'])
3940
&& strpos($_SERVER['HTTP_ACCEPT'], 'text/html') !== false

pub/.htaccess

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@
44

55
# SetEnv MAGE_MODE default # or production or developer
66

7-
############################################
8-
## Overrides default umask value to allow using different
9-
## file permissions
10-
11-
# SetEnv MAGE_UMASK 022
12-
137
############################################
148
## Uncomment these lines for CGI mode.
159
## Make sure to specify the correct cgi php binary file name

0 commit comments

Comments
 (0)