From 8d01d9f271aa652b9345a472428996a1b0073f70 Mon Sep 17 00:00:00 2001 From: yiendos Date: Tue, 15 Dec 2020 10:56:02 +0000 Subject: [PATCH] #50: drop isStandalone support --- .../Composer/ExtensionInstaller.php | 4 +--- src/Joomlatools/Composer/Plugin.php | 2 +- src/Joomlatools/Joomla/Util.php | 21 ------------------- 3 files changed, 2 insertions(+), 25 deletions(-) diff --git a/src/Joomlatools/Composer/ExtensionInstaller.php b/src/Joomlatools/Composer/ExtensionInstaller.php index b10b05e..004fc7f 100644 --- a/src/Joomlatools/Composer/ExtensionInstaller.php +++ b/src/Joomlatools/Composer/ExtensionInstaller.php @@ -33,9 +33,7 @@ public function __construct(IOInterface $io) public function execute() { - $isStandalone = Util::isStandalone(); - - if ($isStandalone){ + if (!Util::isJoomla() && !Util::isJoomlatoolsPlatform()) { return true; } diff --git a/src/Joomlatools/Composer/Plugin.php b/src/Joomlatools/Composer/Plugin.php index b9a2a11..b6253a8 100644 --- a/src/Joomlatools/Composer/Plugin.php +++ b/src/Joomlatools/Composer/Plugin.php @@ -40,7 +40,7 @@ class Plugin implements PluginInterface, EventSubscriberInterface */ public function activate(Composer $composer, IOInterface $io) { - if (!Util::isJoomla() && !Util::isJoomlatoolsPlatform() && !Util::isStandalone()) { + if (!Util::isJoomla() && !Util::isJoomlatoolsPlatform()) { throw new \RuntimeException('Working directory is not a valid install destination'); } diff --git a/src/Joomlatools/Joomla/Util.php b/src/Joomlatools/Joomla/Util.php index 5274fed..48c8bcf 100644 --- a/src/Joomlatools/Joomla/Util.php +++ b/src/Joomlatools/Joomla/Util.php @@ -24,27 +24,6 @@ public static function getPlatformName() return static::isJoomlatoolsPlatform() ? 'Joomlatools Platform' : 'Joomla'; } - /** - * Validate if the current working directory is a Standalone app - * - * @return bool - */ - public static function isStandalone() - { - $directories = array('./components', './web'); - - foreach ($directories as $directory) - { - $path = realpath($directory); - - if (!file_exists($path)){ - return false; - } - } - - return true; - } - /** * Validate if the current working directory has a valid Joomla installation *