2017 © Pedro Peláez
 

library codeigniterdb

Use the database library separately from CodeIgniter 3 (fork from evolution/codeigniterdb)

image

4k1r0/codeigniterdb

Use the database library separately from CodeIgniter 3 (fork from evolution/codeigniterdb)

  • Thursday, September 15, 2016
  • by 4k1r0
  • Repository
  • 1 Watchers
  • 1 Stars
  • 127 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 4 Forks
  • 0 Open issues
  • 2 Versions
  • 9 % Grown

The README.md

Codeigniter Database

Use the Database Library separately from CodeIgniter 3., (*1)

Installation

With Composer

"require": {
    "4k1r0/codeigniterdb":  "1.0.0"
}

or with command line : composer require 4k1r0/codeigniterdb, (*2)

Without Composer

You can also download it from Github, but no autoloader is provided so you'll need to register it with your own PSR-0 compatible autoloader., (*3)

Usage

<?php
use Evolution\CodeIgniterDB as CI;
$db_data = array(
    'dsn'   => '',
    'hostname' => 'localhost',
    'username' => 'root',
    'password' => 'my_password',
    'database' => 'my_database',
    'dbdriver' => 'mysqli',
    'dbprefix' => '',
    'pconnect' => FALSE,
    'db_debug' => TRUE,
    'cache_on' => FALSE,
    'cachedir' => '',
    'char_set' => 'utf8',
    'dbcollat' => 'utf8_general_ci',
    'swap_pre' => '',
    'encrypt' => FALSE,
    'compress' => FALSE,
    'stricton' => FALSE,
    'failover' => array(),
    'save_queries' => TRUE
);
$oDb =& CI\DB($db_data);

For more information visit CodeIgniter user guide., (*4)

Custom option

I've added the possibility to give a mysql ressource to reuse a already opened connection. Thus to not multiply connections and to use this in parallel with legacy code and proceed to a migration step by step. Works only with the mysql driver !, (*5)

<?php
use Evolution\CodeIgniterDB as CI;

$db_data = array(
    'dsn'   => '',
    'hostname' => 'localhost',
    'username' => 'root',
    'password' => 'my_password',
    'database' => 'my_database',
    'dbdriver' => 'mysql',
    'dbprefix' => '',
    'pconnect' => FALSE,
    'db_debug' => TRUE,
    'cache_on' => FALSE,
    'cachedir' => '',
    'char_set' => 'utf8',
    'dbcollat' => 'utf8_general_ci',
    'swap_pre' => '',
    'encrypt' => FALSE,
    'compress' => FALSE,
    'stricton' => FALSE,
    'failover' => array(),
    'save_queries' => TRUE
);

$rDb = mysql_connect($db_data['hostname'], $db_data['root'], $db_data['password']);

$oDb =& CI\DB($db_data, null, $rDb);

The Versions

15/09 2016

dev-master

9999999-dev https://github.com/evolutionscript/codeigniter-database-standalone

Use the database library separately from CodeIgniter 3 (fork from evolution/codeigniterdb)

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

database pdo mysql codeigniter mysqli

15/09 2016

1.0.0

1.0.0.0 https://github.com/evolutionscript/codeigniter-database-standalone

Use the database library separately from CodeIgniter 3 (fork from evolution/codeigniterdb)

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

database pdo mysql codeigniter mysqli