debut d'un system d'execution de command à la volet
This commit is contained in:
parent
9c0b1b3280
commit
9b5aae23b2
|
@ -22,6 +22,7 @@ class PurgeFileCommand extends Command
|
||||||
private $output;
|
private $output;
|
||||||
private $filesystem;
|
private $filesystem;
|
||||||
private $rootlog;
|
private $rootlog;
|
||||||
|
private $byexec;
|
||||||
|
|
||||||
protected function configure()
|
protected function configure()
|
||||||
{
|
{
|
||||||
|
@ -31,6 +32,7 @@ class PurgeFileCommand extends Command
|
||||||
->setHelp('This command Purge the obsolete Files')
|
->setHelp('This command Purge the obsolete Files')
|
||||||
->addArgument('cronid', InputArgument::OPTIONAL, 'ID Cron Job')
|
->addArgument('cronid', InputArgument::OPTIONAL, 'ID Cron Job')
|
||||||
->addArgument('lastchance', InputArgument::OPTIONAL, 'Lastchance to run the cron')
|
->addArgument('lastchance', InputArgument::OPTIONAL, 'Lastchance to run the cron')
|
||||||
|
->addArgument('byexec', InputArgument::OPTIONAL, 'By Cron:Exec')
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,6 +45,11 @@ class PurgeFileCommand extends Command
|
||||||
$this->rootlog = $this->container->get('kernel')->getRootDir()."/../var/logs/";
|
$this->rootlog = $this->container->get('kernel')->getRootDir()."/../var/logs/";
|
||||||
$alias = $this->container->getParameter('alias');
|
$alias = $this->container->getParameter('alias');
|
||||||
|
|
||||||
|
// Le script est-il executé via Cron:Exec
|
||||||
|
$this->byexec = $input->getArgument('byexec');
|
||||||
|
if($this->byexec=="") $this->byexec=false;
|
||||||
|
echo "pouet".$this->byexec;
|
||||||
|
|
||||||
$this->writelnred('');
|
$this->writelnred('');
|
||||||
$this->writelnred('== Core:PurgeFile');
|
$this->writelnred('== Core:PurgeFile');
|
||||||
$this->writelnred('==========================================================================================================');
|
$this->writelnred('==========================================================================================================');
|
||||||
|
@ -368,9 +375,11 @@ class PurgeFileCommand extends Command
|
||||||
private function writelnred($string) {
|
private function writelnred($string) {
|
||||||
$this->output->writeln('<fg=red>'.$string.'</>');
|
$this->output->writeln('<fg=red>'.$string.'</>');
|
||||||
$this->filesystem->appendToFile($this->rootlog.'cron.log', $string."\n");
|
$this->filesystem->appendToFile($this->rootlog.'cron.log', $string."\n");
|
||||||
|
if($this->byexec) $this->filesystem->appendToFile($this->rootlog.'exec.log', $string."\n");
|
||||||
}
|
}
|
||||||
private function writeln($string) {
|
private function writeln($string) {
|
||||||
$this->output->writeln($string);
|
$this->output->writeln($string);
|
||||||
$this->filesystem->appendToFile($this->rootlog.'cron.log', $string."\n");
|
$this->filesystem->appendToFile($this->rootlog.'cron.log', $string."\n");
|
||||||
|
if($this->byexec) $this->filesystem->appendToFile($this->rootlog.'exec.log', $string."\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@ INSERT IGNORE INTO `niveau01` (`id`, `label`, `siren`) VALUES
|
||||||
(-100, 'DRAAF', '130007107');
|
(-100, 'DRAAF', '130007107');
|
||||||
|
|
||||||
INSERT IGNORE INTO `user` (`id`, `niveau01_id`, `username`, `firstname`, `lastname`, `password`, `email`, `avatar`, `role`,`siren`,`authlevel`) VALUES
|
INSERT IGNORE INTO `user` (`id`, `niveau01_id`, `username`, `firstname`, `lastname`, `password`, `email`, `avatar`, `role`,`siren`,`authlevel`) VALUES
|
||||||
(-100, -100, 'admin', 'Administrateur', 'draaf', '{SSHA}9tH17tlC86xamslwYLnhF4qiMaQqvbuL
|
(-100, -100, 'admin', 'Administrateur', 'draaf', '{SSHA}qrzhXan0+OWTmbHaEIPKrny4REUw0YhM
|
||||||
', 'admin@ldapbundle.ac-arno.fr', 'admin.jpg', 'ROLE_ADMIN', '130007107', 'simple');
|
', 'admin@ldapbundle.ac-arno.fr', 'admin.jpg', 'ROLE_ADMIN', '130007107', 'simple');
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ class MailCommand extends ContainerAwareCommand
|
||||||
$this->filesystem = new Filesystem();
|
$this->filesystem = new Filesystem();
|
||||||
$this->rootlog = $this->container->get('kernel')->getRootDir()."/../var/logs/";
|
$this->rootlog = $this->container->get('kernel')->getRootDir()."/../var/logs/";
|
||||||
|
|
||||||
$mailer_host = $this->getContainer()->getParameter('cron_activate');
|
$mailer_host = $this->getContainer()->getParameter('mailer_host');
|
||||||
|
|
||||||
$this->writelnred('');
|
$this->writelnred('');
|
||||||
$this->writelnred('== Cron:Mail');
|
$this->writelnred('== Cron:Mail');
|
||||||
|
|
Loading…
Reference in New Issue