Skip to content

Instantly share code, notes, and snippets.

@nanasess
Last active August 29, 2015 14:19
Show Gist options
  • Save nanasess/e40a7b0ea447b5043940 to your computer and use it in GitHub Desktop.
Save nanasess/e40a7b0ea447b5043940 to your computer and use it in GitHub Desktop.
Doctrine DBAL on Oracle XE 11g of patch.
--- a/lib/Doctrine/DBAL/Driver/AbstractOracleDriver.php
+++ b/lib/Doctrine/DBAL/Driver/AbstractOracleDriver.php
@@ -117,7 +117,7 @@ abstract class AbstractOracleDriver implements Driver, ExceptionConverterDriver
if ( ! isset($params['port'])) {
$params['port'] = 1521;
}
-
+ $params['service'] = true;
$serviceName = $params['dbname'];
if ( ! empty($params['servicename'])) {
Modified lib/Doctrine/DBAL/Schema/AbstractAsset.php
diff --git a/lib/Doctrine/DBAL/Schema/AbstractAsset.php b/lib/Doctrine/DBAL/Schema/AbstractAsset.php
index 051dce9..6ba9791 100644
--- a/lib/Doctrine/DBAL/Schema/AbstractAsset.php
+++ b/lib/Doctrine/DBAL/Schema/AbstractAsset.php
@@ -155,7 +155,8 @@ abstract class AbstractAsset
*/
protected function isIdentifierQuoted($identifier)
{
- return (isset($identifier[0]) && ($identifier[0] == '`' || $identifier[0] == '"' || $identifier[0] == '['));
+ // return (isset($identifier[0]) && ($identifier[0] == '`' || $identifier[0] == '"' || $identifier[0] == '['));
+ return false;
}
/**
Modified tests/Doctrine/Tests/TestUtil.php
<?xml version="1.0" encoding="utf-8"?>
<!--
Use this configuration file as a template to run the tests against any dbms.
Procedure:
1) Save a copy of this file with a name of your chosing. It doesn't matter
where you place it as long as you know where it is.
i.e. "mysqlconf.xml" (It needs the ending .xml).
2) Edit the file and fill in your settings (database name, type, username, etc.)
Just change the "value"s, not the names of the var elements.
3) To run the tests against the database type the following from within the
tests/ folder: phpunit -c <filename> ...
Example: phpunit -c mysqlconf.xml
-->
<phpunit backupGlobals="false"
backupStaticAttributes="false"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
bootstrap="./tests/Doctrine/Tests/TestInit.php"
>
<php>
<!-- Database for temporary connections (i.e. to drop/create the main database) -->
<var name="tmpdb_type" value="oci8"/>
<var name="tmpdb_host" value="localhost" />
<var name="tmpdb_username" value="scott" />
<var name="tmpdb_password" value="tiger" />
<var name="tmpdb_name" value="orcl.hostname.local" />
<var name="tmpdb_port" value="1521"/>
<var name="db_type" value="oci8"/>
<var name="db_host" value="localhost" />
<var name="db_username" value="scott2" />
<var name="db_password" value="tiger" />
<var name="db_name" value="orcl.hostname.local" />
<var name="db_event_subscribers" value="Doctrine\DBAL\Event\Listeners\OracleSessionInit"/>
<var name="charset" value="AL32UTF8" />
<var name="db_port" value="1521"/>
</php>
<testsuites>
<testsuite name="Doctrine DBAL Test Suite">
<directory>./tests/Doctrine/Tests/DBAL</directory>
</testsuite>
</testsuites>
</phpunit>
@nanasess
Copy link
Author

phpunit.xml から service = true を渡せない模様。デフォルトで SID 接続となってしまう。

@nanasess
Copy link
Author

FAILURES!
Tests: 3410, Assertions: 6842, Failures: 169, Errors: 4, Incomplete: 11, Skipped: 418.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment