2017 © Pedro Peláez
 

library ci3db

Standalone CodeIgniter 3 Database

image

anovsiradj/ci3db

Standalone CodeIgniter 3 Database

  • Thursday, June 28, 2018
  • by anovsiradj
  • Repository
  • 1 Watchers
  • 0 Stars
  • 22 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 100 % Grown

The README.md

CI3DB

Standalone CodeIgniter3 DataBase Query Builder with monkey-patched technique., (*1)

Usage

// IMPORTANT: "BASEPATH" must end with slash or directory separator.
define('BASEPATH', 'path/to/vendor/codeigniter/framework/system/'); // relative
define('BASEPATH', realpath('/path/to/vendor/codeigniter/framework/system') . DIRECTORY_SEPARATOR); // absolute

$ci3db =& \anovsiradj\CI3DataBase::init();

$ci3db->set_db_config_file('path/to/config/database.php'); // see ./tests/cfg.php
// or
$ci3db->set_db_config('db-server-0', array(
    ...
    'dbdriver' => '...',
    'hostname' => 'localhost',
    'username' => 'root',
    'password' => 'root',
    'database' => '...',
    ...
));
// or
$ci3db->set_db_config('db-server-1', 'dbdriver://username:password@hostname/database');

// Using the query builder
$db =& $ci3db->db(); // or
$db =& $ci3db->db('db-server-0'); // or
$db =& \anovsiradj\CI3DataBase::db(); // or
$db =& \anovsiradj\CI3DataBase::db('db-server-1');

Development

tested on 5.6+,7.0+ and 7.2+., (*2)

probably work on 5.4.8+ (see https://github.com/bcit-ci/CodeIgniter#server-requirements)., (*3)

tested with MySQL, SQLite and FirebirdSQL., (*4)

Caveats

dbutil() is not supported., (*5)

dbforge() is not supported., (*6)

DB Cache is not supported., (*7)

DSN you must provide host (even for sqlite3)., (*8)

Todo(s)

  • Test driver PDO
  • Test PostgreSQL

License

MIT, (*9)

CodeIgniter3 License, (*10)

The Versions

28/06 2018

dev-master

9999999-dev

Standalone CodeIgniter 3 Database

  Sources   Download

MIT

The Requires

 

by Avatar anovsiradj

28/06 2018

0.3.1

0.3.1.0

Standalone CodeIgniter 3 Database

  Sources   Download

MIT

The Requires

 

by Avatar anovsiradj

11/06 2018

0.3.0

0.3.0.0

Standalone CodeIgniter 3 Database

  Sources   Download

MIT

The Requires

 

by Avatar anovsiradj

16/10 2017

0.2

0.2.0.0

Standalone CodeIgniter 3 Database

  Sources   Download

MIT

The Requires

 

by Avatar anovsiradj

17/05 2017

0.1

0.1.0.0

Standalone CodeIgniter 3 Database

  Sources   Download

MIT

The Requires

 

by Avatar anovsiradj