public static function doBoilerplateAlreadySetupScript(Event $event) { $event->getIO()->write('The boilerplate was previously setup.'); if (!file_exists(__DIR__ . '/../../html')) { $event->getIO()->write('Please run "composer update" instead of "install"'); $event->stopPropagation(); return; } if (!file_exists($wp_config = __DIR__ . '/../../wp-config.php')) { copy(__DIR__ . '/../../boilerplate-templates/wp-config.php', __DIR__ . '/../../wp-config.php'); } if (!file_exists($wp_config = __DIR__ . '/../../html/wp-config.php')) { $handle = fopen($wp_config, 'w'); fwrite($handle, "<?php require_once __DIR__.'/../wp-config.php';"); fclose($handle); } if (file_exists($wp_content_dir = __DIR__ . '/../../html/wp-content')) { self::deleteTreeWithSymlinks($wp_content_dir); } if (file_exists($temp_folder = __DIR__ . '/../../wp-temp')) { rename($temp_folder . '/.htaccess', __DIR__ . '/../../html/.htaccess'); rename($temp_folder . '/wp-content', __DIR__ . '/../../html/wp-content'); } if (file_exists($wp_temp = __DIR__ . '/../../wp-temp')) { self::deleteTreeWithSymlinks($wp_temp); } if (file_exists($composer_dir = __DIR__ . '/../../html/composer.json')) { unlink($composer_dir); } if (file_exists($wp_config_sample = __DIR__ . '/../../html/wp-config-sample.php')) { unlink($wp_config_sample); } if (file_exists($html_temp = __DIR__ . '/../../html_temp')) { self::deleteTree($html_temp); } if (!self::symlinkExists($link = __DIR__ . '/../../shortcut-taco-theme')) { symlink(__DIR__ . '/../../html/wp-content/themes/taco-theme', $link); } return; }