Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[Propel] [Generator] minor fixes in SchemaReader and QuickBuilder cla…

…sses.
  • Loading branch information...
commit b61497fefa96448591fc642a7cb8bdc5ebc05bab 1 parent 18a073e
@hhamon authored
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();
Please sign in to comment.
Something went wrong with that request. Please try again.