Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

[Propel] [Generator] minor fixes in SchemaReader and QuickBuilder classe... #304

Merged
merged 1 commit into from

3 participants

@hhamon
Collaborator

...s.

@willdurand
Owner

mmh it seems like our travis setup is broken.

@hhamon
Collaborator

Yes this is due to the new syntax in the .travis.yml file. The create database test statement fails because the test already exists. We should have a drop table if exists statement before to ensure the DB is recreated from scratch.

@jeremyFreeAgent

True, I saw that yesterday, the database already exists.

@jeremyFreeAgent

By the way, why sometimes it's create database et et sometimes it's create schema ?

@willdurand
Owner
@jeremyFreeAgent

Yes but the keyword database equals schema in MySQL !

@willdurand
Owner
@jeremyFreeAgent

http://dev.mysql.com/doc/refman/5.6/en/create-database.html

CREATE SCHEMA is a synonym for CREATE DATABASE.

@willdurand
Owner
@jeremyFreeAgent

True, I was asking because the travis config is based on MySQL. I was just wondering... :D

@jeremyFreeAgent

@hhamon you need to push again in order to run again travis build test :(

@hhamon
Collaborator

Rebased on top of master

@jeremyFreeAgent

Yeah ! Good to merge !

@willdurand willdurand merged commit bc1ea20 into from
@willdurand
Owner

Thank you, and then again, sorry for the delay.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
View
8 src/Propel/Generator/Builder/Util/SchemaReader.php
@@ -151,7 +151,7 @@ public function startElement($parser, $name, $attributes)
switch ($name) {
case 'database':
if ($this->isExternalSchema()) {
- $this->currentPackage = @$attributes['package'];
+ $this->currentPackage = isset($attributes['package']) ? $attributes['package'] : null;
if (null === $this->currentPackage) {
$this->currentPackage = $this->defaultPackage;
}
@@ -166,16 +166,16 @@ public function startElement($parser, $name, $attributes)
} elseif ('database' === $parentTag) {
switch ($name) {
case 'external-schema':
- $xmlFile = @$attributes['filename'];
+ $xmlFile = isset($attributes['filename']) ? $attributes['filename'] : null;
// 'referenceOnly' attribute is valid in the main schema XML file only,
// and it's ignored in the nested external-schemas
if (!$this->isExternalSchema()) {
- $isForRefOnly = @$attributes['referenceOnly'];
+ $isForRefOnly = isset($attributes['referenceOnly']) ? $attributes['referenceOnly'] : null;
$this->isForReferenceOnly = (null !== $isForRefOnly ? ('true' === strtolower($isForRefOnly)) : true); // defaults to TRUE
}
- if ($xmlFile{0} !== '/') {
+ if ('/' !== $xmlFile{0}) {
$xmlFile = realpath(dirname($this->currentXmlFile) . DIRECTORY_SEPARATOR . $xmlFile);
if (!file_exists($xmlFile)) {
throw new SchemaException(sprintf('Unknown include external "%s"', $xmlFile));
View
4 src/Propel/Generator/Util/QuickBuilder.php
@@ -21,8 +21,6 @@
use Propel\Runtime\Connection\ConnectionWrapper;
use Propel\Runtime\Connection\StatementInterface;
-use \PDO;
-
class QuickBuilder
{
protected $schema, $platform, $config, $database;
@@ -103,7 +101,7 @@ public function build($dsn = null, $user = null, $pass = null, $adapter = null,
}
$pdo = new PdoConnection($dsn, $user, $pass);
$con = new ConnectionWrapper($pdo);
- $con->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
+ $con->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_WARNING);
$this->buildSQL($con);
$this->buildClasses($classTargets);
$name = $this->getDatabase()->getName();
Something went wrong with that request. Please try again.