public function __construct(SQLIImportHandlerOptions $options = null) { parent::__construct($options); if (isset($this->options['debug']) && $this->options['debug'] == '1') { MMSynchLog::$cli = $this->cli; MMSynchLog::$level = 4; } else { MMSynchLog::$level = 3; } $this->synchronizer = MMSynchronizer::instance(); $archive = $this->synchronizer->archive; if (isset($this->options['test']) && $this->options['test'] == '1') { $this->cli->warning('Test mode enabled : import_status not fill'); $this->synchronizer->test = true; $archive = false; } if (!$archive || isset($this->options['archive'])) { if ($this->options['archive'] == '1') { $this->cli->warning('Archiving enabled'); $archive = true; } elseif (!$archive || $this->options['archive'] == '0') { $this->cli->warning('Archiving disabled'); $archive = false; } } $this->synchronizer->archive = $archive; }
'use-session' => false, 'use-modules' => true, 'use-extensions' => true ) ); $script->startup(); $options = $script->getOptions( '[article:][force]', "", array( 'article' => 'Article Id in merck_model', 'force' => 'Force la mise à jour' )); $script->initialize(); $cli = eZCLI::instance(); MMSynchLog::$cli = $cli; MMSynchLog::$level = MMSynchLog::DEBUG; // Create lock $lockFileName = 'synch.lock'; if (file_exists($lockFileName)) { $tm = file_get_contents($lockFileName); if ($tm > (time() - (60 * 1))) { MMSynchLog::$cli->notice('== Synchronisation lock =='); $script->shutdown(); return; } } file_put_contents($lockFileName, time()); // user admin