Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion ci/prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ fi
php -dphar.readonly=0 ./utils/make-phar.php easyengine.phar --quiet

# Checking the phar is working.
./easyengine.phar cli info
sudo ./easyengine.phar cli info
docker ps -a
28 changes: 17 additions & 11 deletions php/EE/Runner.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,28 +81,34 @@ private function init_ee() {
*/
public function check_requirements( $show_error = true ) {

$status = true;
$error = [];
$docker_running = true;
$status = true;
$error = [];

$docker_running = 'docker ps > /dev/null';
if ( ! EE::exec( $docker_running ) ) {
$status = false;
$error[] = 'Docker not installed or not running.';
$docker_running_cmd = 'docker ps > /dev/null';
if ( ! EE::exec( $docker_running_cmd ) ) {
$status = false;
$docker_running = false;
$error[] = 'Docker not installed or not running.';
}

$docker_compose_installed = 'command -v docker-compose > /dev/null';
if ( ! EE::exec( $docker_compose_installed ) ) {
$status = false;
$error[] = 'EasyEngine requires docker-compose.';
$status = false;
$error[] = 'EasyEngine requires docker-compose.';
}

if ( version_compare( PHP_VERSION, '7.2.0' ) < 0 ) {
$status = false;
$error[] = 'EasyEngine requires minimum PHP 7.2.0 to run.';
$status = false;
$error[] = 'EasyEngine requires minimum PHP 7.2.0 to run.';
}

if ( $show_error && ! $status ) {
EE::error( reset( $error ) );
EE::error( reset( $error ), false );
if ( IS_DARWIN && ! $docker_running ) {
EE::log( 'For macOS docker can be installed using: `brew cask install docker`' );
}
die;
}

return $status;
Expand Down
9 changes: 5 additions & 4 deletions php/commands/src/CLI_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -502,18 +502,19 @@ public function self_uninstall( $args, $assoc_args ) {
EE::confirm( "Are you sure you want to remove EasyEngine and all its sites(along with their data)?\nThis is an irreversible action. No backup will be kept.", $assoc_args );

EE::exec( 'docker rm -f $(docker ps -aqf label=org.label-schema.vendor="EasyEngine")' );
$home = Utils\get_home_dir();
EE::exec( "rm -rf $home/.ee/" );
EE::exec( 'docker network prune -f $(docker network ls -f "label=org.label-schema.vendor=EasyEngine")' );
EE::exec( 'docker volume rm -f $(docker volume ls -f "label=org.label-schema.vendor=EasyEngine" -q)' );
EE::exec( 'docker image rm $(docker image ls -f "label=org.label-schema.vendor=EasyEngine" -q)' );

$records = Site::all( [ 'site_fs_path' ] );

$fs = new Filesystem();
if ( ! empty( $records ) ) {
$sites_paths = array_column( $records, 'site_fs_path' );
$fs = new Filesystem();
$fs->remove( $sites_paths );
}

EE::exec( "rm -rf " . EE_ROOT_DIR );
$fs->remove( EE_ROOT_DIR );

if ( Utils\inside_phar() ) {
unlink( realpath( $_SERVER['argv'][0] ) );
Expand Down