public function indexFiles() { $FileInstance = new File(array('init' => false)); if ($this->db) { $FileInstance->setConnection($this->db); } $FileInstance->init(); if ($UnIndexedPages = $FileInstance->findAllBy('has_been_analyzed', false)) { $ComponentInstance = new Component(array('init' => false)); if ($this->db) { $ComponentInstance->setConnection($this->db); } $ComponentInstance->init(); $ClassInstance = new Klass(array('init' => false)); if ($this->db) { $ClassInstance->setConnection($this->db); } $ClassInstance->init(array('init' => false)); foreach (array_keys($UnIndexedPages) as $k) { $this->log('Analyzing file ' . $UnIndexedPages[$k]->path); $Component = $ComponentInstance->updateComponentDetails($UnIndexedPages[$k], $this); $Classes = $ClassInstance->updateClassDetails($UnIndexedPages[$k], $Component, $this); if (!empty($Classes)) { //AkDebug::debug($Classes); } $UnIndexedPages[$k]->set('has_been_analyzed', true); $UnIndexedPages[$k]->save(); } } }