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
0c74527d
Unverified
Commit
0c74527d
authored
Dec 24, 2017
by
Marco Pivetta
Committed by
GitHub
Dec 24, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2950 from Majkl578/remove-quirks
Removed pre-7.1 quirks
parents
5e9cdb40
3366dfd4
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
2 additions
and
79 deletions
+2
-79
DriverManager.php
lib/Doctrine/DBAL/DriverManager.php
+1
-10
JsonType.php
lib/Doctrine/DBAL/Types/JsonType.php
+1
-41
ConnectionTest.php
tests/Doctrine/Tests/DBAL/Functional/ConnectionTest.php
+0
-4
DBAL630Test.php
tests/Doctrine/Tests/DBAL/Functional/Ticket/DBAL630Test.php
+0
-24
No files found.
lib/Doctrine/DBAL/DriverManager.php
View file @
0c74527d
...
@@ -244,16 +244,7 @@ final class DriverManager
...
@@ -244,16 +244,7 @@ final class DriverManager
// (pdo_)?sqlite3?:///... => (pdo_)?sqlite3?://localhost/... or else the URL will be invalid
// (pdo_)?sqlite3?:///... => (pdo_)?sqlite3?://localhost/... or else the URL will be invalid
$url
=
preg_replace
(
'#^((?:pdo_)?sqlite3?):///#'
,
'$1://localhost/'
,
$params
[
'url'
]);
$url
=
preg_replace
(
'#^((?:pdo_)?sqlite3?):///#'
,
'$1://localhost/'
,
$params
[
'url'
]);
// PHP < 5.4.8 doesn't parse schemeless urls properly.
// See: https://php.net/parse-url#refsect1-function.parse-url-changelog
if
(
PHP_VERSION_ID
<
50408
&&
strpos
(
$url
,
'//'
)
===
0
)
{
$url
=
parse_url
(
'fake:'
.
$url
);
unset
(
$url
[
'scheme'
]);
}
else
{
$url
=
parse_url
(
$url
);
$url
=
parse_url
(
$url
);
}
if
(
$url
===
false
)
{
if
(
$url
===
false
)
{
throw
new
DBALException
(
'Malformed parameter "url".'
);
throw
new
DBALException
(
'Malformed parameter "url".'
);
...
...
lib/Doctrine/DBAL/Types/JsonType.php
View file @
0c74527d
...
@@ -49,7 +49,7 @@ class JsonType extends Type
...
@@ -49,7 +49,7 @@ class JsonType extends Type
$encoded
=
json_encode
(
$value
);
$encoded
=
json_encode
(
$value
);
if
(
JSON_ERROR_NONE
!==
json_last_error
())
{
if
(
JSON_ERROR_NONE
!==
json_last_error
())
{
throw
ConversionException
::
conversionFailedSerialization
(
$value
,
'json'
,
$this
->
getLastErrorMessage
());
throw
ConversionException
::
conversionFailedSerialization
(
$value
,
'json'
,
json_last_error_msg
());
}
}
return
$encoded
;
return
$encoded
;
...
@@ -92,44 +92,4 @@ class JsonType extends Type
...
@@ -92,44 +92,4 @@ class JsonType extends Type
{
{
return
!
$platform
->
hasNativeJsonType
();
return
!
$platform
->
hasNativeJsonType
();
}
}
/**
* Get the latest json error message
*
* This method declaration has been extracted from symfony's php 5.5 polyfill
*
* @link https://github.com/symfony/polyfill-php55/blob/master/Php55.php
* @link http://nl1.php.net/manual/en/function.json-last-error-msg.php
*
* @return string
*/
private
function
getLastErrorMessage
()
{
if
(
function_exists
(
'json_last_error_msg'
))
{
return
json_last_error_msg
();
}
switch
(
json_last_error
())
{
case
JSON_ERROR_NONE
:
return
'No error'
;
case
JSON_ERROR_DEPTH
:
return
'Maximum stack depth exceeded'
;
case
JSON_ERROR_STATE_MISMATCH
:
return
'State mismatch (invalid or malformed JSON)'
;
case
JSON_ERROR_CTRL_CHAR
:
return
'Control character error, possibly incorrectly encoded'
;
case
JSON_ERROR_SYNTAX
:
return
'Syntax error'
;
case
JSON_ERROR_UTF8
:
return
'Malformed UTF-8 characters, possibly incorrectly encoded'
;
default
:
return
'Unknown error'
;
}
}
}
}
tests/Doctrine/Tests/DBAL/Functional/ConnectionTest.php
View file @
0c74527d
...
@@ -206,10 +206,6 @@ class ConnectionTest extends \Doctrine\Tests\DbalFunctionalTestCase
...
@@ -206,10 +206,6 @@ class ConnectionTest extends \Doctrine\Tests\DbalFunctionalTestCase
public
function
testTransactionalWithThrowable
()
public
function
testTransactionalWithThrowable
()
{
{
if
(
version_compare
(
PHP_VERSION
,
'7.0'
,
'<'
))
{
$this
->
markTestSkipped
(
'Only for PHP 7.0 and above.'
);
}
try
{
try
{
$this
->
_conn
->
transactional
(
function
(
$conn
)
{
$this
->
_conn
->
transactional
(
function
(
$conn
)
{
/* @var $conn \Doctrine\DBAL\Connection */
/* @var $conn \Doctrine\DBAL\Connection */
...
...
tests/Doctrine/Tests/DBAL/Functional/Ticket/DBAL630Test.php
View file @
0c74527d
...
@@ -34,12 +34,6 @@ class DBAL630Test extends \Doctrine\Tests\DbalFunctionalTestCase
...
@@ -34,12 +34,6 @@ class DBAL630Test extends \Doctrine\Tests\DbalFunctionalTestCase
{
{
if
(
$this
->
running
)
{
if
(
$this
->
running
)
{
$this
->
_conn
->
getWrappedConnection
()
->
setAttribute
(
PDO
::
ATTR_EMULATE_PREPARES
,
false
);
$this
->
_conn
->
getWrappedConnection
()
->
setAttribute
(
PDO
::
ATTR_EMULATE_PREPARES
,
false
);
// PDO::PGSQL_ATTR_DISABLE_NATIVE_PREPARED_STATEMENT is deprecated in php 5.6. PDO::ATTR_EMULATE_PREPARES should
// be used instead. so should only it be set when it is supported.
if
(
PHP_VERSION_ID
<
50600
)
{
$this
->
_conn
->
getWrappedConnection
()
->
setAttribute
(
PDO
::
PGSQL_ATTR_DISABLE_NATIVE_PREPARED_STATEMENT
,
false
);
}
}
}
parent
::
tearDown
();
parent
::
tearDown
();
...
@@ -71,12 +65,6 @@ class DBAL630Test extends \Doctrine\Tests\DbalFunctionalTestCase
...
@@ -71,12 +65,6 @@ class DBAL630Test extends \Doctrine\Tests\DbalFunctionalTestCase
{
{
$this
->
_conn
->
getWrappedConnection
()
->
setAttribute
(
PDO
::
ATTR_EMULATE_PREPARES
,
true
);
$this
->
_conn
->
getWrappedConnection
()
->
setAttribute
(
PDO
::
ATTR_EMULATE_PREPARES
,
true
);
// PDO::PGSQL_ATTR_DISABLE_NATIVE_PREPARED_STATEMENT is deprecated in php 5.6. PDO::ATTR_EMULATE_PREPARES should
// be used instead. so should only it be set when it is supported.
if
(
PHP_VERSION_ID
<
50600
)
{
$this
->
_conn
->
getWrappedConnection
()
->
setAttribute
(
PDO
::
PGSQL_ATTR_DISABLE_NATIVE_PREPARED_STATEMENT
,
true
);
}
$platform
=
$this
->
_conn
->
getDatabasePlatform
();
$platform
=
$this
->
_conn
->
getDatabasePlatform
();
$stmt
=
$this
->
_conn
->
prepare
(
'INSERT INTO dbal630 (bool_col) VALUES(?)'
);
$stmt
=
$this
->
_conn
->
prepare
(
'INSERT INTO dbal630 (bool_col) VALUES(?)'
);
...
@@ -101,12 +89,6 @@ class DBAL630Test extends \Doctrine\Tests\DbalFunctionalTestCase
...
@@ -101,12 +89,6 @@ class DBAL630Test extends \Doctrine\Tests\DbalFunctionalTestCase
)
{
)
{
$this
->
_conn
->
getWrappedConnection
()
->
setAttribute
(
PDO
::
ATTR_EMULATE_PREPARES
,
true
);
$this
->
_conn
->
getWrappedConnection
()
->
setAttribute
(
PDO
::
ATTR_EMULATE_PREPARES
,
true
);
// PDO::PGSQL_ATTR_DISABLE_NATIVE_PREPARED_STATEMENT is deprecated in php 5.6. PDO::ATTR_EMULATE_PREPARES should
// be used instead. so should only it be set when it is supported.
if
(
PHP_VERSION_ID
<
50600
)
{
$this
->
_conn
->
getWrappedConnection
()
->
setAttribute
(
PDO
::
PGSQL_ATTR_DISABLE_NATIVE_PREPARED_STATEMENT
,
true
);
}
$platform
=
$this
->
_conn
->
getDatabasePlatform
();
$platform
=
$this
->
_conn
->
getDatabasePlatform
();
$stmt
=
$this
->
_conn
->
prepare
(
'INSERT INTO dbal630_allow_nulls (bool_col) VALUES(?)'
);
$stmt
=
$this
->
_conn
->
prepare
(
'INSERT INTO dbal630_allow_nulls (bool_col) VALUES(?)'
);
...
@@ -131,12 +113,6 @@ class DBAL630Test extends \Doctrine\Tests\DbalFunctionalTestCase
...
@@ -131,12 +113,6 @@ class DBAL630Test extends \Doctrine\Tests\DbalFunctionalTestCase
)
{
)
{
$this
->
_conn
->
getWrappedConnection
()
->
setAttribute
(
PDO
::
ATTR_EMULATE_PREPARES
,
true
);
$this
->
_conn
->
getWrappedConnection
()
->
setAttribute
(
PDO
::
ATTR_EMULATE_PREPARES
,
true
);
// PDO::PGSQL_ATTR_DISABLE_NATIVE_PREPARED_STATEMENT is deprecated in php 5.6. PDO::ATTR_EMULATE_PREPARES should
// be used instead. so should only it be set when it is supported.
if
(
PHP_VERSION_ID
<
50600
)
{
$this
->
_conn
->
getWrappedConnection
()
->
setAttribute
(
PDO
::
PGSQL_ATTR_DISABLE_NATIVE_PREPARED_STATEMENT
,
true
);
}
$platform
=
$this
->
_conn
->
getDatabasePlatform
();
$platform
=
$this
->
_conn
->
getDatabasePlatform
();
$stmt
=
$this
->
_conn
->
prepare
(
'INSERT INTO dbal630_allow_nulls (bool_col) VALUES(?)'
);
$stmt
=
$this
->
_conn
->
prepare
(
'INSERT INTO dbal630_allow_nulls (bool_col) VALUES(?)'
);
...
...
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