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
8c9e9e81
Commit
8c9e9e81
authored
Mar 24, 2012
by
Benjamin Eberlei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix CS: if (!$var) to if ( ! $var)
parent
72465c6f
Changes
33
Hide whitespace changes
Inline
Side-by-side
Showing
33 changed files
with
56 additions
and
56 deletions
+56
-56
ResultCacheStatement.php
lib/Doctrine/DBAL/Cache/ResultCacheStatement.php
+1
-1
Connection.php
lib/Doctrine/DBAL/Connection.php
+5
-5
DB2Connection.php
lib/Doctrine/DBAL/Driver/IBMDB2/DB2Connection.php
+3
-3
DB2Statement.php
lib/Doctrine/DBAL/Driver/IBMDB2/DB2Statement.php
+3
-3
MysqliConnection.php
lib/Doctrine/DBAL/Driver/Mysqli/MysqliConnection.php
+1
-1
MysqliStatement.php
lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php
+2
-2
OCI8Connection.php
lib/Doctrine/DBAL/Driver/OCI8/OCI8Connection.php
+1
-1
SQLSrvConnection.php
lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvConnection.php
+1
-1
SQLSrvException.php
lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvException.php
+1
-1
SQLSrvStatement.php
lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvStatement.php
+1
-1
SchemaDropTableEventArgs.php
lib/Doctrine/DBAL/Event/SchemaDropTableEventArgs.php
+1
-1
AbstractPlatform.php
lib/Doctrine/DBAL/Platforms/AbstractPlatform.php
+6
-6
DB2Platform.php
lib/Doctrine/DBAL/Platforms/DB2Platform.php
+1
-1
DrizzlePlatform.php
lib/Doctrine/DBAL/Platforms/DrizzlePlatform.php
+1
-1
ReservedKeywordsValidator.php
...ine/DBAL/Platforms/Keywords/ReservedKeywordsValidator.php
+1
-1
MySqlPlatform.php
lib/Doctrine/DBAL/Platforms/MySqlPlatform.php
+1
-1
OraclePlatform.php
lib/Doctrine/DBAL/Platforms/OraclePlatform.php
+1
-1
PostgreSqlPlatform.php
lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php
+1
-1
SQLServerPlatform.php
lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php
+2
-2
Statement.php
lib/Doctrine/DBAL/Portability/Statement.php
+2
-2
AbstractAsset.php
lib/Doctrine/DBAL/Schema/AbstractAsset.php
+1
-1
AbstractSchemaManager.php
lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php
+4
-4
Comparator.php
lib/Doctrine/DBAL/Schema/Comparator.php
+2
-2
DB2SchemaManager.php
lib/Doctrine/DBAL/Schema/DB2SchemaManager.php
+1
-1
Index.php
lib/Doctrine/DBAL/Schema/Index.php
+1
-1
SQLServerSchemaManager.php
lib/Doctrine/DBAL/Schema/SQLServerSchemaManager.php
+1
-1
Table.php
lib/Doctrine/DBAL/Schema/Table.php
+4
-4
ReservedWordsCommand.php
...trine/DBAL/Tools/Console/Command/ReservedWordsCommand.php
+1
-1
DateTimeType.php
lib/Doctrine/DBAL/Types/DateTimeType.php
+1
-1
DateTimeTzType.php
lib/Doctrine/DBAL/Types/DateTimeTzType.php
+1
-1
DateType.php
lib/Doctrine/DBAL/Types/DateType.php
+1
-1
TimeType.php
lib/Doctrine/DBAL/Types/TimeType.php
+1
-1
VarDateTimeType.php
lib/Doctrine/DBAL/Types/VarDateTimeType.php
+1
-1
No files found.
lib/Doctrine/DBAL/Cache/ResultCacheStatement.php
View file @
8c9e9e81
...
@@ -109,7 +109,7 @@ class ResultCacheStatement implements \IteratorAggregate, ResultStatement
...
@@ -109,7 +109,7 @@ class ResultCacheStatement implements \IteratorAggregate, ResultStatement
$this
->
statement
->
closeCursor
();
$this
->
statement
->
closeCursor
();
if
(
$this
->
emptied
&&
$this
->
data
!==
null
)
{
if
(
$this
->
emptied
&&
$this
->
data
!==
null
)
{
$data
=
$this
->
resultCache
->
fetch
(
$this
->
cacheKey
);
$data
=
$this
->
resultCache
->
fetch
(
$this
->
cacheKey
);
if
(
!
$data
)
{
if
(
!
$data
)
{
$data
=
array
();
$data
=
array
();
}
}
$data
[
$this
->
realKey
]
=
$this
->
data
;
$data
[
$this
->
realKey
]
=
$this
->
data
;
...
...
lib/Doctrine/DBAL/Connection.php
View file @
8c9e9e81
...
@@ -652,7 +652,7 @@ class Connection implements DriverConnection
...
@@ -652,7 +652,7 @@ class Connection implements DriverConnection
public
function
executeCacheQuery
(
$query
,
$params
,
$types
,
QueryCacheProfile
$qcp
)
public
function
executeCacheQuery
(
$query
,
$params
,
$types
,
QueryCacheProfile
$qcp
)
{
{
$resultCache
=
$qcp
->
getResultCacheDriver
()
?:
$this
->
_config
->
getResultCacheImpl
();
$resultCache
=
$qcp
->
getResultCacheDriver
()
?:
$this
->
_config
->
getResultCacheImpl
();
if
(
!
$resultCache
)
{
if
(
!
$resultCache
)
{
throw
CacheException
::
noResultDriverConfigured
();
throw
CacheException
::
noResultDriverConfigured
();
}
}
...
@@ -872,7 +872,7 @@ class Connection implements DriverConnection
...
@@ -872,7 +872,7 @@ class Connection implements DriverConnection
throw
ConnectionException
::
mayNotAlterNestedTransactionWithSavepointsInTransaction
();
throw
ConnectionException
::
mayNotAlterNestedTransactionWithSavepointsInTransaction
();
}
}
if
(
!
$this
->
_platform
->
supportsSavepoints
())
{
if
(
!
$this
->
_platform
->
supportsSavepoints
())
{
throw
ConnectionException
::
savepointsNotSupported
();
throw
ConnectionException
::
savepointsNotSupported
();
}
}
...
@@ -1025,7 +1025,7 @@ class Connection implements DriverConnection
...
@@ -1025,7 +1025,7 @@ class Connection implements DriverConnection
*/
*/
public
function
createSavepoint
(
$savepoint
)
public
function
createSavepoint
(
$savepoint
)
{
{
if
(
!
$this
->
_platform
->
supportsSavepoints
())
{
if
(
!
$this
->
_platform
->
supportsSavepoints
())
{
throw
ConnectionException
::
savepointsNotSupported
();
throw
ConnectionException
::
savepointsNotSupported
();
}
}
...
@@ -1041,7 +1041,7 @@ class Connection implements DriverConnection
...
@@ -1041,7 +1041,7 @@ class Connection implements DriverConnection
*/
*/
public
function
releaseSavepoint
(
$savepoint
)
public
function
releaseSavepoint
(
$savepoint
)
{
{
if
(
!
$this
->
_platform
->
supportsSavepoints
())
{
if
(
!
$this
->
_platform
->
supportsSavepoints
())
{
throw
ConnectionException
::
savepointsNotSupported
();
throw
ConnectionException
::
savepointsNotSupported
();
}
}
...
@@ -1059,7 +1059,7 @@ class Connection implements DriverConnection
...
@@ -1059,7 +1059,7 @@ class Connection implements DriverConnection
*/
*/
public
function
rollbackSavepoint
(
$savepoint
)
public
function
rollbackSavepoint
(
$savepoint
)
{
{
if
(
!
$this
->
_platform
->
supportsSavepoints
())
{
if
(
!
$this
->
_platform
->
supportsSavepoints
())
{
throw
ConnectionException
::
savepointsNotSupported
();
throw
ConnectionException
::
savepointsNotSupported
();
}
}
...
...
lib/Doctrine/DBAL/Driver/IBMDB2/DB2Connection.php
View file @
8c9e9e81
...
@@ -34,7 +34,7 @@ class DB2Connection implements \Doctrine\DBAL\Driver\Connection
...
@@ -34,7 +34,7 @@ class DB2Connection implements \Doctrine\DBAL\Driver\Connection
}
else
{
}
else
{
$this
->
_conn
=
db2_connect
(
$params
[
'dbname'
],
$username
,
$password
,
$driverOptions
);
$this
->
_conn
=
db2_connect
(
$params
[
'dbname'
],
$username
,
$password
,
$driverOptions
);
}
}
if
(
!
$this
->
_conn
)
{
if
(
!
$this
->
_conn
)
{
throw
new
DB2Exception
(
db2_conn_errormsg
());
throw
new
DB2Exception
(
db2_conn_errormsg
());
}
}
}
}
...
@@ -42,7 +42,7 @@ class DB2Connection implements \Doctrine\DBAL\Driver\Connection
...
@@ -42,7 +42,7 @@ class DB2Connection implements \Doctrine\DBAL\Driver\Connection
public
function
prepare
(
$sql
)
public
function
prepare
(
$sql
)
{
{
$stmt
=
@
db2_prepare
(
$this
->
_conn
,
$sql
);
$stmt
=
@
db2_prepare
(
$this
->
_conn
,
$sql
);
if
(
!
$stmt
)
{
if
(
!
$stmt
)
{
throw
new
DB2Exception
(
db2_stmt_errormsg
());
throw
new
DB2Exception
(
db2_stmt_errormsg
());
}
}
return
new
DB2Statement
(
$stmt
);
return
new
DB2Statement
(
$stmt
);
...
@@ -112,4 +112,4 @@ class DB2Connection implements \Doctrine\DBAL\Driver\Connection
...
@@ -112,4 +112,4 @@ class DB2Connection implements \Doctrine\DBAL\Driver\Connection
1
=>
$this
->
errorCode
(),
1
=>
$this
->
errorCode
(),
);
);
}
}
}
}
\ No newline at end of file
lib/Doctrine/DBAL/Driver/IBMDB2/DB2Statement.php
View file @
8c9e9e81
...
@@ -77,7 +77,7 @@ class DB2Statement implements \IteratorAggregate, Statement
...
@@ -77,7 +77,7 @@ class DB2Statement implements \IteratorAggregate, Statement
*/
*/
public
function
closeCursor
()
public
function
closeCursor
()
{
{
if
(
!
$this
->
_stmt
)
{
if
(
!
$this
->
_stmt
)
{
return
false
;
return
false
;
}
}
...
@@ -93,7 +93,7 @@ class DB2Statement implements \IteratorAggregate, Statement
...
@@ -93,7 +93,7 @@ class DB2Statement implements \IteratorAggregate, Statement
*/
*/
public
function
columnCount
()
public
function
columnCount
()
{
{
if
(
!
$this
->
_stmt
)
{
if
(
!
$this
->
_stmt
)
{
return
false
;
return
false
;
}
}
return
db2_num_fields
(
$this
->
_stmt
);
return
db2_num_fields
(
$this
->
_stmt
);
...
@@ -123,7 +123,7 @@ class DB2Statement implements \IteratorAggregate, Statement
...
@@ -123,7 +123,7 @@ class DB2Statement implements \IteratorAggregate, Statement
*/
*/
public
function
execute
(
$params
=
null
)
public
function
execute
(
$params
=
null
)
{
{
if
(
!
$this
->
_stmt
)
{
if
(
!
$this
->
_stmt
)
{
return
false
;
return
false
;
}
}
...
...
lib/Doctrine/DBAL/Driver/Mysqli/MysqliConnection.php
View file @
8c9e9e81
...
@@ -37,7 +37,7 @@ class MysqliConnection implements Connection
...
@@ -37,7 +37,7 @@ class MysqliConnection implements Connection
$socket
=
isset
(
$params
[
'unix_socket'
])
?
$params
[
'unix_socket'
]
:
ini_get
(
'mysqli.default_socket'
);
$socket
=
isset
(
$params
[
'unix_socket'
])
?
$params
[
'unix_socket'
]
:
ini_get
(
'mysqli.default_socket'
);
$this
->
_conn
=
mysqli_init
();
$this
->
_conn
=
mysqli_init
();
if
(
!
$this
->
_conn
->
real_connect
(
$params
[
'host'
],
$username
,
$password
,
$params
[
'dbname'
],
$port
,
$socket
))
{
if
(
!
$this
->
_conn
->
real_connect
(
$params
[
'host'
],
$username
,
$password
,
$params
[
'dbname'
],
$port
,
$socket
))
{
throw
new
MysqliException
(
$this
->
_conn
->
connect_error
,
$this
->
_conn
->
connect_errno
);
throw
new
MysqliException
(
$this
->
_conn
->
connect_error
,
$this
->
_conn
->
connect_errno
);
}
}
...
...
lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php
View file @
8c9e9e81
...
@@ -131,7 +131,7 @@ class MysqliStatement implements \IteratorAggregate, Statement
...
@@ -131,7 +131,7 @@ class MysqliStatement implements \IteratorAggregate, Statement
{
{
if
(
null
!==
$this
->
_bindedValues
)
{
if
(
null
!==
$this
->
_bindedValues
)
{
if
(
null
!==
$params
)
{
if
(
null
!==
$params
)
{
if
(
!
$this
->
_bindValues
(
$params
))
{
if
(
!
$this
->
_bindValues
(
$params
))
{
throw
new
MysqliException
(
$this
->
_stmt
->
error
,
$this
->
_stmt
->
errno
);
throw
new
MysqliException
(
$this
->
_stmt
->
error
,
$this
->
_stmt
->
errno
);
}
}
}
else
{
}
else
{
...
@@ -141,7 +141,7 @@ class MysqliStatement implements \IteratorAggregate, Statement
...
@@ -141,7 +141,7 @@ class MysqliStatement implements \IteratorAggregate, Statement
}
}
}
}
if
(
!
$this
->
_stmt
->
execute
())
{
if
(
!
$this
->
_stmt
->
execute
())
{
throw
new
MysqliException
(
$this
->
_stmt
->
error
,
$this
->
_stmt
->
errno
);
throw
new
MysqliException
(
$this
->
_stmt
->
error
,
$this
->
_stmt
->
errno
);
}
}
...
...
lib/Doctrine/DBAL/Driver/OCI8/OCI8Connection.php
View file @
8c9e9e81
...
@@ -44,7 +44,7 @@ class OCI8Connection implements \Doctrine\DBAL\Driver\Connection
...
@@ -44,7 +44,7 @@ class OCI8Connection implements \Doctrine\DBAL\Driver\Connection
}
}
$this
->
_dbh
=
@
oci_connect
(
$username
,
$password
,
$db
,
$charset
,
$sessionMode
);
$this
->
_dbh
=
@
oci_connect
(
$username
,
$password
,
$db
,
$charset
,
$sessionMode
);
if
(
!
$this
->
_dbh
)
{
if
(
!
$this
->
_dbh
)
{
throw
OCI8Exception
::
fromErrorInfo
(
oci_error
());
throw
OCI8Exception
::
fromErrorInfo
(
oci_error
());
}
}
}
}
...
...
lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvConnection.php
View file @
8c9e9e81
...
@@ -41,7 +41,7 @@ class SQLSrvConnection implements \Doctrine\DBAL\Driver\Connection
...
@@ -41,7 +41,7 @@ class SQLSrvConnection implements \Doctrine\DBAL\Driver\Connection
public
function
__construct
(
$serverName
,
$connectionOptions
)
public
function
__construct
(
$serverName
,
$connectionOptions
)
{
{
$this
->
conn
=
sqlsrv_connect
(
$serverName
,
$connectionOptions
);
$this
->
conn
=
sqlsrv_connect
(
$serverName
,
$connectionOptions
);
if
(
!
$this
->
conn
)
{
if
(
!
$this
->
conn
)
{
throw
SQLSrvException
::
fromSqlSrvErrors
();
throw
SQLSrvException
::
fromSqlSrvErrors
();
}
}
$this
->
lastInsertId
=
new
LastInsertId
();
$this
->
lastInsertId
=
new
LastInsertId
();
...
...
lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvException.php
View file @
8c9e9e81
...
@@ -33,7 +33,7 @@ class SQLSrvException extends \Doctrine\DBAL\DBALException
...
@@ -33,7 +33,7 @@ class SQLSrvException extends \Doctrine\DBAL\DBALException
foreach
(
$errors
as
$error
)
{
foreach
(
$errors
as
$error
)
{
$message
.=
"SQLSTATE ["
.
$error
[
'SQLSTATE'
]
.
", "
.
$error
[
'code'
]
.
"]: "
.
$error
[
'message'
]
.
"
\n
"
;
$message
.=
"SQLSTATE ["
.
$error
[
'SQLSTATE'
]
.
", "
.
$error
[
'code'
]
.
"]: "
.
$error
[
'message'
]
.
"
\n
"
;
}
}
if
(
!
$message
)
{
if
(
!
$message
)
{
$message
=
"SQL Server error occured but no error message was retrieved from driver."
;
$message
=
"SQL Server error occured but no error message was retrieved from driver."
;
}
}
...
...
lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvStatement.php
View file @
8c9e9e81
...
@@ -164,7 +164,7 @@ class SQLSrvStatement implements IteratorAggregate, Statement
...
@@ -164,7 +164,7 @@ class SQLSrvStatement implements IteratorAggregate, Statement
}
}
$this
->
stmt
=
sqlsrv_query
(
$this
->
conn
,
$this
->
sql
,
$this
->
params
);
$this
->
stmt
=
sqlsrv_query
(
$this
->
conn
,
$this
->
sql
,
$this
->
params
);
if
(
!
$this
->
stmt
)
{
if
(
!
$this
->
stmt
)
{
throw
SQLSrvException
::
fromSqlSrvErrors
();
throw
SQLSrvException
::
fromSqlSrvErrors
();
}
}
...
...
lib/Doctrine/DBAL/Event/SchemaDropTableEventArgs.php
View file @
8c9e9e81
...
@@ -53,7 +53,7 @@ class SchemaDropTableEventArgs extends SchemaEventArgs
...
@@ -53,7 +53,7 @@ class SchemaDropTableEventArgs extends SchemaEventArgs
*/
*/
public
function
__construct
(
$table
,
AbstractPlatform
$platform
)
public
function
__construct
(
$table
,
AbstractPlatform
$platform
)
{
{
if
(
!
$table
instanceof
Table
&&
!
is_string
(
$table
))
{
if
(
!
$table
instanceof
Table
&&
!
is_string
(
$table
))
{
throw
new
\InvalidArgumentException
(
'SchemaCreateTableEventArgs expects $table parameter to be string or \Doctrine\DBAL\Schema\Table.'
);
throw
new
\InvalidArgumentException
(
'SchemaCreateTableEventArgs expects $table parameter to be string or \Doctrine\DBAL\Schema\Table.'
);
}
}
...
...
lib/Doctrine/DBAL/Platforms/AbstractPlatform.php
View file @
8c9e9e81
...
@@ -1387,7 +1387,7 @@ abstract class AbstractPlatform
...
@@ -1387,7 +1387,7 @@ abstract class AbstractPlatform
return
false
;
return
false
;
}
}
if
(
!
$this
->
_eventManager
->
hasListeners
(
Events
::
onSchemaAlterTableAddColumn
))
{
if
(
!
$this
->
_eventManager
->
hasListeners
(
Events
::
onSchemaAlterTableAddColumn
))
{
return
false
;
return
false
;
}
}
...
@@ -1410,7 +1410,7 @@ abstract class AbstractPlatform
...
@@ -1410,7 +1410,7 @@ abstract class AbstractPlatform
return
false
;
return
false
;
}
}
if
(
!
$this
->
_eventManager
->
hasListeners
(
Events
::
onSchemaAlterTableRemoveColumn
))
{
if
(
!
$this
->
_eventManager
->
hasListeners
(
Events
::
onSchemaAlterTableRemoveColumn
))
{
return
false
;
return
false
;
}
}
...
@@ -1433,7 +1433,7 @@ abstract class AbstractPlatform
...
@@ -1433,7 +1433,7 @@ abstract class AbstractPlatform
return
false
;
return
false
;
}
}
if
(
!
$this
->
_eventManager
->
hasListeners
(
Events
::
onSchemaAlterTableChangeColumn
))
{
if
(
!
$this
->
_eventManager
->
hasListeners
(
Events
::
onSchemaAlterTableChangeColumn
))
{
return
false
;
return
false
;
}
}
...
@@ -1457,7 +1457,7 @@ abstract class AbstractPlatform
...
@@ -1457,7 +1457,7 @@ abstract class AbstractPlatform
return
false
;
return
false
;
}
}
if
(
!
$this
->
_eventManager
->
hasListeners
(
Events
::
onSchemaAlterTableRenameColumn
))
{
if
(
!
$this
->
_eventManager
->
hasListeners
(
Events
::
onSchemaAlterTableRenameColumn
))
{
return
false
;
return
false
;
}
}
...
@@ -1478,7 +1478,7 @@ abstract class AbstractPlatform
...
@@ -1478,7 +1478,7 @@ abstract class AbstractPlatform
return
false
;
return
false
;
}
}
if
(
!
$this
->
_eventManager
->
hasListeners
(
Events
::
onSchemaAlterTable
))
{
if
(
!
$this
->
_eventManager
->
hasListeners
(
Events
::
onSchemaAlterTable
))
{
return
false
;
return
false
;
}
}
...
@@ -2672,7 +2672,7 @@ abstract class AbstractPlatform
...
@@ -2672,7 +2672,7 @@ abstract class AbstractPlatform
{
{
$class
=
$this
->
getReservedKeywordsClass
();
$class
=
$this
->
getReservedKeywordsClass
();
$keywords
=
new
$class
;
$keywords
=
new
$class
;
if
(
!
$keywords
instanceof
\Doctrine\DBAL\Platforms\Keywords\KeywordList
)
{
if
(
!
$keywords
instanceof
\Doctrine\DBAL\Platforms\Keywords\KeywordList
)
{
throw
DBALException
::
notSupported
(
__METHOD__
);
throw
DBALException
::
notSupported
(
__METHOD__
);
}
}
return
$keywords
;
return
$keywords
;
...
...
lib/Doctrine/DBAL/Platforms/DB2Platform.php
View file @
8c9e9e81
...
@@ -413,7 +413,7 @@ class DB2Platform extends AbstractPlatform
...
@@ -413,7 +413,7 @@ class DB2Platform extends AbstractPlatform
$tableSql
=
array
();
$tableSql
=
array
();
if
(
!
$this
->
onSchemaAlterTable
(
$diff
,
$tableSql
))
{
if
(
!
$this
->
onSchemaAlterTable
(
$diff
,
$tableSql
))
{
if
(
count
(
$queryParts
)
>
0
)
{
if
(
count
(
$queryParts
)
>
0
)
{
$sql
[]
=
'ALTER TABLE '
.
$diff
->
name
.
' '
.
implode
(
" "
,
$queryParts
);
$sql
[]
=
'ALTER TABLE '
.
$diff
->
name
.
' '
.
implode
(
" "
,
$queryParts
);
}
}
...
...
lib/Doctrine/DBAL/Platforms/DrizzlePlatform.php
View file @
8c9e9e81
...
@@ -347,7 +347,7 @@ class DrizzlePlatform extends AbstractPlatform
...
@@ -347,7 +347,7 @@ class DrizzlePlatform extends AbstractPlatform
$sql
=
array
();
$sql
=
array
();
$tableSql
=
array
();
$tableSql
=
array
();
if
(
!
$this
->
onSchemaAlterTable
(
$diff
,
$tableSql
))
{
if
(
!
$this
->
onSchemaAlterTable
(
$diff
,
$tableSql
))
{
if
(
count
(
$queryParts
)
>
0
)
{
if
(
count
(
$queryParts
)
>
0
)
{
$sql
[]
=
'ALTER TABLE '
.
$diff
->
name
.
' '
.
implode
(
", "
,
$queryParts
);
$sql
[]
=
'ALTER TABLE '
.
$diff
->
name
.
' '
.
implode
(
", "
,
$queryParts
);
}
}
...
...
lib/Doctrine/DBAL/Platforms/Keywords/ReservedKeywordsValidator.php
View file @
8c9e9e81
...
@@ -71,7 +71,7 @@ class ReservedKeywordsValidator implements Visitor
...
@@ -71,7 +71,7 @@ class ReservedKeywordsValidator implements Visitor
private
function
addViolation
(
$asset
,
$violatedPlatforms
)
private
function
addViolation
(
$asset
,
$violatedPlatforms
)
{
{
if
(
!
$violatedPlatforms
)
{
if
(
!
$violatedPlatforms
)
{
return
;
return
;
}
}
...
...
lib/Doctrine/DBAL/Platforms/MySqlPlatform.php
View file @
8c9e9e81
...
@@ -505,7 +505,7 @@ class MySqlPlatform extends AbstractPlatform
...
@@ -505,7 +505,7 @@ class MySqlPlatform extends AbstractPlatform
$sql
=
array
();
$sql
=
array
();
$tableSql
=
array
();
$tableSql
=
array
();
if
(
!
$this
->
onSchemaAlterTable
(
$diff
,
$tableSql
))
{
if
(
!
$this
->
onSchemaAlterTable
(
$diff
,
$tableSql
))
{
if
(
count
(
$queryParts
)
>
0
)
{
if
(
count
(
$queryParts
)
>
0
)
{
$sql
[]
=
'ALTER TABLE '
.
$diff
->
name
.
' '
.
implode
(
", "
,
$queryParts
);
$sql
[]
=
'ALTER TABLE '
.
$diff
->
name
.
' '
.
implode
(
", "
,
$queryParts
);
}
}
...
...
lib/Doctrine/DBAL/Platforms/OraclePlatform.php
View file @
8c9e9e81
...
@@ -624,7 +624,7 @@ LEFT JOIN user_cons_columns r_cols
...
@@ -624,7 +624,7 @@ LEFT JOIN user_cons_columns r_cols
$tableSql
=
array
();
$tableSql
=
array
();
if
(
!
$this
->
onSchemaAlterTable
(
$diff
,
$tableSql
))
{
if
(
!
$this
->
onSchemaAlterTable
(
$diff
,
$tableSql
))
{
if
(
$diff
->
newName
!==
false
)
{
if
(
$diff
->
newName
!==
false
)
{
$sql
[]
=
'ALTER TABLE '
.
$diff
->
name
.
' RENAME TO '
.
$diff
->
newName
;
$sql
[]
=
'ALTER TABLE '
.
$diff
->
name
.
' RENAME TO '
.
$diff
->
newName
;
}
}
...
...
lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php
View file @
8c9e9e81
...
@@ -457,7 +457,7 @@ class PostgreSqlPlatform extends AbstractPlatform
...
@@ -457,7 +457,7 @@ class PostgreSqlPlatform extends AbstractPlatform
$tableSql
=
array
();
$tableSql
=
array
();
if
(
!
$this
->
onSchemaAlterTable
(
$diff
,
$tableSql
))
{
if
(
!
$this
->
onSchemaAlterTable
(
$diff
,
$tableSql
))
{
if
(
$diff
->
newName
!==
false
)
{
if
(
$diff
->
newName
!==
false
)
{
$sql
[]
=
'ALTER TABLE '
.
$diff
->
name
.
' RENAME TO '
.
$diff
->
newName
;
$sql
[]
=
'ALTER TABLE '
.
$diff
->
name
.
' RENAME TO '
.
$diff
->
newName
;
}
}
...
...
lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php
View file @
8c9e9e81
...
@@ -509,7 +509,7 @@ class SQLServerPlatform extends AbstractPlatform
...
@@ -509,7 +509,7 @@ class SQLServerPlatform extends AbstractPlatform
{
{
$trimFn
=
''
;
$trimFn
=
''
;
if
(
!
$char
)
{
if
(
!
$char
)
{
if
(
$pos
==
self
::
TRIM_LEADING
)
{
if
(
$pos
==
self
::
TRIM_LEADING
)
{
$trimFn
=
'LTRIM'
;
$trimFn
=
'LTRIM'
;
}
else
if
(
$pos
==
self
::
TRIM_TRAILING
)
{
}
else
if
(
$pos
==
self
::
TRIM_TRAILING
)
{
...
@@ -692,7 +692,7 @@ class SQLServerPlatform extends AbstractPlatform
...
@@ -692,7 +692,7 @@ class SQLServerPlatform extends AbstractPlatform
}
else
{
}
else
{
$orderby
=
stristr
(
$query
,
'ORDER BY'
);
$orderby
=
stristr
(
$query
,
'ORDER BY'
);
if
(
!
$orderby
)
{
if
(
!
$orderby
)
{
$over
=
'ORDER BY (SELECT 0)'
;
$over
=
'ORDER BY (SELECT 0)'
;
}
else
{
}
else
{
$over
=
preg_replace
(
'/\"[^,]*\".\"([^,]*)\"/i'
,
'"inner_tbl"."$1"'
,
$orderby
);
$over
=
preg_replace
(
'/\"[^,]*\".\"([^,]*)\"/i'
,
'"inner_tbl"."$1"'
,
$orderby
);
...
...
lib/Doctrine/DBAL/Portability/Statement.php
View file @
8c9e9e81
...
@@ -134,7 +134,7 @@ class Statement implements \IteratorAggregate, \Doctrine\DBAL\Driver\Statement
...
@@ -134,7 +134,7 @@ class Statement implements \IteratorAggregate, \Doctrine\DBAL\Driver\Statement
$iterateRow
=
$this
->
portability
&
(
Connection
::
PORTABILITY_EMPTY_TO_NULL
|
Connection
::
PORTABILITY_RTRIM
);
$iterateRow
=
$this
->
portability
&
(
Connection
::
PORTABILITY_EMPTY_TO_NULL
|
Connection
::
PORTABILITY_RTRIM
);
$fixCase
=
!
is_null
(
$this
->
case
)
&&
(
$fetchStyle
==
PDO
::
FETCH_ASSOC
||
$fetchStyle
==
PDO
::
FETCH_BOTH
)
&&
(
$this
->
portability
&
Connection
::
PORTABILITY_FIX_CASE
);
$fixCase
=
!
is_null
(
$this
->
case
)
&&
(
$fetchStyle
==
PDO
::
FETCH_ASSOC
||
$fetchStyle
==
PDO
::
FETCH_BOTH
)
&&
(
$this
->
portability
&
Connection
::
PORTABILITY_FIX_CASE
);
if
(
!
$iterateRow
&&
!
$fixCase
)
{
if
(
!
$iterateRow
&&
!
$fixCase
)
{
return
$rows
;
return
$rows
;
}
}
...
@@ -147,7 +147,7 @@ class Statement implements \IteratorAggregate, \Doctrine\DBAL\Driver\Statement
...
@@ -147,7 +147,7 @@ class Statement implements \IteratorAggregate, \Doctrine\DBAL\Driver\Statement
protected
function
fixRow
(
$row
,
$iterateRow
,
$fixCase
)
protected
function
fixRow
(
$row
,
$iterateRow
,
$fixCase
)
{
{
if
(
!
$row
)
{
if
(
!
$row
)
{
return
$row
;
return
$row
;
}
}
...
...
lib/Doctrine/DBAL/Schema/AbstractAsset.php
View file @
8c9e9e81
...
@@ -123,7 +123,7 @@ abstract class AbstractAsset
...
@@ -123,7 +123,7 @@ abstract class AbstractAsset
public
function
getFullQualifiedName
(
$defaultNamespaceName
)
public
function
getFullQualifiedName
(
$defaultNamespaceName
)
{
{
$name
=
$this
->
getName
();
$name
=
$this
->
getName
();
if
(
!
$this
->
_namespace
)
{
if
(
!
$this
->
_namespace
)
{
$name
=
$defaultNamespaceName
.
"."
.
$name
;
$name
=
$defaultNamespaceName
.
"."
.
$name
;
}
}
return
strtolower
(
$name
);
return
strtolower
(
$name
);
...
...
lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php
View file @
8c9e9e81
...
@@ -148,7 +148,7 @@ abstract class AbstractSchemaManager
...
@@ -148,7 +148,7 @@ abstract class AbstractSchemaManager
*/
*/
public
function
listTableColumns
(
$table
,
$database
=
null
)
public
function
listTableColumns
(
$table
,
$database
=
null
)
{
{
if
(
!
$database
)
{
if
(
!
$database
)
{
$database
=
$this
->
_conn
->
getDatabase
();
$database
=
$this
->
_conn
->
getDatabase
();
}
}
...
@@ -212,7 +212,7 @@ abstract class AbstractSchemaManager
...
@@ -212,7 +212,7 @@ abstract class AbstractSchemaManager
protected
function
filterAssetNames
(
$assetNames
)
protected
function
filterAssetNames
(
$assetNames
)
{
{
$filterExpr
=
$this
->
getFilterSchemaAssetsExpression
();
$filterExpr
=
$this
->
getFilterSchemaAssetsExpression
();
if
(
!
$filterExpr
)
{
if
(
!
$filterExpr
)
{
return
$assetNames
;
return
$assetNames
;
}
}
return
array_values
(
return
array_values
(
...
@@ -668,7 +668,7 @@ abstract class AbstractSchemaManager
...
@@ -668,7 +668,7 @@ abstract class AbstractSchemaManager
$column
=
$eventArgs
->
getColumn
();
$column
=
$eventArgs
->
getColumn
();
}
}
if
(
!
$defaultPrevented
)
{
if
(
!
$defaultPrevented
)
{
$column
=
$this
->
_getPortableTableColumnDefinition
(
$tableColumn
);
$column
=
$this
->
_getPortableTableColumnDefinition
(
$tableColumn
);
}
}
...
@@ -733,7 +733,7 @@ abstract class AbstractSchemaManager
...
@@ -733,7 +733,7 @@ abstract class AbstractSchemaManager
$index
=
$eventArgs
->
getIndex
();
$index
=
$eventArgs
->
getIndex
();
}
}
if
(
!
$defaultPrevented
)
{
if
(
!
$defaultPrevented
)
{
$index
=
new
Index
(
$data
[
'name'
],
$data
[
'columns'
],
$data
[
'unique'
],
$data
[
'primary'
],
$data
[
'flags'
]);
$index
=
new
Index
(
$data
[
'name'
],
$data
[
'columns'
],
$data
[
'unique'
],
$data
[
'primary'
],
$data
[
'flags'
]);
}
}
...
...
lib/Doctrine/DBAL/Schema/Comparator.php
View file @
8c9e9e81
...
@@ -100,7 +100,7 @@ class Comparator
...
@@ -100,7 +100,7 @@ class Comparator
foreach
(
$toSchema
->
getSequences
()
as
$sequence
)
{
foreach
(
$toSchema
->
getSequences
()
as
$sequence
)
{
$sequenceName
=
$sequence
->
getShortestName
(
$toSchema
->
getName
());
$sequenceName
=
$sequence
->
getShortestName
(
$toSchema
->
getName
());
if
(
!
$fromSchema
->
hasSequence
(
$sequenceName
))
{
if
(
!
$fromSchema
->
hasSequence
(
$sequenceName
))
{
$diff
->
newSequences
[]
=
$sequence
;
$diff
->
newSequences
[]
=
$sequence
;
}
else
{
}
else
{
if
(
$this
->
diffSequence
(
$sequence
,
$fromSchema
->
getSequence
(
$sequenceName
)))
{
if
(
$this
->
diffSequence
(
$sequence
,
$fromSchema
->
getSequence
(
$sequenceName
)))
{
...
@@ -111,7 +111,7 @@ class Comparator
...
@@ -111,7 +111,7 @@ class Comparator
foreach
(
$fromSchema
->
getSequences
()
as
$sequence
)
{
foreach
(
$fromSchema
->
getSequences
()
as
$sequence
)
{
$sequenceName
=
$sequence
->
getShortestName
(
$fromSchema
->
getName
());
$sequenceName
=
$sequence
->
getShortestName
(
$fromSchema
->
getName
());
if
(
!
$toSchema
->
hasSequence
(
$sequenceName
))
{
if
(
!
$toSchema
->
hasSequence
(
$sequenceName
))
{
$diff
->
removedSequences
[]
=
$sequence
;
$diff
->
removedSequences
[]
=
$sequence
;
}
}
}
}
...
...
lib/Doctrine/DBAL/Schema/DB2SchemaManager.php
View file @
8c9e9e81
...
@@ -156,7 +156,7 @@ class DB2SchemaManager extends AbstractSchemaManager
...
@@ -156,7 +156,7 @@ class DB2SchemaManager extends AbstractSchemaManager
$index
=
$eventArgs
->
getIndex
();
$index
=
$eventArgs
->
getIndex
();
}
}
if
(
!
$defaultPrevented
)
{
if
(
!
$defaultPrevented
)
{
$index
=
new
Index
(
$data
[
'name'
],
$data
[
'columns'
],
$data
[
'unique'
],
$data
[
'primary'
]);
$index
=
new
Index
(
$data
[
'name'
],
$data
[
'columns'
],
$data
[
'unique'
],
$data
[
'primary'
]);
}
}
...
...
lib/Doctrine/DBAL/Schema/Index.php
View file @
8c9e9e81
...
@@ -160,7 +160,7 @@ class Index extends AbstractAsset implements Constraint
...
@@ -160,7 +160,7 @@ class Index extends AbstractAsset implements Constraint
$sameColumns
=
$this
->
spansColumns
(
$other
->
getColumns
());
$sameColumns
=
$this
->
spansColumns
(
$other
->
getColumns
());
if
(
$sameColumns
)
{
if
(
$sameColumns
)
{
if
(
!
$this
->
isUnique
()
&&
!
$this
->
isPrimary
())
{
if
(
!
$this
->
isUnique
()
&&
!
$this
->
isPrimary
())
{
// this is a special case: If the current key is neither primary or unique, any uniqe or
// this is a special case: If the current key is neither primary or unique, any uniqe or
// primary key will always have the same effect for the index and there cannot be any constraint
// primary key will always have the same effect for the index and there cannot be any constraint
// overlaps. This means a primary or unique index can always fullfill the requirements of just an
// overlaps. This means a primary or unique index can always fullfill the requirements of just an
...
...
lib/Doctrine/DBAL/Schema/SQLServerSchemaManager.php
View file @
8c9e9e81
...
@@ -144,7 +144,7 @@ class SQLServerSchemaManager extends AbstractSchemaManager
...
@@ -144,7 +144,7 @@ class SQLServerSchemaManager extends AbstractSchemaManager
$index
=
$eventArgs
->
getIndex
();
$index
=
$eventArgs
->
getIndex
();
}
}
if
(
!
$defaultPrevented
)
{
if
(
!
$defaultPrevented
)
{
$index
=
new
Index
(
$data
[
'name'
],
$data
[
'columns'
],
$data
[
'unique'
],
$data
[
'primary'
]);
$index
=
new
Index
(
$data
[
'name'
],
$data
[
'columns'
],
$data
[
'unique'
],
$data
[
'primary'
]);
}
}
...
...
lib/Doctrine/DBAL/Schema/Table.php
View file @
8c9e9e81
...
@@ -180,7 +180,7 @@ class Table extends AbstractAsset
...
@@ -180,7 +180,7 @@ class Table extends AbstractAsset
public
function
dropIndex
(
$indexName
)
public
function
dropIndex
(
$indexName
)
{
{
$indexName
=
strtolower
(
$indexName
);
$indexName
=
strtolower
(
$indexName
);
if
(
!
$this
->
hasIndex
(
$indexName
))
{
if
(
!
$this
->
hasIndex
(
$indexName
))
{
throw
SchemaException
::
indexDoesNotExist
(
$indexName
,
$this
->
_name
);
throw
SchemaException
::
indexDoesNotExist
(
$indexName
,
$this
->
_name
);
}
}
unset
(
$this
->
_indexes
[
$indexName
]);
unset
(
$this
->
_indexes
[
$indexName
]);
...
@@ -549,7 +549,7 @@ class Table extends AbstractAsset
...
@@ -549,7 +549,7 @@ class Table extends AbstractAsset
public
function
getColumn
(
$columnName
)
public
function
getColumn
(
$columnName
)
{
{
$columnName
=
strtolower
(
$this
->
trimQuotes
(
$columnName
));
$columnName
=
strtolower
(
$this
->
trimQuotes
(
$columnName
));
if
(
!
$this
->
hasColumn
(
$columnName
))
{
if
(
!
$this
->
hasColumn
(
$columnName
))
{
throw
SchemaException
::
columnDoesNotExist
(
$columnName
,
$this
->
_name
);
throw
SchemaException
::
columnDoesNotExist
(
$columnName
,
$this
->
_name
);
}
}
...
@@ -561,7 +561,7 @@ class Table extends AbstractAsset
...
@@ -561,7 +561,7 @@ class Table extends AbstractAsset
*/
*/
public
function
getPrimaryKey
()
public
function
getPrimaryKey
()
{
{
if
(
!
$this
->
hasPrimaryKey
())
{
if
(
!
$this
->
hasPrimaryKey
())
{
return
null
;
return
null
;
}
}
return
$this
->
getIndex
(
$this
->
_primaryKeyName
);
return
$this
->
getIndex
(
$this
->
_primaryKeyName
);
...
@@ -594,7 +594,7 @@ class Table extends AbstractAsset
...
@@ -594,7 +594,7 @@ class Table extends AbstractAsset
public
function
getIndex
(
$indexName
)
public
function
getIndex
(
$indexName
)
{
{
$indexName
=
strtolower
(
$indexName
);
$indexName
=
strtolower
(
$indexName
);
if
(
!
$this
->
hasIndex
(
$indexName
))
{
if
(
!
$this
->
hasIndex
(
$indexName
))
{
throw
SchemaException
::
indexDoesNotExist
(
$indexName
,
$this
->
_name
);
throw
SchemaException
::
indexDoesNotExist
(
$indexName
,
$this
->
_name
);
}
}
return
$this
->
_indexes
[
$indexName
];
return
$this
->
_indexes
[
$indexName
];
...
...
lib/Doctrine/DBAL/Tools/Console/Command/ReservedWordsCommand.php
View file @
8c9e9e81
...
@@ -97,7 +97,7 @@ EOT
...
@@ -97,7 +97,7 @@ EOT
$conn
=
$this
->
getHelper
(
'db'
)
->
getConnection
();
$conn
=
$this
->
getHelper
(
'db'
)
->
getConnection
();
$keywordLists
=
(
array
)
$input
->
getOption
(
'list'
);
$keywordLists
=
(
array
)
$input
->
getOption
(
'list'
);
if
(
!
$keywordLists
)
{
if
(
!
$keywordLists
)
{
$keywordLists
=
array
(
'mysql'
,
'pgsql'
,
'sqlite'
,
'oracle'
,
'mssql'
);
$keywordLists
=
array
(
'mysql'
,
'pgsql'
,
'sqlite'
,
'oracle'
,
'mssql'
);
}
}
...
...
lib/Doctrine/DBAL/Types/DateTimeType.php
View file @
8c9e9e81
...
@@ -51,7 +51,7 @@ class DateTimeType extends Type
...
@@ -51,7 +51,7 @@ class DateTimeType extends Type
}
}
$val
=
\DateTime
::
createFromFormat
(
$platform
->
getDateTimeFormatString
(),
$value
);
$val
=
\DateTime
::
createFromFormat
(
$platform
->
getDateTimeFormatString
(),
$value
);
if
(
!
$val
)
{
if
(
!
$val
)
{
throw
ConversionException
::
conversionFailedFormat
(
$value
,
$this
->
getName
(),
$platform
->
getDateTimeFormatString
());
throw
ConversionException
::
conversionFailedFormat
(
$value
,
$this
->
getName
(),
$platform
->
getDateTimeFormatString
());
}
}
return
$val
;
return
$val
;
...
...
lib/Doctrine/DBAL/Types/DateTimeTzType.php
View file @
8c9e9e81
...
@@ -71,7 +71,7 @@ class DateTimeTzType extends Type
...
@@ -71,7 +71,7 @@ class DateTimeTzType extends Type
}
}
$val
=
\DateTime
::
createFromFormat
(
$platform
->
getDateTimeTzFormatString
(),
$value
);
$val
=
\DateTime
::
createFromFormat
(
$platform
->
getDateTimeTzFormatString
(),
$value
);
if
(
!
$val
)
{
if
(
!
$val
)
{
throw
ConversionException
::
conversionFailedFormat
(
$value
,
$this
->
getName
(),
$platform
->
getDateTimeTzFormatString
());
throw
ConversionException
::
conversionFailedFormat
(
$value
,
$this
->
getName
(),
$platform
->
getDateTimeTzFormatString
());
}
}
return
$val
;
return
$val
;
...
...
lib/Doctrine/DBAL/Types/DateType.php
View file @
8c9e9e81
...
@@ -51,7 +51,7 @@ class DateType extends Type
...
@@ -51,7 +51,7 @@ class DateType extends Type
}
}
$val
=
\DateTime
::
createFromFormat
(
'!'
.
$platform
->
getDateFormatString
(),
$value
);
$val
=
\DateTime
::
createFromFormat
(
'!'
.
$platform
->
getDateFormatString
(),
$value
);
if
(
!
$val
)
{
if
(
!
$val
)
{
throw
ConversionException
::
conversionFailedFormat
(
$value
,
$this
->
getName
(),
$platform
->
getDateFormatString
());
throw
ConversionException
::
conversionFailedFormat
(
$value
,
$this
->
getName
(),
$platform
->
getDateFormatString
());
}
}
return
$val
;
return
$val
;
...
...
lib/Doctrine/DBAL/Types/TimeType.php
View file @
8c9e9e81
...
@@ -60,7 +60,7 @@ class TimeType extends Type
...
@@ -60,7 +60,7 @@ class TimeType extends Type
}
}
$val
=
\DateTime
::
createFromFormat
(
$platform
->
getTimeFormatString
(),
$value
);
$val
=
\DateTime
::
createFromFormat
(
$platform
->
getTimeFormatString
(),
$value
);
if
(
!
$val
)
{
if
(
!
$val
)
{
throw
ConversionException
::
conversionFailedFormat
(
$value
,
$this
->
getName
(),
$platform
->
getTimeFormatString
());
throw
ConversionException
::
conversionFailedFormat
(
$value
,
$this
->
getName
(),
$platform
->
getTimeFormatString
());
}
}
return
$val
;
return
$val
;
...
...
lib/Doctrine/DBAL/Types/VarDateTimeType.php
View file @
8c9e9e81
...
@@ -52,7 +52,7 @@ class VarDateTimeType extends DateTimeType
...
@@ -52,7 +52,7 @@ class VarDateTimeType extends DateTimeType
}
}
$val
=
date_create
(
$value
);
$val
=
date_create
(
$value
);
if
(
!
$val
)
{
if
(
!
$val
)
{
throw
ConversionException
::
conversionFailed
(
$value
,
$this
->
getName
());
throw
ConversionException
::
conversionFailed
(
$value
,
$this
->
getName
());
}
}
return
$val
;
return
$val
;
...
...
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