Exemplo n.º 1
0
 /**
  * Used by the sync task
  *
  * @param string $path
  * @return \DNEnvironment
  */
 public static function create_from_path($path)
 {
     $e = new DNEnvironment();
     $e->Filename = $path;
     $e->Name = basename($e->Filename, '.rb');
     // add each administrator member as a deployer of the new environment
     $adminGroup = Group::get()->filter('Code', 'administrators')->first();
     if ($adminGroup && $adminGroup->exists()) {
         foreach ($adminGroup->Members() as $member) {
             $e->Deployers()->add($member);
         }
     }
     return $e;
 }