Commit 10c6bc31 authored by Guilherme Blanco's avatar Guilherme Blanco

Added support for namespace/schema quoting if it is a reserved keyword.

parent aa6be84b
...@@ -7,16 +7,16 @@ ...@@ -7,16 +7,16 @@
"packages": [ "packages": [
{ {
"name": "doctrine/annotations", "name": "doctrine/annotations",
"version": "v1.1.1", "version": "v1.1.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/doctrine/annotations.git", "url": "https://github.com/doctrine/annotations.git",
"reference": "v1.1.1" "reference": "v1.1.2"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/doctrine/annotations/zipball/v1.1.1", "url": "https://api.github.com/repos/doctrine/annotations/zipball/v1.1.2",
"reference": "v1.1.1", "reference": "v1.1.2",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
{ {
"name": "Johannes Schmitt", "name": "Johannes Schmitt",
"email": "schmittjoh@gmail.com", "email": "schmittjoh@gmail.com",
"homepage": "https://github.com/schmittjoh", "homepage": "http://jmsyst.com",
"role": "Developer of wrapped JMSSerializerBundle" "role": "Developer of wrapped JMSSerializerBundle"
} }
], ],
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
"docblock", "docblock",
"parser" "parser"
], ],
"time": "2013-04-20 08:30:17" "time": "2013-06-16 21:33:03"
}, },
{ {
"name": "doctrine/cache", "name": "doctrine/cache",
...@@ -191,7 +191,7 @@ ...@@ -191,7 +191,7 @@
{ {
"name": "Johannes Schmitt", "name": "Johannes Schmitt",
"email": "schmittjoh@gmail.com", "email": "schmittjoh@gmail.com",
"homepage": "https://github.com/schmittjoh", "homepage": "http://jmsyst.com",
"role": "Developer of wrapped JMSSerializerBundle" "role": "Developer of wrapped JMSSerializerBundle"
} }
], ],
...@@ -206,16 +206,16 @@ ...@@ -206,16 +206,16 @@
}, },
{ {
"name": "doctrine/common", "name": "doctrine/common",
"version": "2.4.0-RC2", "version": "2.4.0-RC4",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/doctrine/common.git", "url": "https://github.com/doctrine/common.git",
"reference": "2.4.0-RC2" "reference": "2.4.0-RC4"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/doctrine/common/zipball/2.4.0-RC2", "url": "https://api.github.com/repos/doctrine/common/zipball/2.4.0-RC4",
"reference": "2.4.0-RC2", "reference": "2.4.0-RC4",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
...@@ -263,7 +263,7 @@ ...@@ -263,7 +263,7 @@
{ {
"name": "Johannes Schmitt", "name": "Johannes Schmitt",
"email": "schmittjoh@gmail.com", "email": "schmittjoh@gmail.com",
"homepage": "https://github.com/schmittjoh", "homepage": "http://jmsyst.com",
"role": "Developer of wrapped JMSSerializerBundle" "role": "Developer of wrapped JMSSerializerBundle"
} }
], ],
...@@ -276,7 +276,7 @@ ...@@ -276,7 +276,7 @@
"persistence", "persistence",
"spl" "spl"
], ],
"time": "2013-05-09 21:35:24" "time": "2013-06-21 12:11:28"
}, },
{ {
"name": "doctrine/inflector", "name": "doctrine/inflector",
...@@ -397,16 +397,16 @@ ...@@ -397,16 +397,16 @@
"packages-dev": [ "packages-dev": [
{ {
"name": "phpunit/php-code-coverage", "name": "phpunit/php-code-coverage",
"version": "1.2.9", "version": "1.2.12",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/php-code-coverage.git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git",
"reference": "1.2.9" "reference": "1.2.12"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/1.2.9", "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/1.2.12",
"reference": "1.2.9", "reference": "1.2.12",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
...@@ -415,11 +415,19 @@ ...@@ -415,11 +415,19 @@
"phpunit/php-text-template": ">=1.1.1@stable", "phpunit/php-text-template": ">=1.1.1@stable",
"phpunit/php-token-stream": ">=1.1.3@stable" "phpunit/php-token-stream": ">=1.1.3@stable"
}, },
"require-dev": {
"phpunit/phpunit": "3.7.*@dev"
},
"suggest": { "suggest": {
"ext-dom": "*", "ext-dom": "*",
"ext-xdebug": ">=2.0.5" "ext-xdebug": ">=2.0.5"
}, },
"type": "library", "type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.2.x-dev"
}
},
"autoload": { "autoload": {
"classmap": [ "classmap": [
"PHP/" "PHP/"
...@@ -446,7 +454,7 @@ ...@@ -446,7 +454,7 @@
"testing", "testing",
"xunit" "xunit"
], ],
"time": "2013-02-26 18:55:56" "time": "2013-07-06 06:26:16"
}, },
{ {
"name": "phpunit/php-file-iterator", "name": "phpunit/php-file-iterator",
...@@ -539,16 +547,16 @@ ...@@ -539,16 +547,16 @@
}, },
{ {
"name": "phpunit/php-timer", "name": "phpunit/php-timer",
"version": "1.0.4", "version": "1.0.5",
"source": { "source": {
"type": "git", "type": "git",
"url": "git://github.com/sebastianbergmann/php-timer.git", "url": "https://github.com/sebastianbergmann/php-timer.git",
"reference": "1.0.4" "reference": "1.0.5"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://github.com/sebastianbergmann/php-timer/zipball/1.0.4", "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/1.0.5",
"reference": "1.0.4", "reference": "1.0.5",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
...@@ -575,24 +583,24 @@ ...@@ -575,24 +583,24 @@
} }
], ],
"description": "Utility class for timing", "description": "Utility class for timing",
"homepage": "http://www.phpunit.de/", "homepage": "https://github.com/sebastianbergmann/php-timer/",
"keywords": [ "keywords": [
"timer" "timer"
], ],
"time": "2012-10-11 04:45:58" "time": "2013-08-02 07:42:54"
}, },
{ {
"name": "phpunit/php-token-stream", "name": "phpunit/php-token-stream",
"version": "1.1.5", "version": "1.2.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "git://github.com/sebastianbergmann/php-token-stream.git", "url": "https://github.com/sebastianbergmann/php-token-stream.git",
"reference": "1.1.5" "reference": "1.2.0"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://github.com/sebastianbergmann/php-token-stream/zipball/1.1.5", "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/1.2.0",
"reference": "1.1.5", "reference": "1.2.0",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
...@@ -600,6 +608,11 @@ ...@@ -600,6 +608,11 @@
"php": ">=5.3.3" "php": ">=5.3.3"
}, },
"type": "library", "type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.2-dev"
}
},
"autoload": { "autoload": {
"classmap": [ "classmap": [
"PHP/" "PHP/"
...@@ -620,24 +633,24 @@ ...@@ -620,24 +633,24 @@
} }
], ],
"description": "Wrapper around PHP's tokenizer extension.", "description": "Wrapper around PHP's tokenizer extension.",
"homepage": "http://www.phpunit.de/", "homepage": "https://github.com/sebastianbergmann/php-token-stream/",
"keywords": [ "keywords": [
"tokenizer" "tokenizer"
], ],
"time": "2012-10-11 04:47:14" "time": "2013-08-04 05:57:48"
}, },
{ {
"name": "phpunit/phpunit", "name": "phpunit/phpunit",
"version": "3.7.19", "version": "3.7.23",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git", "url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "3.7.19" "reference": "3.7.23"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/3.7.19", "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/3.7.23",
"reference": "3.7.19", "reference": "3.7.23",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
...@@ -646,12 +659,12 @@ ...@@ -646,12 +659,12 @@
"ext-reflection": "*", "ext-reflection": "*",
"ext-spl": "*", "ext-spl": "*",
"php": ">=5.3.3", "php": ">=5.3.3",
"phpunit/php-code-coverage": ">=1.2.1,<1.3.0", "phpunit/php-code-coverage": "~1.2.1",
"phpunit/php-file-iterator": ">=1.3.1", "phpunit/php-file-iterator": ">=1.3.1",
"phpunit/php-text-template": ">=1.1.1", "phpunit/php-text-template": ">=1.1.1",
"phpunit/php-timer": ">=1.0.2,<1.1.0", "phpunit/php-timer": ">=1.0.4",
"phpunit/phpunit-mock-objects": ">=1.2.0,<1.3.0", "phpunit/phpunit-mock-objects": "~1.2.0",
"symfony/yaml": ">=2.0.0,<2.3.0" "symfony/yaml": "~2.0"
}, },
"require-dev": { "require-dev": {
"pear-pear/pear": "1.9.4" "pear-pear/pear": "1.9.4"
...@@ -698,7 +711,7 @@ ...@@ -698,7 +711,7 @@
"testing", "testing",
"xunit" "xunit"
], ],
"time": "2013-03-25 11:45:06" "time": "2013-08-02 19:14:44"
}, },
{ {
"name": "phpunit/phpunit-mock-objects", "name": "phpunit/phpunit-mock-objects",
...@@ -751,26 +764,32 @@ ...@@ -751,26 +764,32 @@
}, },
{ {
"name": "symfony/console", "name": "symfony/console",
"version": "v2.2.1", "version": "v2.3.3",
"target-dir": "Symfony/Component/Console", "target-dir": "Symfony/Component/Console",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/Console.git", "url": "https://github.com/symfony/Console.git",
"reference": "v2.2.1" "reference": "v2.3.3"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/Console/zipball/v2.2.1", "url": "https://api.github.com/repos/symfony/Console/zipball/v2.3.3",
"reference": "v2.2.1", "reference": "v2.3.3",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=5.3.3" "php": ">=5.3.3"
}, },
"require-dev": {
"symfony/event-dispatcher": "~2.1"
},
"suggest": {
"symfony/event-dispatcher": ""
},
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "2.2-dev" "dev-master": "2.3-dev"
} }
}, },
"autoload": { "autoload": {
...@@ -794,21 +813,21 @@ ...@@ -794,21 +813,21 @@
], ],
"description": "Symfony Console Component", "description": "Symfony Console Component",
"homepage": "http://symfony.com", "homepage": "http://symfony.com",
"time": "2013-03-19 20:48:08" "time": "2013-07-21 12:12:18"
}, },
{ {
"name": "symfony/yaml", "name": "symfony/yaml",
"version": "v2.2.1", "version": "v2.3.3",
"target-dir": "Symfony/Component/Yaml", "target-dir": "Symfony/Component/Yaml",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/Yaml.git", "url": "https://github.com/symfony/Yaml.git",
"reference": "v2.2.1" "reference": "v2.3.3"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/Yaml/zipball/v2.2.1", "url": "https://api.github.com/repos/symfony/Yaml/zipball/v2.3.3",
"reference": "v2.2.1", "reference": "v2.3.3",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
...@@ -817,7 +836,7 @@ ...@@ -817,7 +836,7 @@
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "2.2-dev" "dev-master": "2.3-dev"
} }
}, },
"autoload": { "autoload": {
...@@ -841,7 +860,7 @@ ...@@ -841,7 +860,7 @@
], ],
"description": "Symfony Yaml Component", "description": "Symfony Yaml Component",
"homepage": "http://symfony.com", "homepage": "http://symfony.com",
"time": "2013-03-23 07:49:54" "time": "2013-07-21 12:12:18"
} }
], ],
"aliases": [ "aliases": [
......
...@@ -95,6 +95,23 @@ abstract class AbstractAsset ...@@ -95,6 +95,23 @@ abstract class AbstractAsset
return $this->_namespace; return $this->_namespace;
} }
/**
* Gets the quoted representation of this namespace asset but only if it was defined with one.
* Otherwise return the plain unquoted namespace value as inserted.
*
* @param \Doctrine\DBAL\Platforms\AbstractPlatform $platform
*
* @return string
*/
public function getQuotedNamespaceName(AbstractPlatform $platform)
{
$keywords = $platform->getReservedKeywordsList();
return ($this->_quoted || $keywords->isKeyword($this->_namespace))
? $platform->quoteIdentifier($this->_namespace)
: $this->_namespace;
}
/** /**
* The shortest name is stripped of the default namespace. All other * The shortest name is stripped of the default namespace. All other
* namespaced elements are returned as full-qualified names. * namespaced elements are returned as full-qualified names.
......
...@@ -105,7 +105,8 @@ class CreateSchemaSqlCollector extends AbstractVisitor ...@@ -105,7 +105,8 @@ class CreateSchemaSqlCollector extends AbstractVisitor
*/ */
private function getNamespace($asset) private function getNamespace($asset)
{ {
$namespace = $asset->getNamespaceName() ?: 'default'; $namespace = $asset->getQuotedNamespaceName($this->platform) ?: 'default';
if ( !isset($this->createTableQueries[$namespace])) { if ( !isset($this->createTableQueries[$namespace])) {
$this->createTableQueries[$namespace] = array(); $this->createTableQueries[$namespace] = array();
$this->createSequenceQueries[$namespace] = array(); $this->createSequenceQueries[$namespace] = array();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment