/** * Logging function * * @return void */ protected static function log($type, $extra = null) { if (Frapi_Controller_Main::MAIN_WEBSERVICE_DEBUG) { if (is_null(self::$_log)) { self::$_log = array('cache-get' => array('times' => 0, 'keys' => array()), 'cache-set' => array('times' => 0, 'keys' => array()), 'cache-delete' => array('times' => 0, 'keys' => array()), 'db' => array('times' => 0)); } switch ($type) { case 'cache-get': case 'cache-set': case 'cache-delete': self::$_log[$type]['times']++; self::$_log[$type]['keys'][] = $extra; break; case 'db': self::$_log[$type]['times']++; break; } } }