protected function doApply()
 {
     $dataDir = $this->dataDir->getAbsolutePath();
     $htmlDir = $this->htmlDir->getAbsolutePath();
     define('HTML_REALDIR', rtrim(realpath($htmlDir), '/\\') . '/');
     require_once HTML_REALDIR . '/define.php';
     require_once HTML_REALDIR . HTML2DATA_DIR . '/require_base.php';
     $query = SC_Query_Ex::getSingletonInstance();
     $storage = new Zeclib_DefaultMigrationStorage($query, $this->system);
     $storage->versionTable = $this->versionTable;
     $storage->containerDirectories[] = $this->containerDir->getPath();
     $migrator = new Zeclib_Migrator($storage, $query);
     $migrator->logger = new Zeclib_Phing_TaskMigrationLogger($this);
     $migrations = array();
     $versions = preg_split('/[,\\s]+/', $this->version, 0, PREG_SPLIT_NO_EMPTY);
     foreach ($versions as $version) {
         try {
             $migrations[] = $migrator->loadMigration($version);
         } catch (Zeclib_MigrationException $e) {
             $message = $e->getMessage();
             $this->log($message, Zeclib_MigrationLogger::TYPE_WARNING);
         }
     }
     $num = $migrator->apply($migrations);
     $this->log(sprintf('%d migrations are applied.', $num));
 }