Skip to content

Commit 078c32e

Browse files
Merge pull request #1298 from mrrobot47/fix/skipping-checks-and-migrations
Skip checks and migrations on 'ee help' and 'ee cli' commands
2 parents 7bff0c1 + 8bbc93a commit 078c32e

File tree

1 file changed

+25
-16
lines changed

1 file changed

+25
-16
lines changed

php/EE/Runner.php

+25-16
Original file line numberDiff line numberDiff line change
@@ -51,21 +51,6 @@ public function __get( $key ) {
5151
*/
5252
private function init_ee() {
5353

54-
// Minimum requirement checks.
55-
$docker_running = 'docker ps > /dev/null';
56-
if ( ! EE::exec( $docker_running ) ) {
57-
EE::error( 'docker not installed or not running.' );
58-
}
59-
60-
$docker_compose_installed = 'command -v docker-compose > /dev/null';
61-
if ( ! EE::exec( $docker_compose_installed ) ) {
62-
EE::error( 'EasyEngine requires docker-compose.' );
63-
}
64-
65-
if ( version_compare( PHP_VERSION, '7.2.0' ) < 0 ) {
66-
EE::error( 'EasyEngine requires minimum PHP 7.2.0 to run.' );
67-
}
68-
6954
$this->ensure_present_in_config( 'locale', 'en_US' );
7055
$this->ensure_present_in_config( 'ee_installer_version', 'stable' );
7156

@@ -76,7 +61,31 @@ private function init_ee() {
7661
if ( ! is_dir( $db_dir ) ) {
7762
mkdir( $db_dir );
7863
}
79-
$this->maybe_trigger_migration();
64+
65+
if (
66+
! empty( $this->arguments ) &&
67+
( ! in_array( $this->arguments[0], [ 'cli', 'help' ], true ) ||
68+
$this->arguments === [ 'cli', 'update' ] ||
69+
$this->arguments === [ 'cli', 'self-uninstall' ] )
70+
) {
71+
72+
// Minimum requirement checks.
73+
$docker_running = 'docker ps > /dev/null';
74+
if ( ! EE::exec( $docker_running ) ) {
75+
EE::error( 'docker not installed or not running.' );
76+
}
77+
78+
$docker_compose_installed = 'command -v docker-compose > /dev/null';
79+
if ( ! EE::exec( $docker_compose_installed ) ) {
80+
EE::error( 'EasyEngine requires docker-compose.' );
81+
}
82+
83+
if ( version_compare( PHP_VERSION, '7.2.0' ) < 0 ) {
84+
EE::error( 'EasyEngine requires minimum PHP 7.2.0 to run.' );
85+
}
86+
87+
$this->maybe_trigger_migration();
88+
}
8089
}
8190

8291
/**

0 commit comments

Comments
 (0)