partkeepr

fork of partkeepr
git clone https://git.e1e0.net/partkeepr.git
Log | Files | Refs | Submodules | README | LICENSE

commit 3f0af94af48f47731a815148b10e6a17e39bb0c9
parent 34740599f4141cd21f61eb88f34f0919e1fe2975
Author: Felicitus <felicitus@felicitus.org>
Date:   Sat,  7 Nov 2015 20:49:46 +0100

Mark crons as run

Diffstat:
Msrc/PartKeepr/CoreBundle/Command/CheckForUpdatesCommand.php | 3++-
Msrc/PartKeepr/CronLoggerBundle/Entity/CronLogger.php | 1+
Msrc/PartKeepr/StatisticBundle/Command/CreateStatisticSnapshotCommand.php | 4++--
Asrc/PartKeepr/TipOfTheDayBundle/Command/SyncTipsCommand.php | 24++++++++++++++++++++++++
Dsrc/PartKeepr/TipOfTheDayBundle/Console/Command/SyncTipsCommand.php | 24------------------------
Msrc/PartKeepr/TipOfTheDayBundle/PartKeeprTipOfTheDayBundle.php | 2+-
Msrc/PartKeepr/TipOfTheDayBundle/Services/TipOfTheDayService.php | 2--
7 files changed, 30 insertions(+), 30 deletions(-)

diff --git a/src/PartKeepr/CoreBundle/Command/CheckForUpdatesCommand.php b/src/PartKeepr/CoreBundle/Command/CheckForUpdatesCommand.php @@ -10,12 +10,13 @@ class CheckForUpdatesCommand extends ContainerAwareCommand public function configure() { parent::configure(); - $this->setName('partkeepr:update-check'); + $this->setName('partkeepr:cron:versioncheck'); $this->setDescription("Checks for PartKeepr updates"); } public function execute(InputInterface $input, OutputInterface $output) { $this->getContainer()->get("partkeepr.versionservice")->doVersionCheck(); + $this->getContainer()->get("partkeepr.cronlogger_service")->markCronRun("partkeepr:cron:versioncheck"); } } diff --git a/src/PartKeepr/CronLoggerBundle/Entity/CronLogger.php b/src/PartKeepr/CronLoggerBundle/Entity/CronLogger.php @@ -7,6 +7,7 @@ use PartKeepr\CoreBundle\Entity\BaseEntity; /** * Holds a project attachment * + * @ORM\Table(uniqueConstraints={@ORM\UniqueConstraint(name="cronjob", columns={"cronjob"})}) * @ORM\Entity **/ class CronLogger extends BaseEntity diff --git a/src/PartKeepr/StatisticBundle/Command/CreateStatisticSnapshotCommand.php b/src/PartKeepr/StatisticBundle/Command/CreateStatisticSnapshotCommand.php @@ -10,13 +10,13 @@ class CreateStatisticSnapshotCommand extends ContainerAwareCommand public function configure() { parent::configure(); - $this->setName('partkeepr:statistics:create-snapshot'); + $this->setName('partkeepr:cron:create-statistic-snapshot'); $this->setDescription("Creates a statistic snapshot"); } public function execute(InputInterface $input, OutputInterface $output) { $this->getContainer()->get("partkeepr.statistic.service")->createStatisticSnapshot(); - + $this->getContainer()->get("partkeepr.cronlogger_service")->markCronRun("partkeepr:cron:create-statistic-snapshot"); } } diff --git a/src/PartKeepr/TipOfTheDayBundle/Command/SyncTipsCommand.php b/src/PartKeepr/TipOfTheDayBundle/Command/SyncTipsCommand.php @@ -0,0 +1,24 @@ +<?php +namespace PartKeepr\TipOfTheDayBundle\Command; + +use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; + + +class SyncTipsCommand extends ContainerAwareCommand +{ + protected function configure() + { + $this + ->setName('partkeepr:cron:synctips') + ->setDescription('Syncronizes the tips from the PartKeepr website'); + } + + protected function execute(InputInterface $input, OutputInterface $output) + { + $this->getContainer()->get("partkeepr.tip_of_the_day_service")->syncTips(); + $this->getContainer()->get("partkeepr.cronlogger_service")->markCronRun("partkeepr:cron:synctips"); + } + +} diff --git a/src/PartKeepr/TipOfTheDayBundle/Console/Command/SyncTipsCommand.php b/src/PartKeepr/TipOfTheDayBundle/Console/Command/SyncTipsCommand.php @@ -1,24 +0,0 @@ -<?php -namespace PartKeepr\TipOfTheDayBundle\Console\Command; - -use PartKeepr\AuthBundle\Entity\User; -use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; - - -class SyncTipsCommand extends ContainerAwareCommand -{ - protected function configure() - { - $this - ->setName('partkeepr:cron:synctips') - ->setDescription('Syncronizes the tips from the PartKeepr website'); - } - - protected function execute(InputInterface $input, OutputInterface $output) - { - $this->getContainer()->get("partkeepr.tip_of_the_day_service")->syncTips(); - } - -} diff --git a/src/PartKeepr/TipOfTheDayBundle/PartKeeprTipOfTheDayBundle.php b/src/PartKeepr/TipOfTheDayBundle/PartKeeprTipOfTheDayBundle.php @@ -1,7 +1,7 @@ <?php namespace PartKeepr\TipOfTheDayBundle; -use PartKeepr\TipOfTheDayBundle\Console\Command\SyncTipsCommand; +use PartKeepr\TipOfTheDayBundle\Command\SyncTipsCommand; use Symfony\Component\Console\Application; use Symfony\Component\HttpKernel\Bundle\Bundle; diff --git a/src/PartKeepr/TipOfTheDayBundle/Services/TipOfTheDayService.php b/src/PartKeepr/TipOfTheDayBundle/Services/TipOfTheDayService.php @@ -52,8 +52,6 @@ class TipOfTheDayService $aPageNames = $this->extractPageNames($tipsString); $this->updateTipDatabase($aPageNames); - - $this->cronLoggerService->markCronRun("partkeepr:cron:synctips"); } /**