Overview

Namespaces

  • None
  • Yajra
    • Oci8
      • Connectors
      • Eloquent
      • Query
        • Grammars
        • Processors
      • Schema
        • Grammars

Classes

  • Yajra\Oci8\Connectors\OracleConnector
  • Yajra\Oci8\Eloquent\OracleEloquent
  • Yajra\Oci8\Oci8Connection
  • Yajra\Oci8\Oci8ServiceProvider
  • Yajra\Oci8\Query\Grammars\OracleGrammar
  • Yajra\Oci8\Query\OracleBuilder
  • Yajra\Oci8\Query\Processors\OracleProcessor
  • Yajra\Oci8\Schema\Comment
  • Yajra\Oci8\Schema\Grammars\OracleGrammar
  • Yajra\Oci8\Schema\OracleAutoIncrementHelper
  • Yajra\Oci8\Schema\OracleBlueprint
  • Yajra\Oci8\Schema\OracleBuilder
  • Yajra\Oci8\Schema\Sequence
  • Yajra\Oci8\Schema\Trigger

Traits

  • Yajra\Oci8\OracleReservedWords

Functions

  • config_path
  • Overview
  • Namespace
  • Class
 1: <?php
 2: 
 3: namespace Yajra\Oci8;
 4: 
 5: use Illuminate\Support\ServiceProvider;
 6: use Yajra\Oci8\Connectors\OracleConnector as Connector;
 7: 
 8: class Oci8ServiceProvider extends ServiceProvider
 9: {
10:     /**
11:      * Indicates if loading of the provider is deferred.
12:      *
13:      * @var bool
14:      */
15:     protected $defer = false;
16: 
17:     /**
18:      * Boot Oci8 Provider
19:      */
20:     public function boot()
21:     {
22:         $this->publishes([
23:             __DIR__ . '/../config/oracle.php' => config_path('oracle.php'),
24:         ], 'oracle');
25:     }
26: 
27:     /**
28:      * Register the service provider.
29:      *
30:      * @return void
31:      */
32:     public function register()
33:     {
34:         if (file_exists(config_path('oracle.php'))) {
35:             $this->mergeConfigFrom(config_path('oracle.php'), 'database.connections');
36:         } else {
37:             $this->mergeConfigFrom(__DIR__ . '/../config/oracle.php', 'database.connections');
38:         }
39: 
40:         $this->app['db']->extend('oracle', function ($config) {
41:             $connector  = new Connector();
42:             $connection = $connector->connect($config);
43:             $db         = new Oci8Connection($connection, $config["database"], $config["prefix"], $config);
44: 
45:             // set oracle session variables
46:             $sessionVars = [
47:                 'NLS_TIME_FORMAT'         => 'HH24:MI:SS',
48:                 'NLS_DATE_FORMAT'         => 'YYYY-MM-DD HH24:MI:SS',
49:                 'NLS_TIMESTAMP_FORMAT'    => 'YYYY-MM-DD HH24:MI:SS',
50:                 'NLS_TIMESTAMP_TZ_FORMAT' => 'YYYY-MM-DD HH24:MI:SS TZH:TZM',
51:                 'NLS_NUMERIC_CHARACTERS'  => '.,',
52:             ];
53: 
54:             // Like Postgres, Oracle allows the concept of "schema"
55:             if (isset($config['schema'])) {
56:                 $sessionVars['CURRENT_SCHEMA'] = $config['schema'];
57:             }
58: 
59:             $db->setSessionVars($sessionVars);
60: 
61:             return $db;
62:         });
63:     }
64: 
65:     /**
66:      * Get the services provided by the provider.
67:      *
68:      * @return string[]
69:      */
70:     public function provides()
71:     {
72:         return [];
73:     }
74: }
75: 
API documentation generated by ApiGen