diff --git a/bin/craft-copy-installer.php b/bin/craft-copy-installer.php deleted file mode 100755 index e68d325..0000000 --- a/bin/craft-copy-installer.php +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/env php - 5) { - die('Unable to find the project root: craft binary is missing.'); - } -} - - -// Composer autoloader -require_once $root . '/vendor/autoload.php'; - -define('CRAFT_VENDOR_PATH', $root . '/vendor'); -define('CRAFT_BASE_PATH', $root); -define('YII_DEBUG', false); - -// dotenv? -if (file_exists($root . '/.env')) { - $dotenv = new Dotenv\Dotenv($root); - $dotenv->load(); -} - -// Bootstrap Craft -$app = require $root . '/vendor/craftcms/cms/bootstrap/console.php'; - -installer(); - - -function installer() -{ - if (\Craft::$app->getIsInstalled()) { - echo "Craft is already installed!" . PHP_EOL; - - return install_copy(); - } - - - $migration = new \craft\migrations\Install([ - 'username' => 'dummy', - 'password' => \craft\helpers\StringHelper::randomString(), - 'email' => 'dummy@domain.tld', - 'site' => new \craft\models\Site([ - 'name' => 'dummy', - 'handle' => 'default', - 'hasUrls' => true, - 'baseUrl' => '@web', - 'language' => 'en-US', - ]) - ]); - - // Run the install migration - echo '*** installing Craft' . PHP_EOL; - $migrator = \Craft::$app->getMigrator(); - - try { - $migrator->migrateUp($migration); - } catch (\yii\base\Exception $e) { - die("Failed to install Craft" . PHP_EOL); - } - - - echo "Craft installed successfully" . PHP_EOL; - - // Mark all existing migrations as applied - foreach ($migrator->getNewMigrations() as $name) { - $migrator->addMigrationHistory($name); - } - - return install_copy(); -} - -function install_copy() -{ - if (\Craft::$app->plugins->installPlugin('copy')) { - echo "Copy plugin installed successfully." . PHP_EOL; - return 0; - } - - echo "Failed to install Copy plugin." . PHP_EOL; - return 1; -} diff --git a/composer.json b/composer.json index dd730f4..2ded89b 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "fortrabbit/craft-copy", "description": "Tooling for Craft on fortrabbit", "type": "craft-plugin", - "version": "1.0.0-RC3", + "version": "1.0.0-RC4", "keywords": [ "craft", "cms", @@ -55,7 +55,6 @@ "stan": "@ps" }, "bin": [ - "bin/craft-copy-installer.php", "bin/craft-copy-import-db.php", "bin/craft-copy-env.php" ]