Exemple #1
0
 private function performOperation($method, $matches, $arguments)
 {
     try {
         $return = $this->driver->{$method}($arguments[0]);
         Yentu::announce($matches['command'], $matches['item_type'], $arguments[0]);
         $this->driver->setDumpQuery(false);
         ClearIce::pushOutputLevel(ClearIce::OUTPUT_LEVEL_0);
         $this->driver->query('INSERT INTO yentu_history(session, version, method, arguments, migration, default_schema) VALUES (?,?,?,?,?,?)', array($this->session, $this->version, $method, json_encode($arguments), $this->migration, self::$defaultSchema));
         ClearIce::popOutputLevel();
         $this->changes++;
         $this->driver->setDisableQuery(false);
     } catch (\yentu\exceptions\DatabaseManipulatorException $e) {
         if ($this->skipOnErrors) {
             ClearIce::output("E");
             ClearIce::output("rror " . preg_replace("/([a-z])([A-Z])/", "\$1 \$2", $matches['item_type']) . " '" . $arguments[0]['name'] . "'\n", ClearIce::OUTPUT_LEVEL_2);
         } else {
             throw $e;
         }
     }
     return $return;
 }