<?xml version="1.0"?>
<?xml-stylesheet 
 href="http://www.w3.org/2000/08/w3c-synd/style.css" type="text/css"
?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel rdf:about="http://pear.php.net/bugs/7216/bug">
    <title>PEAR Bug #7216</title>
    <link>http://pear.php.net/bugs/7216</link>
    <description>[Closed] OCI8 module ignores non-standard port</description>
    <dc:language>en-us</dc:language>
    <dc:creator>pear-webmaster@lists.php.net</dc:creator>
    <dc:publisher>pear-webmaster@lists.php.net</dc:publisher>
    <admin:generatorAgent rdf:resource="http://pear.php.net/bugs"/>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase>
    <items>
     <rdf:Seq>
      <rdf:li rdf:resource="http://pear.php.net/bugs/7216"/>
      <rdf:li rdf:resource="http://pear.php.net/bugs/7216/2007-01-10+21%3A16%3A11#2007-01-10+21%3A16%3A11"/>
      <rdf:li rdf:resource="http://pear.php.net/bugs/7216/2006-04-15+06%3A41%3A59#2006-04-15+06%3A41%3A59"/>
      <rdf:li rdf:resource="http://pear.php.net/bugs/7216/2006-04-05+11%3A13%3A16#2006-04-05+11%3A13%3A16"/>
      <rdf:li rdf:resource="http://pear.php.net/bugs/7216/2006-04-04+07%3A36%3A16#2006-04-04+07%3A36%3A16"/>
      <rdf:li rdf:resource="http://pear.php.net/bugs/7216/2006-03-30+14%3A28%3A59#2006-03-30+14%3A28%3A59"/>
      <rdf:li rdf:resource="http://pear.php.net/bugs/7216/2006-03-28+11%3A23%3A37#2006-03-28+11%3A23%3A37"/>
      <rdf:li rdf:resource="http://pear.php.net/bugs/7216/2006-03-27+09%3A07%3A13#2006-03-27+09%3A07%3A13"/>
     </rdf:Seq>
    </items>
  </channel>
    <item rdf:about="http://pear.php.net/bugs/7216">
      <title>andrew_kerr@... [2006-03-27 08:57:17]</title>
      <link>http://pear.php.net/bugs/7216</link>
      <description><![CDATA[<pre>DB Bug
Reported by andrew_kerr@...
2006-03-27T13:57:17-00:00
PHP: 4.4.2 OS: Linux (RHEL4) Package Version: 1.7.6

Description:
------------
The OCI8 module will always attempt to connect to port 1521, even if a different port is specified in the DSN.

Test script:
---------------
$dsn = 'oci8://user:pass@10.10.10.1:1522/dbname';
$db =&amp; DB::connect($dsn);
if (DB::isError($db)) {
  echo &quot;Failed connection\n&quot;;
}

Expected result:
----------------
No error message.

Actual result:
--------------
Failed connection.
A tcpdump shows that it is trying to connect on the default port (1521)</pre>]]></description>
      <content:encoded><![CDATA[<pre>DB Bug
Reported by andrew_kerr@...
2006-03-27T13:57:17-00:00
PHP: 4.4.2 OS: Linux (RHEL4) Package Version: 1.7.6

Description:
------------
The OCI8 module will always attempt to connect to port 1521, even if a different port is specified in the DSN.

Test script:
---------------
$dsn = 'oci8://user:pass@10.10.10.1:1522/dbname';
$db =&amp; DB::connect($dsn);
if (DB::isError($db)) {
  echo &quot;Failed connection\n&quot;;
}

Expected result:
----------------
No error message.

Actual result:
--------------
Failed connection.
A tcpdump shows that it is trying to connect on the default port (1521)</pre>]]></content:encoded>
      <dc:date>2006-03-27T13:57:17-00:00</dc:date>
    </item>
    <item rdf:about="http://pear.php.net/bugs/7216/2007-01-10+21%3A16%3A11#2007-01-10+21%3A16%3A11">
      <title>aharvey [2007-01-11 02:16]</title>
      <link>http://pear.php.net/bugs/7216#1168481771</link>
      <description><![CDATA[<pre>This bug has been fixed in CVS.

If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET).

If this was a problem with the pear.php.net website, the change should be live shortly.

Otherwise, the fix will appear in the package's next release.

Thank you for the report and for helping us make PEAR better.</pre>]]></description>
      <content:encoded><![CDATA[<pre>This bug has been fixed in CVS.

If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET).

If this was a problem with the pear.php.net website, the change should be live shortly.

Otherwise, the fix will appear in the package's next release.

Thank you for the report and for helping us make PEAR better.</pre>]]></content:encoded>
      <dc:date>2007-01-11T02:16:11-00:00</dc:date>
    </item>
    <item rdf:about="http://pear.php.net/bugs/7216/2006-04-15+06%3A41%3A59#2006-04-15+06%3A41%3A59">
      <title>lsmith [2006-04-15 10:41]</title>
      <link>http://pear.php.net/bugs/7216#1145097719</link>
      <description><![CDATA[<pre>actually the following is propably right

+            if (isset($this-&gt;dsn['port']) &amp;&amp; $this-&gt;dsn['port']) {
+                $db = '//'.$db.':'.$this-&gt;dsn['port'];
+            }</pre>]]></description>
      <content:encoded><![CDATA[<pre>actually the following is propably right

+            if (isset($this-&gt;dsn['port']) &amp;&amp; $this-&gt;dsn['port']) {
+                $db = '//'.$db.':'.$this-&gt;dsn['port'];
+            }</pre>]]></content:encoded>
      <dc:date>2006-04-15T10:41:59-00:00</dc:date>
    </item>
    <item rdf:about="http://pear.php.net/bugs/7216/2006-04-05+11%3A13%3A16#2006-04-05+11%3A13%3A16">
      <title>lsmith [2006-04-05 15:13]</title>
      <link>http://pear.php.net/bugs/7216#1144249996</link>
      <description><![CDATA[<pre>I have commited the change in MDB2 .. here is the proposed patch for DB

retrieving revision 1.103
diff -u -r1.103 oci8.php
--- oci8.php	11 Apr 2005 15:10:22 -0000	1.103
+++ oci8.php	30 Mar 2006 19:28:11 -0000
@@ -232,6 +232,9 @@
             } else {
                 $db = $dsn['database'];
             }
+            if (isset($this-&gt;dsn['port'])) {
+                $db = '//'.$db.':'.$this-&gt;dsn['port'];
+            }</pre>]]></description>
      <content:encoded><![CDATA[<pre>I have commited the change in MDB2 .. here is the proposed patch for DB

retrieving revision 1.103
diff -u -r1.103 oci8.php
--- oci8.php	11 Apr 2005 15:10:22 -0000	1.103
+++ oci8.php	30 Mar 2006 19:28:11 -0000
@@ -232,6 +232,9 @@
             } else {
                 $db = $dsn['database'];
             }
+            if (isset($this-&gt;dsn['port'])) {
+                $db = '//'.$db.':'.$this-&gt;dsn['port'];
+            }</pre>]]></content:encoded>
      <dc:date>2006-04-05T15:13:16-00:00</dc:date>
    </item>
    <item rdf:about="http://pear.php.net/bugs/7216/2006-04-04+07%3A36%3A16#2006-04-04+07%3A36%3A16">
      <title>tom@... [2006-04-04 11:36]</title>
      <link>http://pear.php.net/bugs/7216#1144150576</link>
      <description><![CDATA[<pre>I can confirm that:

$dbtype=&quot;oci8&quot;;

$dbuser=&quot;user&quot;;

$dbpass=&quot;pass&quot;;

$dbhost=&quot;///host&quot;;
$dbport=&quot;port&quot;;

$dbname=&quot;dbname&quot;;


works fine. I'm appending the port as well, as in my case, I'm using a non-standard port.

$oradsn=&quot;$dbtype://$dbuser:$dbpass@$dbhost:$dbport/$dbname&quot;;

Thanks, Tom</pre>]]></description>
      <content:encoded><![CDATA[<pre>I can confirm that:

$dbtype=&quot;oci8&quot;;

$dbuser=&quot;user&quot;;

$dbpass=&quot;pass&quot;;

$dbhost=&quot;///host&quot;;
$dbport=&quot;port&quot;;

$dbname=&quot;dbname&quot;;


works fine. I'm appending the port as well, as in my case, I'm using a non-standard port.

$oradsn=&quot;$dbtype://$dbuser:$dbpass@$dbhost:$dbport/$dbname&quot;;

Thanks, Tom</pre>]]></content:encoded>
      <dc:date>2006-04-04T11:36:16-00:00</dc:date>
    </item>
    <item rdf:about="http://pear.php.net/bugs/7216/2006-03-30+14%3A28%3A59#2006-03-30+14%3A28%3A59">
      <title>lsmith [2006-03-30 19:28]</title>
      <link>http://pear.php.net/bugs/7216#1143746939</link>
      <description><![CDATA[<pre>I am proposing the following change in the code:
Today if you want to use the easy connect syntax you would specifiy the entire easy connect string in the hostspec or database ('//hostname:port' or '//hostname').

With the change you could alternatively set the hostname either in the hostspec or database and if you also specify a port then an easy connect string would be assembled as you can see above.</pre>]]></description>
      <content:encoded><![CDATA[<pre>I am proposing the following change in the code:
Today if you want to use the easy connect syntax you would specifiy the entire easy connect string in the hostspec or database ('//hostname:port' or '//hostname').

With the change you could alternatively set the hostname either in the hostspec or database and if you also specify a port then an easy connect string would be assembled as you can see above.</pre>]]></content:encoded>
      <dc:date>2006-03-30T19:28:59-00:00</dc:date>
    </item>
    <item rdf:about="http://pear.php.net/bugs/7216/2006-03-28+11%3A23%3A37#2006-03-28+11%3A23%3A37">
      <title>tom@... [2006-03-28 16:23]</title>
      <link>http://pear.php.net/bugs/7216#1143563017</link>
      <description><![CDATA[<pre>I'm not sure I understand what you're asking us to do to verify this bug and/or a workaround.

You say &quot;if no port is specified it would simply use
[hostspec]&quot;, but the whole point is that we are trying to use a port. Can you advise what string to pass as a $dsn to connect using an instantclient when using an alternate port?

Thanks, Tom</pre>]]></description>
      <content:encoded><![CDATA[<pre>I'm not sure I understand what you're asking us to do to verify this bug and/or a workaround.

You say &quot;if no port is specified it would simply use
[hostspec]&quot;, but the whole point is that we are trying to use a port. Can you advise what string to pass as a $dsn to connect using an instantclient when using an alternate port?

Thanks, Tom</pre>]]></content:encoded>
      <dc:date>2006-03-28T16:23:37-00:00</dc:date>
    </item>
    <item rdf:about="http://pear.php.net/bugs/7216/2006-03-27+09%3A07%3A13#2006-03-27+09%3A07%3A13">
      <title>lsmith [2006-03-27 14:07]</title>
      <link>http://pear.php.net/bugs/7216#1143468433</link>
      <description><![CDATA[<pre>Hmm .. specifying a port is only allowed with the easy connect syntax, or am I mistaken?

so in that case the it should use:
//[hostspec]:[port]

if no port is specified it would simply use
[hostspec]

so if you want to use the easy connect syntax with the default port then you woulld need to include the &quot;//&quot; in the hostspec .. (actually one would need &quot;///&quot;)

can you verify this analysis?</pre>]]></description>
      <content:encoded><![CDATA[<pre>Hmm .. specifying a port is only allowed with the easy connect syntax, or am I mistaken?

so in that case the it should use:
//[hostspec]:[port]

if no port is specified it would simply use
[hostspec]

so if you want to use the easy connect syntax with the default port then you woulld need to include the &quot;//&quot; in the hostspec .. (actually one would need &quot;///&quot;)

can you verify this analysis?</pre>]]></content:encoded>
      <dc:date>2006-03-27T14:07:13-00:00</dc:date>
    </item>
</rdf:RDF>