filehandle ); $this->log_filehandle = false; } } return $strings; } public function w3tc_usage_statistics_of_request( $storage ) { $storage->counter_add( 'objectcache_get_total', $this->cache_total ); $storage->counter_add( 'objectcache_get_hits', $this->cache_hits ); $storage->counter_add( 'objectcache_sets', $this->cache_sets ); $storage->counter_add( 'objectcache_flushes', $this->cache_flushes ); $storage->counter_add( 'objectcache_time_ms', (int)($this->time_total * 1000) ); } public function get_reject_reason() { if ( is_null( $this->cache_reject_reason ) ) return ''; return $this->_get_reject_reason_message( $this->cache_reject_reason ); } /** * * * @param unknown $key * @return string|void */ private function _get_reject_reason_message( $key ) { if ( !function_exists( '__' ) ) return $key; switch ( $key ) { case 'objectcache.disabled': return __( 'Object caching is disabled', 'w3-total-cache' ); case 'DONOTCACHEOBJECT': return __( 'DONOTCACHEOBJECT constant is defined', 'w3-total-cache' ); default: return ''; } } private function log_call( $line ) { if ( !$this->log_filehandle ) { $filename = Util_Debug::log_filename( 'objectcache-calls' ); $this->log_filehandle = fopen( $filename, 'a' ); } fputcsv ( $this->log_filehandle, $line, "\t" ); } }