Beispiel #1
0
 public static function manager()
 {
     if (!self::$manager) {
         self::$manager = new Projects_Analyzer_Manager();
     }
     return self::$manager;
 }
Beispiel #2
0
 public function make($history, $force)
 {
     // make the dependencies
     if (is_array($this->status) || $this->status == PROJECTS_MODIFIED) {
         $force = TRUE;
     }
     $result = parent::make($history, $force);
     if (is_array($result)) {
         $this->status = $result;
         $this->modified = TRUE;
         $this->save();
         return $result;
     }
     // now the status has to be PROJECTS_MODIFIED, i.e., it needs to be made.
     if (!$force && $date == $this->modified_date) {
         $this->status = PROJECTS_MADE;
         $this->modified = TRUE;
         $this->save();
         return $this->modified_date;
     }
     $this->rm();
     $this->save();
     if ($this->maker) {
         $maker = Projects_Maker_Manager::manager()->maker($this->maker);
     } else {
         $maker = NULL;
     }
     if (!$maker) {
         $this->add_error('no available maker');
     } else {
         if (!$maker->make($this)) {
             $this->add_error('make failed');
         } else {
             $this->modified_date = time();
             $this->status = PROJECTS_MADE;
             // analyze the content for autodependency
             $deps = Projects_Analyzer_Manager::manager()->auto_dependency($this);
             foreach ($deps as $dep) {
                 $this->dependency[$dep] = TRUE;
             }
         }
     }
     $this->modified = TRUE;
     $this->save();
     return $this->modified_date;
 }