Skip to content

Instantly share code, notes, and snippets.

View kookxiang's full-sized avatar
🪲
code once, bug everywhere

Xiang Liu kookxiang

🪲
code once, bug everywhere
View GitHub Profile
@kookxiang
kookxiang / Database.php
Last active September 24, 2019 11:45
PDO with multi server support
<?php
/**
* This file is a part of KK Framework
* Author: kookxiang <r18@ikk.me>
*/
namespace Core;
class Database {
const MASTER = 'MASTER';
const SLAVE = 'SLAVE';
<?php
class PHPLock {
private $_PHP_LOCK = array();
private $code;
private $lockId = 1;
public function __construct(&$code){
$this->code =& $code;
$this->_PHP_LOCK = array();