Code Monkey home page Code Monkey logo

cakephp-oracle-driver's Introduction

CakePHP 3 Driver for Oracle Database

Downloads Latest Version

Installation

You can install this plugin into your CakePHP application using Composer.

The recommended way to install Composer packages is:

composer require cakedc/cakephp-oracle-driver

In bootstrap.php load plugin with bootstrap.

	Plugin::load('CakeDC/OracleDriver', ['bootstrap' => true]);

Requirements

  • CakePHP 3.2+
  • an Oracle PHP extension
    • OCI8 (PHP extension built with PHP)
    • PDO_OCI (PHP extension built with PHP)

Notes on extensions

For full support, it is recommended to run the OCI8 extension if possible.

While PDO_OCI might be simpler to set up, there are some limitations (e.g. it doesn't support the stored code layer, so only the SQL layer will be available.)

Datasource configuration

Here is an example datasource configuration:

        <?php
return [
    'Datasources' => [
        'default' => [
            'className' => 'CakeDC\OracleDriver\Database\OracleConnection',
            'driver' => 'CakeDC\OracleDriver\Database\Driver\OracleOCI', # For OCI8
            #'driver' => 'CakeDC\\OracleDriver\\Database\\Driver\\OraclePDO', # For PDO_OCI
            'host' => 'oracle11g',          # Database host name or IP address
            //'port' => 'nonstandard_port', # Database port number (default: 1521)
            'username' => 'blogs',          # Database username
            'password' => 'password',       # Database password
            'database' => 'XE',             # Database name (maps to Oracle's `SERVICE_NAME`)
            'sid' => '',                    # Database System ID (maps to Oracle's `SID`)
            'instance' => '',               # Database instance name (maps to Oracle's `INSTANCE_NAME`)
            'pooled' => '',                 # Database pooling (maps to Oracle's `SERVER=POOLED`)
        ]
    ]
];

As you can see, the className and driver need switched to Oracle-specific classes. The driver will depend on whether you want to use PDO or not. The database name "XE" in this case, is defined as the SERVICE_NAME in Oracle's system-wide tnsnames.ora file.

The above array format is translated into Oracle's Easy Connection Naming. You can find the logic for this in \CakeDC\OracleDriver\Database\Driver\OracleBase::getDSN().

Documentation

For documentation, as well as tutorials, see the docs directory of this repository.

Roadmap

  • Provide full compatibility with Phinx based migrations
  • Provide compatibility with Oracle database version 12
  • Transform data types into native PHP types when returned form the database @todo copy todos to the roadmap

Support

For bugs and feature requests, please use the issues section of this repository.

Commercial support is also available, contact us for more information.

Contributing

This repository follows the CakeDC Plugin Standard. If you'd like to contribute new features, enhancements or bug fixes to the plugin, please read our Contribution Guidelines for detailed instructions.

License

Copyright 2016 Cake Development Corporation (CakeDC). All rights reserved.

Licensed under the MIT License. Redistributions of the source code included in this repository must retain the copyright notice found in each file.

cakephp-oracle-driver's People

Contributors

skie avatar

Watchers

José Lorenzo Rodríguez avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.