public static function init() { if (!static::$profiler) { static::$profiler = new PhpQuickProfiler(FUEL_START_TIME); static::$profiler->queries = array(); static::$profiler->queryCount = 0; } }
public static function init() { if (!\Fuel::$is_cli and !\Input::is_ajax() and !static::$profiler) { static::$profiler = new PhpQuickProfiler(FUEL_START_TIME); static::$profiler->queries = array(); static::$profiler->queryCount = 0; } }
public static function init() { if (!\Fuel::$is_cli and !\Input::is_ajax() and !static::$profiler) { static::$profiler = new PhpQuickProfiler(FUEL_START_TIME); static::$profiler->queries = array(); static::$profiler->queryCount = 0; static::mark(__METHOD__ . ' Start'); \Fuel::$profiling = true; } }
public static function init() { if (static::$initialized) { return; } static::$profiler = new PhpQuickProfiler(FUEL_START_TIME); static::$profiler->queries = array(); static::$profiler->queryCount = 0; static::$initialized = true; }
public static function init() { $config = array('db' => array()); require_once APP . 'config.php'; static::$data = new stdClass(); static::$data->title = $config['default']['title']; static::$template = $config['default']['template']; // Database config options define('DB_HOST', $config['db']['host']); define('DB_NAME', $config['db']['name']); define('DB_USER', $config['db']['user']); define('DB_PASS', base64_decode($config['db']['pass'])); // Path to remove from uri static::$path = $config['path']; static::$profiler = $config['profiler']['log']; static::$profiler_query = $config['profiler']['query']; static::$status = $config['status']; }
/** * Method to get the indexer state. * * @return object The indexer state object. * * @since 2.5 */ public static function getState() { // First, try to load from the internal state. if (!empty(static::$state)) { return static::$state; } // If we couldn't load from the internal state, try the session. $session = JFactory::getSession(); $data = $session->get('_finder.state', null); // If the state is empty, load the values for the first time. if (empty($data)) { $data = new JObject(); // Load the default configuration options. $data->options = JComponentHelper::getParams('com_finder'); // Setup the weight lookup information. $data->weights = array(self::TITLE_CONTEXT => round($data->options->get('title_multiplier', 1.7), 2), self::TEXT_CONTEXT => round($data->options->get('text_multiplier', 0.7), 2), self::META_CONTEXT => round($data->options->get('meta_multiplier', 1.2), 2), self::PATH_CONTEXT => round($data->options->get('path_multiplier', 2.0), 2), self::MISC_CONTEXT => round($data->options->get('misc_multiplier', 0.3), 2)); // Set the current time as the start time. $data->startTime = JFactory::getDate()->toSql(); // Set the remaining default values. $data->batchSize = (int) $data->options->get('batch_size', 50); $data->batchOffset = 0; $data->totalItems = 0; $data->pluginState = array(); } // Setup the profiler if debugging is enabled. if (JFactory::getApplication()->get('debug')) { static::$profiler = JProfiler::getInstance('FinderIndexer'); } // Setup the stemmer. if ($data->options->get('stem', 1) && $data->options->get('stemmer', 'porter_en')) { FinderIndexerHelper::$stemmer = FinderIndexerStemmer::getInstance($data->options->get('stemmer', 'porter_en')); } // Set the state. static::$state = $data; return static::$state; }
public static function init() { static::$profiler = \Config::$profiler; static::$log_query = \Config::$profiler_query; }
public static function init() { static::$profiler = new PhpQuickProfiler(FUEL_START_TIME); }