Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tomáš Trávníček
doctrine-dbal
Commits
10c6bc31
Commit
10c6bc31
authored
Aug 08, 2013
by
Guilherme Blanco
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added support for namespace/schema quoting if it is a reserved keyword.
parent
aa6be84b
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
91 additions
and
54 deletions
+91
-54
composer.lock
composer.lock
+72
-53
AbstractAsset.php
lib/Doctrine/DBAL/Schema/AbstractAsset.php
+17
-0
CreateSchemaSqlCollector.php
...Doctrine/DBAL/Schema/Visitor/CreateSchemaSqlCollector.php
+2
-1
No files found.
composer.lock
View file @
10c6bc31
This diff is collapsed.
Click to expand it.
lib/Doctrine/DBAL/Schema/AbstractAsset.php
View file @
10c6bc31
...
...
@@ -95,6 +95,23 @@ abstract class AbstractAsset
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
* namespaced elements are returned as full-qualified names.
...
...
lib/Doctrine/DBAL/Schema/Visitor/CreateSchemaSqlCollector.php
View file @
10c6bc31
...
...
@@ -105,7 +105,8 @@ class CreateSchemaSqlCollector extends AbstractVisitor
*/
private
function
getNamespace
(
$asset
)
{
$namespace
=
$asset
->
getNamespaceName
()
?:
'default'
;
$namespace
=
$asset
->
getQuotedNamespaceName
(
$this
->
platform
)
?:
'default'
;
if
(
!
isset
(
$this
->
createTableQueries
[
$namespace
]))
{
$this
->
createTableQueries
[
$namespace
]
=
array
();
$this
->
createSequenceQueries
[
$namespace
]
=
array
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment