From cfda1c802013fc6c0c55898a39b835e1874482f6 Mon Sep 17 00:00:00 2001 From: connor Date: Thu, 4 Apr 2024 14:35:40 +0200 Subject: [PATCH 1/3] allow to call symfony command from anywhere --- lib/task/sfBaseTask.class.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/task/sfBaseTask.class.php b/lib/task/sfBaseTask.class.php index f15f7c2b7..95448806a 100644 --- a/lib/task/sfBaseTask.class.php +++ b/lib/task/sfBaseTask.class.php @@ -56,10 +56,6 @@ public function getFilesystem() */ public function checkProjectExists() { - if (!file_exists('symfony')) { - throw new sfException('You must be in a symfony project directory.'); - } - return true; } From b882b015bc0f9c20f04e6082ad422694c63a6f7f Mon Sep 17 00:00:00 2001 From: connor Date: Thu, 4 Apr 2024 14:46:15 +0200 Subject: [PATCH 2/3] deprecate the method --- lib/task/sfBaseTask.class.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/task/sfBaseTask.class.php b/lib/task/sfBaseTask.class.php index 95448806a..5457e3b26 100644 --- a/lib/task/sfBaseTask.class.php +++ b/lib/task/sfBaseTask.class.php @@ -48,11 +48,7 @@ public function getFilesystem() } /** - * Checks if the current directory is a symfony project directory. - * - * @return true if the current directory is a symfony project directory, false otherwise - * - * @throws sfException + * @deprecated */ public function checkProjectExists() { From d93f5bd19ceb6b3cfa228823779dc5a11de98e9f Mon Sep 17 00:00:00 2001 From: connor Date: Thu, 4 Apr 2024 14:46:59 +0200 Subject: [PATCH 3/3] remove deprecated method call --- lib/task/sfBaseTask.class.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/task/sfBaseTask.class.php b/lib/task/sfBaseTask.class.php index 5457e3b26..06fbdfec3 100644 --- a/lib/task/sfBaseTask.class.php +++ b/lib/task/sfBaseTask.class.php @@ -108,8 +108,6 @@ protected function doRun(sfCommandManager $commandManager, $options) return $event->getReturnValue(); } - $this->checkProjectExists(); - $requiresApplication = $commandManager->getArgumentSet()->hasArgument('application') || $commandManager->getOptionSet()->hasOption('application'); if (null === $this->configuration || ($requiresApplication && !$this->configuration instanceof sfApplicationConfiguration)) { $application = $commandManager->getArgumentSet()->hasArgument('application') ? $commandManager->getArgumentValue('application') : ($commandManager->getOptionSet()->hasOption('application') ? $commandManager->getOptionValue('application') : null);