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

Hugo Hamon William Durand Jérémy Romey
Hugo Hamon
Collaborator

...s.

William Durand
Owner

mmh it seems like our travis setup is broken.

Hugo Hamon
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.

Jérémy Romey

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

Jérémy Romey

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

William Durand
Owner
Jérémy Romey

Yes but the keyword database equals schema in MySQL !

William Durand
Owner
Jérémy Romey

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

CREATE SCHEMA is a synonym for CREATE DATABASE.

William Durand
Owner
Jérémy Romey

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

Jérémy Romey

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

Hugo Hamon
Collaborator

Rebased on top of master

Jérémy Romey

Yeah ! Good to merge !

William Durand willdurand merged commit bc1ea20 into from
William Durand
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.
8 src/Propel/Generator/Builder/Util/SchemaReader.php
View
@@ -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));
4 src/Propel/Generator/Util/QuickBuilder.php
View
@@ -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.