diff --git a/composer.json b/composer.json index 0354764f7..e13d94c9b 100644 --- a/composer.json +++ b/composer.json @@ -57,7 +57,6 @@ "prefer-stable": true, "autoload": { "files": [ - "src/constants.php", "src/functions.php" ], "psr-4": {"Drupal\\Console\\Core\\": "src"} diff --git a/src/Utils/DrupalFinder.php b/src/Utils/DrupalFinder.php new file mode 100644 index 000000000..1619bf9cf --- /dev/null +++ b/src/Utils/DrupalFinder.php @@ -0,0 +1,47 @@ +getComposerRoot(); + $vendorDir = str_replace( + $composerRoot .'/', '', $this->getVendorDir() + ); + if (!defined("DRUPAL_CONSOLE_CORE")) { + define( + "DRUPAL_CONSOLE_CORE", + "/{$vendorDir}/drupal/console-core/" + ); + } + if (!defined("DRUPAL_CONSOLE")) { + define("DRUPAL_CONSOLE", "/{$vendorDir}/drupal/console/"); + } + if (!defined("DRUPAL_CONSOLE_LANGUAGE")) { + define( + "DRUPAL_CONSOLE_LANGUAGE", + "/{$vendorDir}/drupal/console-%s/translations/" + ); + } + + return true; + } + + return false; + } +} diff --git a/src/constants.php b/src/constants.php deleted file mode 100644 index d5317f290..000000000 --- a/src/constants.php +++ /dev/null @@ -1,6 +0,0 @@ -