Exemplo n.º 1
0
 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();
 }
Exemplo n.º 2
0
 public function executeSyncAjax(sfWebRequest $request)
 {
     $sync = new ServerVipSync($this->getContext()->getConfiguration());
     $sync->startSync();
     return sfView::NONE;
 }