66use Shopware \Core \Content \ImportExport \Message \DeleteFileMessage as DeleteImportExportFile ;
77use Shopware \Core \Content \Media \Message \DeleteFileMessage ;
88use Shopware \Core \Content \Media \Message \GenerateThumbnailsMessage ;
9+ use Shopware \Core \DevOps \Environment \EnvironmentHelper ;
910use Shopware \Core \Framework \DataAbstractionLayer \Indexing \EntityIndexingMessage ;
1011use Shopware \Core \Framework \DataAbstractionLayer \Indexing \MessageQueue \IterateEntityIndexerMessage ;
1112use Shopware \Core \Framework \MessageQueue \ScheduledTask \ScheduledTask ;
@@ -29,7 +30,7 @@ public function __construct(LoggerInterface $logger)
2930
3031 public function handle (Envelope $ envelope , StackInterface $ stack ): Envelope
3132 {
32- $ taskLogging = (bool ) ( $ _SERVER [ 'FROSH_TOOLS_TASK_LOGGING ' ] ?? '0 ' );
33+ $ taskLogging = (bool ) EnvironmentHelper:: getVariable ( 'FROSH_TOOLS_TASK_LOGGING ' , '0 ' );
3334 if ($ taskLogging === false ) {
3435 return $ stack ->next ()->handle ($ envelope , $ stack );
3536 }
@@ -59,7 +60,7 @@ private function getTaskName(object $message): string
5960 $ classParts = explode ('\\' , get_class ($ message ));
6061 $ taskName = end ($ classParts );
6162
62- if (substr ($ taskName , - 7 ) === 'Message ' ) {
63+ if (str_ends_with ($ taskName , 'Message ' ) ) {
6364 $ taskName = substr ($ taskName , 0 , -7 );
6465 }
6566
@@ -112,7 +113,7 @@ private function logTaskProcessing(string $taskName, array $args, $start): void
112113 return ;
113114 }
114115
115- $ taskLoggingInfo = (bool ) ( $ _SERVER [ 'FROSH_TOOLS_TASK_LOGGING_INFO ' ] ?? '0 ' );
116+ $ taskLoggingInfo = (bool ) EnvironmentHelper:: getVariable ( 'FROSH_TOOLS_TASK_LOGGING_INFO ' , '0 ' );
116117 if ($ taskLoggingInfo ) {
117118 $ this ->logger ->info ($ taskName , $ args );
118119 }
0 commit comments