/**
  * Costruttore
  */
 public function __construct(SQLIImportHandlerOptions $options = null)
 {
     $this->curLog = ObjectController::get();
     try {
         parent::__construct($options);
         $this->curLog->ocLoggerUtil->addInfoMessage('---------------------------');
         $this->curLog->ocLoggerUtil->addInfoMessage('ITTematicaSyncHandler - Enter');
         $this->controller = new ITTematicaSyncController($options);
         $this->curLog->ocLoggerUtil->writeLogs();
     } catch (Exception $ex) {
         $this->curLog->ocLoggerUtil->addErrorMessage('Error in ITTematicaSyncHandler - construct: ' . $ex->getMessage());
         $this->curLog->ocLoggerUtil->writeLogs();
         echo 'Got Exception on ITTematicaSyncHandler - initialize: ' . $ex->getMessage() . "\n";
     }
 }
    /**
     * @param SQLIImportHandlerOptions $options
     */
    public function __construct( SQLIImportHandlerOptions $options = null )
    {
        parent::__construct( $options );

        $ftpFolder       = 'oscar1';
        $modeUAT         = false;
        $this->startDate = microtime( true );

        if ( $this->importINI->hasVariable( 'XMLImportSettings', 'ModeUAT' )
             && $this->importINI->variable( 'XMLImportSettings', 'ModeUAT' ) == 'enabled' )
        {
            $modeUAT = true;
        }

        if ( is_object($this->options) )
        {
            if ( $this->options->hasAttribute( 'reportLevel' ) && is_numeric($reportLevel = $this->options->attribute( 'reportLevel' )) )
                XMLImportMonitor::setReportLevel( $reportLevel );

            if ( $this->options->hasAttribute( 'ftpFolder' ) && in_array($this->options->attribute( 'ftpFolder' ),array('oscar1','oscar2') ) )
                $ftpFolder = $this->options->attribute( 'ftpFolder' );
        }

        $this->rootImportFolder = $ftpFolder;

        // Initialize sqliImportItem Statistics and logs
        XMLImportDB::init( $this->importINI );
        XMLImportMapping::init( $this->importINI );
        eZLog::setMaxLogSize( 2000000 );
        eZLog::setLogrotateFiles( 20 );
        XMLImportMonitor::setOrigin($ftpFolder);
        XMLImportMonitor::setSQLiImportItem( $this->getCurrentSQLiImportItem() );
        XMLImportMonitor::pushStatistic( 'start_date', time() );

        $this->fileHandler = XMLImportFileHandler::instance($this->importINI, $ftpFolder, $modeUAT);
        XMLImportDataHandler::setIni ( $this->importINI );
        XMLImportDataHandler::setFileHandler ( $this->fileHandler );
    }
Esempio n. 3
0
    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;
    }
 /**
  * Constructor
  */
 public function __construct(SQLIImportHandlerOptions $options = null)
 {
     parent::__construct($options);
     $this->remoteIDPrefix = $this->getHandlerIdentifier() . '-';
     $this->currentRemoteIDPrefix = $this->remoteIDPrefix;
 }
 /**
  * Constructor
  */
 public function __construct(SQLIImportHandlerOptions $options = null)
 {
     parent::__construct($options);
     $this->tagController = new TagController($options);
 }
 public function __construct(SQLIImportHandlerOptions $options = null)
 {
     parent::__construct($options);
     $this->synchronizer = MMSynchronizer::instance();
 }