فهرست منبع

add the return status code to each CLI command

Olivier Massot 4 سال پیش
والد
کامیت
32f35470d1

+ 1 - 0
ot_admin/Classes/Command/AddRedirectionCommand.php

@@ -66,5 +66,6 @@ class AddRedirectionCommand extends Command
         } else {
             $io->success(sprintf("A new redirection has been added"));
         }
+        return 0;
     }
 }

+ 1 - 0
ot_admin/Classes/Command/ClearSiteCacheCommand.php

@@ -66,6 +66,7 @@ class ClearSiteCacheCommand extends Command
         $rootUid = $siteController->clearSiteCacheAction($org_id, $clearAll);
 
         $io->success(sprintf("The cache has been cleared for the website with root uid " . $rootUid . ""));
+        return 0;
     }
 
 }

+ 2 - 0
ot_admin/Classes/Command/CreateSiteCommand.php

@@ -54,6 +54,7 @@ class CreateSiteCommand extends Command
      *
      * @param InputInterface $input
      * @param OutputInterface $output
+     * @return int
      * @throws \Exception
      */
     protected function execute(InputInterface $input, OutputInterface $output)
@@ -70,5 +71,6 @@ class CreateSiteCommand extends Command
         );
 
         $io->success(sprintf("A new website has been created with root page uid=" . $rootUid));
+        return 0;
     }
 }

+ 2 - 1
ot_admin/Classes/Command/DeleteSiteCommand.php

@@ -70,6 +70,7 @@ class DeleteSiteCommand extends Command
      *
      * @param InputInterface $input
      * @param OutputInterface $output
+     * @return int
      * @throws \Exception
      */
     protected function execute(InputInterface $input, OutputInterface $output)
@@ -89,7 +90,7 @@ class DeleteSiteCommand extends Command
         } else {
             $io->success(sprintf("The website with root uid " . $rootUid . " has been soft-deleted. Use ot:site:undelete to restore it."));
         }
-
+        return 0;
     }
 
 }

+ 4 - 1
ot_admin/Classes/Command/GetSiteStatusCommand.php

@@ -52,7 +52,9 @@ class GetSiteStatusCommand extends Command
      *
      * @param InputInterface $input
      * @param OutputInterface $output
-     * @throws \Exception
+     * @return int
+     * @throws \Opentalent\OtCore\Exception\NoSuchWebsiteException
+     * @throws \TYPO3\CMS\Extbase\Object\Exception
      */
     protected function execute(InputInterface $input, OutputInterface $output)
     {
@@ -79,6 +81,7 @@ class GetSiteStatusCommand extends Command
         $io->horizontalTable($headers, [$values]);
 
         $io->success('');
+        return 0;
     }
 
 }

+ 2 - 0
ot_admin/Classes/Command/RegenConfigFilesCommand.php

@@ -43,6 +43,7 @@ class RegenConfigFilesCommand extends Command
      *
      * @param InputInterface $input
      * @param OutputInterface $output
+     * @return int
      * @throws \Exception
      */
     protected function execute(InputInterface $input, OutputInterface $output)
@@ -51,5 +52,6 @@ class RegenConfigFilesCommand extends Command
         $siteController = GeneralUtility::makeInstance(ObjectManager::class)->get(SiteController::class);
         $siteController->regenConfigFilesAction();
         $io->success(sprintf("The config files were recreated"));
+        return 0;
     }
 }

+ 2 - 0
ot_admin/Classes/Command/RemoveRedirectionCommand.php

@@ -50,6 +50,7 @@ class RemoveRedirectionCommand extends Command
      *
      * @param InputInterface $input
      * @param OutputInterface $output
+     * @return int
      * @throws \Exception
      */
     protected function execute(InputInterface $input, OutputInterface $output)
@@ -64,5 +65,6 @@ class RemoveRedirectionCommand extends Command
 
         $actionName = $hard ? 'hardly-deleted' : 'deleted';
         $io->success(sprintf("$count existing redirections from $fromDomain have been $actionName"));
+        return 0;
     }
 }

+ 2 - 0
ot_admin/Classes/Command/ResetBeUserPermsCommand.php

@@ -60,6 +60,7 @@ class ResetBeUserPermsCommand extends Command
      *
      * @param InputInterface $input
      * @param OutputInterface $output
+     * @return int
      * @throws \Exception
      */
     protected function execute(InputInterface $input, OutputInterface $output)
@@ -108,6 +109,7 @@ class ResetBeUserPermsCommand extends Command
             $rootUid = $siteController->resetBeUserPermsAction($org_id, $create);
             $io->success(sprintf("The website with root uid " . $rootUid . " had its be users permissions reset"));
         }
+        return 0;
     }
 
 }

+ 2 - 0
ot_admin/Classes/Command/ScanCommand.php

@@ -44,6 +44,7 @@ class ScanCommand extends Command
      *
      * @param InputInterface $input
      * @param OutputInterface $output
+     * @return int
      * @throws \Exception
      */
     protected function execute(InputInterface $input, OutputInterface $output)
@@ -81,6 +82,7 @@ class ScanCommand extends Command
         } finally {
             fclose($f);
         }
+        return 0;
     }
 
 }

+ 2 - 0
ot_admin/Classes/Command/SetSiteDomainCommand.php

@@ -60,6 +60,7 @@ class SetSiteDomainCommand extends Command
      *
      * @param InputInterface $input
      * @param OutputInterface $output
+     * @return int
      * @throws \Exception
      */
     protected function execute(InputInterface $input, OutputInterface $output)
@@ -74,6 +75,7 @@ class SetSiteDomainCommand extends Command
         $rootUid = $siteController->setSiteCustomDomainAction($org_id, $domain, $redirect);
 
         $io->success(sprintf("The website with root uid " . $rootUid . " domain has been set to " . $domain));
+        return 0;
     }
 
 }

+ 2 - 0
ot_admin/Classes/Command/UndeleteSiteCommand.php

@@ -48,6 +48,7 @@ class UndeleteSiteCommand extends Command
      *
      * @param InputInterface $input
      * @param OutputInterface $output
+     * @return int
      * @throws \Exception
      */
     protected function execute(InputInterface $input, OutputInterface $output)
@@ -60,6 +61,7 @@ class UndeleteSiteCommand extends Command
         $rootUid = $siteController->undeleteSiteAction($org_id);
 
         $io->success(sprintf("The website with root uid " . $rootUid . " has been restored"));
+        return 0;
 
     }
 

+ 3 - 1
ot_admin/Classes/Command/UpdateRoutingIndexCommand.php

@@ -52,7 +52,8 @@ class UpdateRoutingIndexCommand extends Command
      *
      * @param InputInterface $input
      * @param OutputInterface $output
-     * @throws \Exception
+     * @return int
+     * @throws \TYPO3\CMS\Extbase\Object\Exception
      */
     protected function execute(InputInterface $input, OutputInterface $output)
     {
@@ -99,5 +100,6 @@ class UpdateRoutingIndexCommand extends Command
             $rootUid = $siteController->updateRoutingIndexAction($org_id);
             $io->success(sprintf("The website with root uid " . $rootUid . " routing index has been updated"));
         }
+        return 0;
     }
 }

+ 10 - 1
ot_admin/Classes/Command/UpdateSiteCommand.php

@@ -62,7 +62,15 @@ class UpdateSiteCommand extends Command
      *
      * @param InputInterface $input
      * @param OutputInterface $output
-     * @throws \Exception
+     * @return int
+     * @throws NoSuchOrganizationException
+     * @throws \Doctrine\DBAL\ConnectionException
+     * @throws \Doctrine\DBAL\DBALException
+     * @throws \Opentalent\OtCore\Exception\InvalidWebsiteConfigurationException
+     * @throws \Opentalent\OtCore\Exception\NoSuchRecordException
+     * @throws \Opentalent\OtCore\Exception\NoSuchWebsiteException
+     * @throws \TYPO3\CMS\Extbase\Object\Exception
+     * @throws \Throwable
      */
     protected function execute(InputInterface $input, OutputInterface $output)
     {
@@ -119,5 +127,6 @@ class UpdateSiteCommand extends Command
             $rootUid = $siteController->updateSiteAction($org_id);
             $io->success(sprintf("The website with root uid " . $rootUid . " has been updated"));
         }
+        return 0;
     }
 }

+ 8 - 0
ot_core/Classes/Service/OpentalentEnvService.php

@@ -0,0 +1,8 @@
+<?php
+
+namespace Opentalent\OtCore\Service;
+
+class OpentalentEnvService
+{
+
+}