2017 © Pedro Peláez
 

cakephp-plugin mysql_util

CakePHP MySQL Util Plugin

image

slywalker/mysql_util

CakePHP MySQL Util Plugin

  • Friday, March 8, 2013
  • by slywalker
  • Repository
  • 1 Watchers
  • 9 Stars
  • 2,895 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 1 % Grown

The README.md

MySQL Util Plugin for CakePHP2

Using Replication

If action use writing model method, use master., (*1)

Using UUID in Innodb

CakePHP ignore dammy primary. using dammy primary for mysql writhing performance, (*2)

How to use

database.php, (*3)

<?php
class DATABASE_CONFIG {

/**
 * Slave DB Config as defult
 *
 * driver => The name of a supported driver; valid options are as follows:
 *      MysqlUtil.Database/Innodb       - MySQL Innodb,
 *
 * master =>
 * the name that master's config
 *
 * dammy =>
 * the dammy primary field name when it uses uuid primary in innodb
 *
 * @var array
 */
    public $default = array(
        'datasource' => 'MysqlUtil.Database/Innodb',
        'persistent' => false,
        'host' => 'localhost',
        'login' => 'user',
        'password' => 'password',
        'database' => 'database_name',
        'prefix' => '',
        'encoding' => 'utf8',
        'master' => 'master',
        'dammy' => 'added_id',
    );

/**
 * Master DB Config
 *
 * master =>
 * the name that master's config
 *
 * @var array
 */
    public $master = array(
        'datasource' => 'MysqlUtil.Database/Innodb',
        'persistent' => false,
        'host' => 'localhost',
        'login' => 'user',
        'password' => 'password',
        'database' => 'database_name',
        'prefix' => '',
        'encoding' => 'utf8',
        'dammy' => 'added_id',
    );
}

AppModel.php, (*4)

<?php
App::uses('ReplicationBaseModel', 'MysqlUtil.Model');

class AppModel extends ReplicationBaseModel {

}

Use SQL_NO_CACHE (in SomeModel), (*5)

$this->getDataSource()->setNoCache(true);

Revert, (*6)

$this->getDataSource()->setNoCache(false);

The Versions

08/03 2013

dev-master

9999999-dev https://github.com/slywalker/cakephp-plugin-mysql_util

CakePHP MySQL Util Plugin

  Sources   Download

MIT

The Requires

 

cakephp mysql

08/03 2013

1.0.0

1.0.0.0 https://github.com/slywalker/cakephp-plugin-mysql_util

CakePHP MySQL Util Plugin

  Sources   Download

MIT

The Requires

 

cakephp mysql