承接 sujayjaju/php-active-record 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

sujayjaju/php-active-record

Composer 安装命令:

composer require sujayjaju/php-active-record

包简介

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

README 文档

README

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.

Setup

composer.phar require sujayjaju/php-active-record

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:

Database Reference

$this->db

gets replaced by

ActiveDatabase::get("db_reference_name")

Contributions

Thanks to the base setup by Documentopia.com

统计信息

  • 总下载量: 1.75k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 11
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 6
  • Watchers: 2
  • Forks: 8
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-02-24