Skip to content

Commit

Permalink
Merge pull request #602 from magento-extensibility/MAGETWO-52612-umas…
Browse files Browse the repository at this point in the history
…k-file

[Extensibility] MAGETWO-52612
  • Loading branch information
Korshenko, Oleksii(okorshenko) committed May 10, 2016
2 parents a251866 + b2f575f commit 721ee66
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 22 deletions.
10 changes: 4 additions & 6 deletions .htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@

# SetEnv MAGE_MODE developer

############################################
## overrides default umask value to allow using different
## file permissions

# SetEnv MAGE_UMASK 022

############################################
## uncomment these lines for CGI mode
## make sure to specify the correct cgi php binary file name
Expand Down Expand Up @@ -285,6 +279,10 @@
order allow,deny
deny from all
</Files>
<Files magento_umask>
order allow,deny
deny from all
</Files>

################################
## If running in cluster environment, uncomment this
Expand Down
10 changes: 4 additions & 6 deletions .htaccess.sample
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@

# SetEnv MAGE_MODE developer

############################################
## overrides default umask value to allow using different
## file permissions

# SetEnv MAGE_UMASK 022

############################################
## uncomment these lines for CGI mode
## make sure to specify the correct cgi php binary file name
Expand Down Expand Up @@ -251,6 +245,10 @@
order allow,deny
deny from all
</Files>
<Files magento_umask>
order allow,deny
deny from all
</Files>

################################
## If running in cluster environment, uncomment this
Expand Down
9 changes: 5 additions & 4 deletions app/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@
error_reporting(E_ALL);
#ini_set('display_errors', 1);

/* Custom umask value may be provided in MAGE_UMASK environment variable */
$mask = isset($_SERVER['MAGE_UMASK']) ? octdec($_SERVER['MAGE_UMASK']) : 002;
umask($mask);

/* PHP version validation */
if (version_compare(phpversion(), '5.5.0', '<') === true) {
if (PHP_SAPI == 'cli') {
Expand All @@ -34,6 +30,11 @@
require_once __DIR__ . '/autoload.php';
require_once BP . '/app/functions.php';

/* Custom umask value may be provided in optional mage_umask file in root */
$umaskFile = BP . '/magento_umask';
$mask = file_exists($umaskFile) ? octdec(file_get_contents($umaskFile)) : 002;
umask($mask);

if (!empty($_SERVER['MAGE_PROFILER'])
&& isset($_SERVER['HTTP_ACCEPT'])
&& strpos($_SERVER['HTTP_ACCEPT'], 'text/html') !== false
Expand Down
6 changes: 0 additions & 6 deletions pub/.htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@

# SetEnv MAGE_MODE developer

############################################
## overrides default umask value to allow using different
## file permissions

# SetEnv MAGE_UMASK 022

############################################
## uncomment these lines for CGI mode
## make sure to specify the correct cgi php binary file name
Expand Down

0 comments on commit 721ee66

Please sign in to comment.