/** * @param DataCollectorInterface $collector * @return $this */ public function addCollector(DataCollectorInterface $collector) { $this->collectors[$collector->getName()] = $collector; return $this; }
/** * @param DataCollectorInterface $collector */ private function loadStats(DataCollectorInterface $collector) { $path = sprintf('%s/%s/%s', $this->path, $collector->getName(), $this->statsFilename); $stats = array(); if (file_exists($path)) { $stats = json_decode(file_get_contents($path), true); } $collector->setStats($stats); }
/** * @param DataCollectorInterface $collector */ private function loadStats(DataCollectorInterface $collector) { $data = $this->session->getBag($this->key)->get(sprintf('%s/%s', $collector->getName(), $this->statsName), array()); $collector->setStats($data); }