From ced1d1dc37c955caadc647f86d37430a01c075c0 Mon Sep 17 00:00:00 2001 From: Shyim Date: Wed, 25 Apr 2018 17:55:06 +0200 Subject: [PATCH] Added support for custom nginx reload command --- config/services.yaml | 1 + src/Command/CronRunnerCommand.php | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/config/services.yaml b/config/services.yaml index b12d0c4..5f76473 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -4,6 +4,7 @@ parameters: locale: 'en' appHost: '%env(APP_HOST)%' nginxFolder: '%env(NGINX_CONFIG_DIR)%' + nginxRestartCommand: '%env(NGINX_RESTART_COMMAND)%' services: # default configuration for services in *this* file diff --git a/src/Command/CronRunnerCommand.php b/src/Command/CronRunnerCommand.php index cdd26fd..50889b7 100644 --- a/src/Command/CronRunnerCommand.php +++ b/src/Command/CronRunnerCommand.php @@ -8,13 +8,17 @@ use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Style\SymfonyStyle; +use Symfony\Component\DependencyInjection\ContainerAwareInterface; +use Symfony\Component\DependencyInjection\ContainerAwareTrait; /** * Class CronRunnerCommand * @author Soner Sayakci */ -class CronRunnerCommand extends Command +class CronRunnerCommand extends Command implements ContainerAwareInterface { + use ContainerAwareTrait; + /** * @var Connection */ @@ -59,7 +63,7 @@ class CronRunnerCommand extends Command { if ($this->connection->fetchColumn('SELECT 1 FROM queue')) { $this->configGenerator->generate(); - system('systemctl reload nginx-rtmp'); + system($this->container->getParameter('nginxRestartCommand')); $io = new SymfonyStyle($input, $output); $io->success('Configs generated, rtmp has been reloaded');