Skip to content
Snippets Groups Projects
Select Git revision
  • 91bda6735716ae18135d462b35b587bdb2ea8c66
  • master default
  • php84
  • 5.x
  • 6.1.4
  • 6.1.3
  • 6.1.2
  • 6.1.1
  • 6.1.0
  • 6.0.6
  • 6.0.5
  • 6.0.4
  • 6.0.3
  • 6.0.2
  • 5.0.1
  • 5.0.0
  • 6.0.1
  • 6.0.0
  • 0.0.1
19 results

SynchronisationConsoleController.php

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    SynchronisationConsoleController.php 1.05 KiB
    <?php
    
    namespace UnicaenSynchro\Controller;
    
    use Unicaen\Console\Controller\AbstractConsoleController;
    use UnicaenSynchro\Service\Synchronisation\SynchronisationServiceAwareTrait;
    
    class SynchronisationConsoleController extends AbstractConsoleController {
        use SynchronisationServiceAwareTrait;
    
        private array $configs;
    
        public function setConfigs(array $configs) : void
        {
            $this->configs = $configs;
        }
    
        public function synchroniserAllAction() : string
        {
            // todo utiliser l'ordre pour executer les synchros dans le bon sens
            $jobs = $this->configs;
    //        usort($works, function ($a,$b) { return $a['order'] > $b['order'];});
            foreach ($jobs as $name => $job) {
                echo $this->getSynchronisationService()->synchronise($name);
            }
            return "done!\n";
        }
    
        public function synchroniserAction() : string
        {
            $request = $this->getRequest();
            $name = $request->getParam('name');
            echo $this->getSynchronisationService()->synchronise($name);
            return "done!\n";
        }
    }