protected function publish() { $publisher = MMSynchContentPublisher::getInstance(); $publisher->publish( $this->content ); MMSynchMonitor::inc(MMSynchMonitor::SUCCESS . ' . ' . $this->content->getRawContentObject()->contentClassIdentifier()); }
public static function stop() { self::update(); self::$start = false; self::$time_stop = time(); }
public function query( $sql, $server = false ) { MMSynchMonitor::inc(MMSynchMonitor::QUERY); $result = $this->connector->query($sql, $server); if ($this->connector->ErrorMessage) { throw new MMSynchException('Database error : ' . $this->connector->ErrorMessage); } return $result; }
{ $dataMap['media_content']->fromString(implode('-', array_unique($relatedObjectIds))); $dataMap['media_content']->store(); } } } else { $cli->warning((string) $article . ' : object not fetchable'); } } eZContentObject::clearCache(); $db->commit(); } catch(Exception $e) { $db->rollback(); $cli->error((is_object($article) ? (string) $article : '') . ' ' . $e->getMessage()); } } MMSynchMonitor::stop(); $cli->output(); // Statistics $cli->output(MMSynchMonitor::stats()); $script->shutdown();
public static function exception($object, $exception, $section = false) { if (self::ERROR <= self::$level) { $msg = sprintf('[Exception] %s on line %s in %s', $exception->getMessage(), $exception->getLine(), $exception->getFile()); eZLog::write(self::parse($object, $msg, $section) . '\n' . $exception->getTraceAsString(), self::$logname); if (self::$cli) { self::$cli->error(self::parse($object, $msg, $section)); } MMSynchMonitor::inc(MMSynchMonitor::EXCEPTION); } self::startSection($section); }
public function __destruct() { $this->cli->output(implode(', ', MMSynchMonitor::stats())); }
public function __construct ($message = "", $code = 0, $previous = null) { parent::__construct($message, $code, $previous); MMSynchMonitor::inc(MMSynchMonitor::EXCEPTION); }