Skip to content

Commit

Permalink
add environmental file to allow force/deny installer app
Browse files Browse the repository at this point in the history
  • Loading branch information
Derek Jones committed Nov 15, 2018
1 parent 5cb5512 commit afdb3f1
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .env.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?php
putenv('EE_INSTALL_MODE=FALSE');

// EOF
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ But ExpressionEngine _can_ run on PHP 5.6+ and MySQL 5.5.3+. For full details an

Read [Installing ExpressionEngine](https://docs.expressionengine.com/latest/installation/installation.html) in the User GUide for full instructions, tips, and post-install best practices.

Note: If you're installing from the repository, you will also need to:

- add an empty config file, e.g. `touch system/user/config.php`
- route requests to the installer app instead of the main app by changing `EE_INSTALL_MODE` to `TRUE` in [.env.php](.env.php). You can change this back when you're done.

## How to Get Started

ExpressionEngine separates your content from your design, enabling you to make small or large changes to your website with ease. Your content is stored in Channels, and your design is kept in Templates, both of which are entirely under your control. ExpressionEngine bends to _your_ needs, not the other way around like many other CMSes.
Expand Down
11 changes: 10 additions & 1 deletion admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,16 @@
// The control panel access constant ensures the CP will be invoked.
define('REQ', 'CP');

// force the installer/updater?
if (file_exists(FCPATH.'.env.php') && (require FCPATH.'.env.php') == TRUE && getenv('EE_INSTALL_MODE') === 'TRUE')
{
define('INSTALL_MODE', TRUE);
}
else
{
define('INSTALL_MODE', FALSE);
}

/*
* --------------------------------------------------------------------
* Set the error reporting level
Expand All @@ -123,7 +133,6 @@
error_reporting(0);
}


/*
*---------------------------------------------------------------
* LOAD THE BOOTSTRAP FILE
Expand Down
6 changes: 5 additions & 1 deletion system/ee/EllisLab/ExpressionEngine/Boot/boot.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,11 @@
*/
use EllisLab\ExpressionEngine\Core;

if (FALSE && defined('REQ') && in_array(REQ, ['CP', 'CLI']) && is_dir(SYSPATH.'ee/installer/'))
if (
defined('REQ') && in_array(REQ, ['CP', 'CLI']) &&
is_dir(SYSPATH.'ee/installer/') &&
( ! defined('INSTALL_MODE') OR INSTALL_MODE != FALSE)
)
{
$core = new Core\Installer();
}
Expand Down

0 comments on commit afdb3f1

Please sign in to comment.