doctrine.migration.patch

Peter Russ, 2012-08-08 10:06

Download (35.7 KB)

View differences:

_flow3/Packages/Framework/TYPO3.FLOW3/Classes/Persistence/Doctrine/Service.php (revision )
150 150
	}
151 151

  
152 152
	/**
153
	 * COREPATCH Telekom
154
	 * by Peter Russ <peter.russ@telekom.de>
155
	 * 08.08.2012: protected -> public
156
	 */
157
	/**
153 158
	 * Return the configuration needed for Migrations.
154 159
	 *
155 160
	 * @return \Doctrine\DBAL\Migrations\Configuration\Configuration
156 161
	 */
157
	protected function getMigrationConfiguration() {
162
	public function getMigrationConfiguration() {
158 163
		$this->output = array();
159 164
		$that = $this;
160 165
		$outputWriter = new \Doctrine\DBAL\Migrations\OutputWriter(
......
183 188

  
184 189
		return $configuration;
185 190
	}
191
	/**
192
	 * end COREPATCH
193
	 */
186 194

  
187 195
	/**
188 196
	 * Returns the current migration status formatted as plain text.
_flow3/Packages/Framework/TYPO3.FLOW3/Classes/Command/DoctrineCommandController.php (revision )
297 297
	}
298 298

  
299 299
	/**
300
	 * COREPATCH Telekom
301
	 * by Peter Russ <peter.russ@telekom.de>
302
	 * 08.08.2012: extended to output current version if no version argument is provided
303
	 */
304
	/**
300 305
	 * Mark/unmark a migration as migrated
301 306
	 *
302 307
	 * If <u>all</u> is given as version, all available migrations are marked
303 308
	 * as requested.
304 309
	 *
310
	 * If none is provided the current version will be displayed
311
	 *
305 312
	 * @param string $version The migration to execute
306 313
	 * @param boolean $add The migration to mark as migrated
307 314
	 * @param boolean $delete The migration to mark as not migrated
......
312 319
	 * @see typo3.flow3:doctrine:migrationexecute
313 320
	 * @see typo3.flow3:doctrine:migrationgenerate
314 321
	 */
315
	public function migrationVersionCommand($version, $add = FALSE, $delete = FALSE) {
322
	public function migrationVersionCommand($version = FALSE, $add = FALSE, $delete = FALSE) {
316 323
			// "driver" is used only for Doctrine, thus we (mis-)use it here
317 324
			// additionally, when no path is set, skip this step, assuming no DB is needed
325
		if ($version === FALSE) {
326
			$this->outputLine($this->doctrineService->getMigrationConfiguration()->getCurrentVersion());
327
			$this->quit();
328
		}
318 329
		if ($this->settings['backendOptions']['driver'] !== NULL && $this->settings['backendOptions']['host'] !== NULL) {
319 330
			if ($add === FALSE && $delete === FALSE) {
320 331
				throw new \InvalidArgumentException('You must specify whether you want to --add or --delete the specified version.');
......
325 336
			$this->quit(1);
326 337
		}
327 338
	}
339
	/**
340
	 * end COREPATCH
341
	 */
328 342

  
329 343
	/**
330 344
	 * Generate a new migration