dev-master
9999999-devOci8 Driver for Yii2
BSD-3-Clause
The Requires
by Apa Oww
yii oci8
Oci8 Driver for Yii2
This library is based on yajra/pdo-via-oci8 Version 3 that support PHP 8.2., (*1)
The preferred way to install this extension is through composer., (*2)
Either run, (*3)
php composer.phar require apaoww/yii2-oci8 "dev-master"
or add, (*4)
"apaoww/yii2-oci8": "dev-master"
to the require section of your composer.json
file., (*5)
You can also install from archive. Add aliase on config file to point alias to the folder, (*6)
return [ ... 'aliases' => [ '@apaoww/oci8' => 'path/to/your/extracted', ... ] ];
Once the extension is installed, simply modify your application configuration on main-local.php as follows :, (*7)
return [ 'components' => [ .... 'db' => [ 'class' => 'apaoww\oci8\Oci8DbConnection', 'dsn' => 'oci:dbname=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521))(CONNECT_DATA=(SID=xe)));charset=AL32UTF8;', 'username' => 'yourdatabaseschemaname', 'password' => 'databasepassword', 'enableSchemaCache' => true, //increase performance when retrieved table meta data 'schemaCacheDuration' => 3600, 'schemaCache' => 'cache', 'on afterOpen' => function($event) { /* A session configuration example */ $q = <<<SQL begin dbms_session.set_role('NAME_OF_YOUR_ROLE_IN_ORACLE'); EXCEPTION -- exception handlers begin WHEN OTHERS THEN -- handles all other errors ROLLBACK; end; SQL; $event->sender->createCommand($q)->execute(); }, // To convert column name to lower case 'schemaMap' => ['oci' => 'apaoww\oci8\ESchemaOci',], 'attributes' => [ // PDO::ATTR_STRINGIFY_FETCHES => true, PDO::ATTR_CASE => PDO::CASE_LOWER, ], ], ], ];
Oci8 Driver for Yii2
BSD-3-Clause
yii oci8