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
5a46f577
Commit
5a46f577
authored
Jan 01, 2014
by
Benjamin Eberlei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[DBAL-756] Add new method AbstractPlatform#getVendor().
parent
2632d4a7
Changes
12
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
92 additions
and
1 deletion
+92
-1
UPGRADE.md
UPGRADE.md
+10
-0
AbstractPlatform.php
lib/Doctrine/DBAL/Platforms/AbstractPlatform.php
+7
-0
DB2Platform.php
lib/Doctrine/DBAL/Platforms/DB2Platform.php
+8
-0
DrizzlePlatform.php
lib/Doctrine/DBAL/Platforms/DrizzlePlatform.php
+8
-0
MySqlPlatform.php
lib/Doctrine/DBAL/Platforms/MySqlPlatform.php
+8
-0
OraclePlatform.php
lib/Doctrine/DBAL/Platforms/OraclePlatform.php
+8
-0
PostgreSqlPlatform.php
lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php
+8
-0
SQLAnywherePlatform.php
lib/Doctrine/DBAL/Platforms/SQLAnywherePlatform.php
+8
-0
SQLServerPlatform.php
lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php
+8
-0
SqlitePlatform.php
lib/Doctrine/DBAL/Platforms/SqlitePlatform.php
+8
-0
MockPlatform.php
tests/Doctrine/Tests/DBAL/Mocks/MockPlatform.php
+6
-0
DatabasePlatformMock.php
tests/Doctrine/Tests/Mocks/DatabasePlatformMock.php
+5
-1
No files found.
UPGRADE.md
View file @
5a46f577
# Upgrade to 2.5
## New abstract method `getVendor` on `AbstractPlatform`
Because we have been getting more and more version specific platforms
it is necessary to detect platforms based on the vendor, not on their version names.
For this a new method
`abstract public function getVendor()`
was introduced on
the
`AbstractPlatform`
.
If you have a custom platform that extends from
`AbstractPlatform`
you need to provide
this method as of version 2.5 of DBAL.
## datetime Type uses date_create() as fallback
Before 2.5 the DateTime type always required a specific format, defined in
...
...
lib/Doctrine/DBAL/Platforms/AbstractPlatform.php
View file @
5a46f577
...
...
@@ -337,6 +337,13 @@ abstract class AbstractPlatform
*/
abstract
public
function
getName
();
/**
* Gets the name of the vendor, independent of version.
*
* @return string
*/
abstract
public
function
getVendor
();
/**
* Registers a doctrine type to be used in conjunction with a column type of this platform.
*
...
...
lib/Doctrine/DBAL/Platforms/DB2Platform.php
View file @
5a46f577
...
...
@@ -107,6 +107,14 @@ class DB2Platform extends AbstractPlatform
return
'db2'
;
}
/**
* {@inheritDoc}
*/
public
function
getVendor
()
{
return
'db2'
;
}
/**
* {@inheritDoc}
*/
...
...
lib/Doctrine/DBAL/Platforms/DrizzlePlatform.php
View file @
5a46f577
...
...
@@ -40,6 +40,14 @@ class DrizzlePlatform extends AbstractPlatform
return
'drizzle'
;
}
/**
* {@inheritDoc}
*/
public
function
getVendor
()
{
return
'drizzle'
;
}
/**
* {@inheritDoc}
*/
...
...
lib/Doctrine/DBAL/Platforms/MySqlPlatform.php
View file @
5a46f577
...
...
@@ -795,6 +795,14 @@ class MySqlPlatform extends AbstractPlatform
return
'mysql'
;
}
/**
* {@inheritDoc}
*/
public
function
getVendor
()
{
return
'mysql'
;
}
/**
* {@inheritDoc}
*/
...
...
lib/Doctrine/DBAL/Platforms/OraclePlatform.php
View file @
5a46f577
...
...
@@ -810,6 +810,14 @@ LEFT JOIN user_cons_columns r_cols
return
'oracle'
;
}
/**
* {@inheritDoc}
*/
public
function
getVendor
()
{
return
'oracle'
;
}
/**
* {@inheritDoc}
*/
...
...
lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php
View file @
5a46f577
...
...
@@ -874,6 +874,14 @@ class PostgreSqlPlatform extends AbstractPlatform
return
'postgresql'
;
}
/**
* {@inheritDoc}
*/
public
function
getVendor
()
{
return
'postgresql'
;
}
/**
* {@inheritDoc}
*
...
...
lib/Doctrine/DBAL/Platforms/SQLAnywherePlatform.php
View file @
5a46f577
...
...
@@ -1005,6 +1005,14 @@ class SQLAnywherePlatform extends AbstractPlatform
return
'sqlanywhere'
;
}
/**
* {@inheritDoc}
*/
public
function
getVendor
()
{
return
'sqlanywhere'
;
}
/**
* Obtain DBMS specific SQL code portion needed to set a primary key
* declaration to be used in statements like ALTER TABLE.
...
...
lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php
View file @
5a46f577
...
...
@@ -1286,6 +1286,14 @@ class SQLServerPlatform extends AbstractPlatform
return
'mssql'
;
}
/**
* {@inheritDoc}
*/
public
function
getVendor
()
{
return
'sqlserver'
;
}
/**
* {@inheritDoc}
*/
...
...
lib/Doctrine/DBAL/Platforms/SqlitePlatform.php
View file @
5a46f577
...
...
@@ -486,6 +486,14 @@ class SqlitePlatform extends AbstractPlatform
return
'sqlite'
;
}
/**
* {@inheritDoc}
*/
public
function
getVendor
()
{
return
'sqlite'
;
}
/**
* {@inheritDoc}
*/
...
...
tests/Doctrine/Tests/DBAL/Mocks/MockPlatform.php
View file @
5a46f577
...
...
@@ -56,6 +56,12 @@ class MockPlatform extends \Doctrine\DBAL\Platforms\AbstractPlatform
{
return
'mock'
;
}
public
function
getVendor
()
{
return
'mock'
;
}
protected
function
initializeDoctrineTypeMappings
()
{
}
protected
function
getVarcharTypeDeclarationSQLSnippet
(
$length
,
$fixed
)
...
...
tests/Doctrine/Tests/Mocks/DatabasePlatformMock.php
View file @
5a46f577
...
...
@@ -72,6 +72,10 @@ class DatabasePlatformMock extends \Doctrine\DBAL\Platforms\AbstractPlatform
{
return
'mock'
;
}
public
function
getVendor
()
{
return
'mock'
;
}
protected
function
initializeDoctrineTypeMappings
()
{
}
protected
function
getVarcharTypeDeclarationSQLSnippet
(
$length
,
$fixed
)
...
...
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