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
dd285a63
Commit
dd285a63
authored
May 14, 2011
by
Benjamin Eberlei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DBAL-111 - Add details about charset option and remove mention of @deprecated MysqlSessionInit.
parent
625be9a8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
7 deletions
+15
-7
configuration.rst
en/reference/configuration.rst
+2
-0
events.rst
en/reference/events.rst
+4
-6
security.rst
en/reference/security.rst
+9
-1
No files found.
en/reference/configuration.rst
View file @
dd285a63
...
@@ -104,6 +104,8 @@ pdo\_mysql
...
@@ -104,6 +104,8 @@ pdo\_mysql
- ``dbname`` (string): Name of the database/schema to connect to.
- ``dbname`` (string): Name of the database/schema to connect to.
- ``unix_socket`` (string): Name of the socket used to connect to
- ``unix_socket`` (string): Name of the socket used to connect to
the database.
the database.
- ``charset`` (string): The charset used when connecting to the
database.
pdo\_pgsql
pdo\_pgsql
^^^^^^^^^^
^^^^^^^^^^
...
...
en/reference/events.rst
View file @
dd285a63
...
@@ -18,16 +18,12 @@ connection management via an instance of
...
@@ -18,16 +18,12 @@ connection management via an instance of
``Doctrine\DBAL\Event\ConnectionEventArgs`` event arguments
``Doctrine\DBAL\Event\ConnectionEventArgs`` event arguments
instance.
instance.
Doctrine is already shipped with two implementations for the
Doctrine ships with one implementation for the "PostConnect" event:
"PostConnect" event:
- ``Doctrine\DBAL\Event\Listeners\OracleSessionInit`` allows to
- ``Doctrine\DBAL\Event\Listeners\OracleSessionInit`` allows to
specify any number of Oracle Session related enviroment variables
specify any number of Oracle Session related enviroment variables
that are set right after the connection is established.
that are set right after the connection is established.
- ``Doctrine\DBAL\Event\Listeners\MysqlSessionInit`` allows to
specify the Charset and Collation of the Client Connection if these
options are not configured correctly on the MySQL server side.
You can register events by subscribing them to the ``EventManager``
You can register events by subscribing them to the ``EventManager``
instance passed to the Connection factory:
instance passed to the Connection factory:
...
@@ -36,7 +32,9 @@ instance passed to the Connection factory:
...
@@ -36,7 +32,9 @@ instance passed to the Connection factory:
<?php
<?php
$evm = new EventManager();
$evm = new EventManager();
$evm->addEventSubscriber(new MysqlSessionInit('UTF8'));
$evm->addEventSubscriber(new OracleSessionInit(array(
'NLS_TIME_FORMAT' => 'HH24:MI:SS',
));
$conn = DriverManager::getConnection($connectionParams, null, $evm);
$conn = DriverManager::getConnection($connectionParams, null, $evm);
...
...
en/reference/security.rst
View file @
dd285a63
...
@@ -128,4 +128,12 @@ Non-ASCII compatible Charsets in MySQL
...
@@ -128,4 +128,12 @@ Non-ASCII compatible Charsets in MySQL
Up until PHP 5.3.6 PDO has a security problem when using non ascii compatible charsets. Even if specifying
Up until PHP 5.3.6 PDO has a security problem when using non ascii compatible charsets. Even if specifying
the charset using "SET NAMES", emulated prepared statements and ``PDO#quote`` could not reliably escape
the charset using "SET NAMES", emulated prepared statements and ``PDO#quote`` could not reliably escape
values, opening up to potential SQL injections. If you are running PHP 5.3.6 you can solve this issue
values, opening up to potential SQL injections. If you are running PHP 5.3.6 you can solve this issue
by passing the driver option "charset" to Doctrine PDO MySQL driver. Using SET NAMES does not suffice!
by passing the driver option "charset" to Doctrine PDO MySQL driver. Using SET NAMES does not suffice!
\ No newline at end of file
.. code-block::
<?php
$conn = DriverManager::getConnection(array(
'driver' => 'pdo_mysql',
'charset' => 'UTF8',
));
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