cdw1p icon

Yii2 oci8Pdo module

cdw1p | PRO | 05/18/20 09:37:02 AM UTC | 0 ⭐ | 484 👁️ | Never ⏰ | []
text |

1.18 KB

|

None

|

0 👍

/

0 👎

--- Step Menginstall Modul
 1. Install composer (apabila belum terinstall) dengan command :
   ~$ apt-get install composer
 2. Setelah composer terinstall lalu selanjutnya install modul oci dengan command :
   ~$ composer require professionalweb/oci8Pdo "dev-master"
 3. Tambahkan class "professionalweb\oci8Pdo\Connection" sebagai pdo package, contoh : 
   'class' => 'professionalweb\oci8Pdo\Connection'
 4. Pada konfigurasi database tambahkan parameter untuk melakukan cache schema :
    'enableQueryCache' => false,
    'enableSchemaCache' => true,
    'schemaCache' => 'cache',
    'schemaCacheDuration' => 0,
    'queryCacheDuration' => 3600,
 5. Contoh full konfigurasi : 
 	<?php
	$dsn = "TNS";
	return [
		'class' => 'professionalweb\oci8Pdo\Connection',
		'dsn' => 'oci:dbname=' . $dsn . ';',
		'username' => 'username',
		'password' => 'password',
		'enableQueryCache' => false,
		'enableSchemaCache' => true,
		'schemaCache' => 'cache',
		'schemaCacheDuration' => 0,
		'queryCacheDuration' => 3600,
		'on afterOpen' => function ($event) {
			$event->sender->createCommand("ALTER SESSION SET NLS_DATE_FORMAT = 'MM/DD/YYYY HH24:MI:SS'")->execute();
		}
	];

Comments