This topic is locked

Oracle connection

5/7/2018 8:27:59 AM
PHPRunner General questions
D
dcrera author

I have an application developed in Phprunner V8.
I want to dynamically switch from a Test development environment to a Production environment without having to clone my application.
Any ideas, I tried www.asprunner.com/forums/topic/17297-dynamically-setting-the-db-connection/
It's still defaults to the credentials on the OracleConnection.php
Thanks

admin 5/7/2018

That article is from 2011 and no longer apply.
Create a new Server Database Connection on 'Output directory' screen. Instead of hardcoding database connection parameters use session variables. Then in your code populate those session variables with new connection settings in one of events like AfterAppInit.

D
dcrera author 5/8/2018



That article is from 2011 and no longer apply.
Create a new Server Database Connection on 'Output directory' screen. Instead of hardcoding database connection parameters use session variables. Then in your code populate those session variables with new connection settings in one of events like AfterAppInit.


Can you give me an example on how to ?
Thanks

admin 5/8/2018

Create a new Server Database Connection, it will be populated with default connection code. Post it here.

D
dcrera author 5/11/2018



Create a new Server Database Connection, it will be populated with default connection code. Post it here.


I would normally modify the OracleConnection.php to :

  • Set db connection's properties
  • @param Array params

    */

    protected function assignConnectionParams( $params )

    {

    parent::assignConnectionParams( $params );
    $this->user="xxxx";

    $this->pwd="####";

    $this->sid=" (DESCRIPTION =

    (ADDRESS_LIST =

    (ADDRESS = (PROTOCOL = TCP)

    (HOST = xx.xx.x.35)(PORT = 1521)) )

    (CONNECT_DATA =

    (SID = ETK01)(SERVER = DEDICATED)))"; }
    So essentially, I need to change the host id from 35 to 30 (dynamically)
    Thanks

admin 5/11/2018

If you do need help follow my instructions.

D
dcrera author 5/14/2018



If you do need help follow my instructions.


Yes I do, I posted my connection details as requested.
Where exactly is 'Here'

admin 5/14/2018

"Here" means in this thread. I never asked to post the content of OracleConnection.php.