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
ab57a010
Commit
ab57a010
authored
Jul 05, 2012
by
Benjamin Eberlei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[DBAL-243] Remove Connection#setCharset()
parent
7beb634d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
24 deletions
+15
-24
UPGRADE
UPGRADE
+15
-0
Connection.php
lib/Doctrine/DBAL/Connection.php
+0
-10
AbstractPlatform.php
lib/Doctrine/DBAL/Platforms/AbstractPlatform.php
+0
-14
No files found.
UPGRADE
View file @
ab57a010
# Upgrade to 2.3
## Doctrine\DBAL\Connection#setCharsetSQL() removed
This method only worked on MySQL and it is considered unsafe on MySQL to use SET NAMES UTF-8 instead
of setting the charset directly on connection already. Replace this behavior with the
connection charset option:
Before:
$conn = DriverManager::getConnection(array(..));
$conn->setCharset('UTF8');
After:
$conn = DriverManager::getConnection(array('charset' => 'UTF8', ..));
## Doctrine\DBAL\Schema\Table#renameColumn() removed
Doctrine\DBAL\Schema\Table#renameColumn() was removed, because it drops and recreates
...
...
lib/Doctrine/DBAL/Connection.php
View file @
ab57a010
...
...
@@ -539,16 +539,6 @@ class Connection implements DriverConnection
return
$this
->
executeUpdate
(
$query
,
array_values
(
$data
),
$types
);
}
/**
* Sets the given charset on the current connection.
*
* @param string $charset The charset to set.
*/
public
function
setCharset
(
$charset
)
{
$this
->
executeUpdate
(
$this
->
_platform
->
getSetCharsetSQL
(
$charset
));
}
/**
* Quote a string so it can be safely used as a table or column name, even if
* it is a reserved name.
...
...
lib/Doctrine/DBAL/Platforms/AbstractPlatform.php
View file @
ab57a010
...
...
@@ -2092,20 +2092,6 @@ abstract class AbstractPlatform
return
$item
;
}
/**
* Gets the SQL statement specific for the platform to set the charset.
*
* This function is MySQL specific and required by
* {@see \Doctrine\DBAL\Connection::setCharset($charset)}
*
* @param string $charset
* @return string
*/
public
function
getSetCharsetSQL
(
$charset
)
{
return
"SET NAMES '"
.
$charset
.
"'"
;
}
/**
* Gets the SQL specific for the platform to get the current date.
*
...
...
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