Skip to content

Commit

Permalink
Check if .env.example exists in web installer
Browse files Browse the repository at this point in the history
  • Loading branch information
freescout-help-desk committed Nov 13, 2018
1 parent 5294213 commit d1ba487
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ Thumbs.db
/public/modules
/storage/.ignore_locales
/storage/.installed
/tools
/tools
.well-known
6 changes: 4 additions & 2 deletions .htaccess
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# On some hostings it is impossible to change web root directory
# so we rewrite all web requests into /public folder
RewriteEngine on
RewriteRule (.*) /public/$1 [L]
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule (.*) /public/$1 [L]
</IfModule>
7 changes: 7 additions & 0 deletions public/install.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,13 @@ function showPermissionsError()
if (empty($app_key)) {
// Copy .env.example
if (!file_exists($root_dir.'.env')) {

// Check if .env.example eixists
if (!file_exists($root_dir.'.env.example')) {
showError('File <strong>'.$root_dir.'.env.example</strong> not found. Please make sure to copy this file from the application dist.');
exit();
}

copy($root_dir.'.env.example', $root_dir.'.env');

if (!file_exists($root_dir.'.env')) {
Expand Down

0 comments on commit d1ba487

Please sign in to comment.