Merge branch 'master' of github.com:shish/shimmie2
This commit is contained in:
commit
07aac04d44
@ -326,6 +326,7 @@ class Database {
|
|||||||
*/
|
*/
|
||||||
public function execute($query, $args=array()) {
|
public function execute($query, $args=array()) {
|
||||||
try {
|
try {
|
||||||
|
_count_execs($this->db, $query, $args);
|
||||||
$stmt = $this->db->prepare($query);
|
$stmt = $this->db->prepare($query);
|
||||||
if (!array_key_exists(0, $args)) {
|
if (!array_key_exists(0, $args)) {
|
||||||
foreach($args as $name=>$value) {
|
foreach($args as $name=>$value) {
|
||||||
|
@ -409,7 +409,7 @@ function check_cli() {
|
|||||||
*/
|
*/
|
||||||
function _count_execs($db, $sql, $inputarray) {
|
function _count_execs($db, $sql, $inputarray) {
|
||||||
global $_execs;
|
global $_execs;
|
||||||
if(DEBUG) {
|
if(DEBUG_SQL) {
|
||||||
$fp = @fopen("data/sql.log", "a");
|
$fp = @fopen("data/sql.log", "a");
|
||||||
if($fp) {
|
if($fp) {
|
||||||
if(is_array($inputarray)) {
|
if(is_array($inputarray)) {
|
||||||
|
@ -61,6 +61,7 @@ function _d($name, $value) {if(!defined($name)) define($name, $value);}
|
|||||||
_d("DATABASE_DSN", null); // string PDO database connection details
|
_d("DATABASE_DSN", null); // string PDO database connection details
|
||||||
_d("CACHE_DSN", null); // string cache connection details
|
_d("CACHE_DSN", null); // string cache connection details
|
||||||
_d("DEBUG", false); // boolean print various debugging details
|
_d("DEBUG", false); // boolean print various debugging details
|
||||||
|
_d("DEBUG_SQL", false); // boolean dump SQL queries to data/sql.log
|
||||||
_d("COVERAGE", false); // boolean activate xdebug coverage monitor
|
_d("COVERAGE", false); // boolean activate xdebug coverage monitor
|
||||||
_d("CONTEXT", null); // string file to log performance data into
|
_d("CONTEXT", null); // string file to log performance data into
|
||||||
_d("CACHE_MEMCACHE", false); // boolean store complete rendered pages in memcache
|
_d("CACHE_MEMCACHE", false); // boolean store complete rendered pages in memcache
|
||||||
@ -106,7 +107,6 @@ try {
|
|||||||
ctx_log_start("Connecting to DB");
|
ctx_log_start("Connecting to DB");
|
||||||
// connect to the database
|
// connect to the database
|
||||||
$database = new Database();
|
$database = new Database();
|
||||||
//$database->db->fnExecute = '_count_execs'; // FIXME: PDO equivalent
|
|
||||||
$database->db->beginTransaction();
|
$database->db->beginTransaction();
|
||||||
$config = new DatabaseConfig($database);
|
$config = new DatabaseConfig($database);
|
||||||
ctx_log_endok();
|
ctx_log_endok();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user