Beispiel #1
0
 public function insert_host($pid, $host)
 {
     $model = new Model_Host();
     $model->pid = intval($pid);
     $model->hostname = trim($host);
     $model->save();
     return $model->id;
 }
Beispiel #2
0
 public function insert($p)
 {
     $project = new Model_Project();
     $project->name = $p['name'];
     $project->name_prefix = $p['name_prefix'];
     $project->repository = $p['repository'];
     $project->is_fixed = $p['is_fixed'];
     $project->host_path = $p['host_path'];
     $project->version_file = $p['version_file'];
     $project->creation = date('Y-m-d H:i:s', time());
     $project->save();
     foreach ($p['host'] as $h) {
         $host = new Model_Host();
         $host->pid = $project->id;
         $host->hostname = $h;
         $host->save();
     }
     Biz_Exclude::get_instance()->insert_default_exclude($project->id);
     return $project->id;
 }