Skip to content

Commit

Permalink
use datasource connection(buildtime-conf.xml) instead of globals (bui…
Browse files Browse the repository at this point in the history
…ld.properties) while performing datadump task
  • Loading branch information
MaksSlesarenko committed Jun 26, 2013
1 parent 5886ff7 commit 584e2a4
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions generator/lib/task/PropelDataDumpTask.php
Expand Up @@ -281,19 +281,7 @@ public function main()
$this->log("Writing to XML file: " . $outFile->getName());

try {

$url = str_replace("@DB@", $database->getName(), $this->databaseUrl);

if ($url !== $this->databaseUrl) {
$this->log("New (resolved) URL: " . $url, Project::MSG_VERBOSE);
}

if (empty($url)) {
throw new BuildException("Unable to connect to database; no PDO connection URL specified.", $this->getLocation());
}

$this->conn = new PDO($url, $this->databaseUser, $this->databasePassword);
$this->conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$this->conn = $dataModel->getGeneratorConfig()->getBuildPDO($database->getName());

$doc = $this->createXMLDoc($database);
$doc->save($outFile->getAbsolutePath());
Expand Down

0 comments on commit 584e2a4

Please sign in to comment.