2017 © Pedro Peláez
 

library php-active-record

Stand Alone Active Record Library. CodeIgniter's ActiveRecord and Database Library from 3.0RC2, without the rest of CodeIgniter

image

sujayjaju/php-active-record

Stand Alone Active Record Library. CodeIgniter's ActiveRecord and Database Library from 3.0RC2, without the rest of CodeIgniter

  • Wednesday, December 9, 2015
  • by sujayjaju
  • Repository
  • 3 Watchers
  • 4 Stars
  • 848 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 6 Forks
  • 0 Open issues
  • 1 Versions
  • 3 % Grown

The README.md

Standalone Active Record

Based on the CodeIgnitor database implementation This takes the ActiveRecord and Database Library from 3.0 and makes it work without the rest of CodeIgniter., (*1)

Setup

composer.phar require sujayjaju/php-active-record, (*2)

Usage

// Include
use ActiveRecord\ActiveDatabase;

...

// Create Database configs
$db_config = array(
    'hostname' => "localhost",
    'username' => "username",
    'password' => "password",
    'database' => "database_name",
    'dbdriver' => "mysql",
    'pconnect' => FALSE,
    'db_debug' => TRUE
);

// Add Config and give it a name
ActiveDatabase::addConfig("read", $db_config);

//Use the named connection
$query = ActiveDatabase::get("read")->get('table_name')
$row = $query->result_array();
print_r($row);

Documentation

For more on how to use active records: Refer CodeIgnitor's reference documentation at:, (*3)

Database Reference, (*4)

$this->db

gets replaced by, (*5)

ActiveDatabase::get("db_reference_name")

Contributions

Thanks to the base setup by Documentopia.com, (*6)

The Versions

09/12 2015

dev-master

9999999-dev

Stand Alone Active Record Library. CodeIgniter's ActiveRecord and Database Library from 3.0RC2, without the rest of CodeIgniter

  Sources   Download

MIT

The Requires

  • php >=5.3.3