コード例 #1
0
ファイル: syncTask.class.php プロジェクト: pmoutet/navinum
 protected function execute($arguments = array(), $options = array())
 {
     // initialize the database connection
     $databaseManager = new sfDatabaseManager($this->configuration);
     $connection = $databaseManager->getDatabase($options['connection'])->getConnection();
     /*
     if($options['include'] != "" && $options['exclude'] != "")
     {
       throw new Exception("Only one option is authorized");
     }
     */
     if ($options['include'] != "") {
         $to_replace = split(",", $options['include']);
         sfConfig::set('app_sync_tables', $to_replace);
     }
     if ($options['exclude'] != "") {
         $tables = sfConfig::get('app_sync_tables');
         $excludes = split(",", $options['exclude']);
         foreach ($excludes as $exclude) {
             if (($key = array_search($exclude, $tables)) !== false) {
                 unset($tables[$key]);
             }
         }
         sfConfig::set('app_sync_tables', $tables);
     }
     $sync = new ServerVipSync($this->configuration);
     $sync->startSync();
 }
コード例 #2
0
ファイル: actions.class.php プロジェクト: pmoutet/navinum
 public function executeSyncAjax(sfWebRequest $request)
 {
     $sync = new ServerVipSync($this->getContext()->getConfiguration());
     $sync->startSync();
     return sfView::NONE;
 }