Example #1
0
 private function handleFile($root_folder, $f)
 {
     /*
     	The "black" identifier is just an abstract reference, not a real file:
     	we skip analysis for it
     */
     if ($f == 'black') {
         return true;
     }
     /*
     	This is to manage eventual files embedded multiple times: we track only
     	one, and eventually will substitute once all occurrences in the mlt file
     	when required
     */
     $path = $this->guessPath($root_folder, $f);
     $test_count = File::where('project_id', '=', $this->project->id)->where('original_path', '=', $path)->first();
     if ($test_count != null) {
         $test_count->references = $test_count->references + 1;
         $test_count->save();
         return true;
     }
     $file = new File();
     $file->project_id = $this->project->id;
     $file->filename = basename($f);
     $file->original_path = $path;
     $file->references = 1;
     $ret = $file->testReach();
     $file->save();
     return $ret;
 }