<?php require 'lib/Emergence.class.php'; require 'lib/Debug.class.php'; require 'lib/DB.class.php'; require 'lib/File.class.php'; require 'lib/Site.class.php'; require 'lib/SiteCollection.class.php'; require 'lib/SiteFile.class.php'; include 'Site.config.php'; // load MICS-compatibility layer require 'lib/MICS.class.php'; MICS::initialize(); Site::initialize();
protected static function finishQueryLog(&$queryLog, $result = false) { if ($queryLog == false) { return false; } // save finish time and number of affected rows $queryLog['time_finish'] = sprintf('%f', microtime(true)); $queryLog['time_duration_ms'] = ($queryLog['time_finish'] - $queryLog['time_start']) * 1000; $queryLog['affected_rows'] = self::getMysqli()->affected_rows; // save result information if ($result) { $queryLog['result_fields'] = $result->field_count; $queryLog['result_rows'] = $result->num_rows; } // build backtrace string $queryLog['method'] = ''; $backtrace = debug_backtrace(); while ($backtick = array_shift($backtrace)) { // skip the log routine itself if ($backtick['function'] == __FUNCTION__) { continue; } if ($backtick['class'] != __CLASS__) { break; } // append function if ($queryLog['method'] != '') { $queryLog['method'] .= '/'; } $queryLog['method'] .= $backtick['function']; } // append to static log if (MICS::isFeatureLoaded('DebugLog')) { DebugLog::log($queryLog); } }
public static function getAllPublishedByContextObject(ActiveRecord $Context, $options = array()) { $options = MICS::prepareOptions($options, array('conditions' => array())); $options['conditions']['Class'] = __CLASS__; return parent::getAllPublishedByContextObject($Context, $options); }
public static function getAppPath() { if (!isset(self::$_app_path)) { $app = self::getApp(); $path = self::getPath(); if (count($path)) { self::$_app_path = '/' . $app . '/' . join('/', $path); } else { self::$_app_path = $app; } } return self::$_app_path; }