Example #1
0
 public function indexFile($file_path)
 {
     $file_path = trim($file_path, '/');
     $FileInstance = new File(array('init' => false));
     if ($this->db) {
         $FileInstance->setConnection($this->db);
     }
     $FileInstance->init();
     if ($UnIndexedPage = $FileInstance->findFirstBy('path AND has_been_analyzed', $file_path, 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();
         $this->log('Analyzing file ' . $UnIndexedPage->path);
         $Component = $ComponentInstance->updateComponentDetails($UnIndexedPage, $this);
         $Classes = $ClassInstance->updateClassDetails($UnIndexedPage, $Component, $this);
         if (!empty($Classes)) {
             //AkDebug::debug($Classes);
         }
         $UnIndexedPage->set('has_been_analyzed', true);
         $UnIndexedPage->save();
     }
 }