コード例 #1
0
ファイル: type.php プロジェクト: Sajaki/customisation-db
 /**
  * @{inheritDoc}
  */
 public function install_demo(\titania_contribution $contrib, \titania_revision $revision)
 {
     $revision->load_phpbb_versions();
     $attachment = $revision->get_attachment();
     $branch = $revision->phpbb_versions[0]['phpbb_version_branch'];
     $package = new package();
     $package->set_source($attachment->get_filepath())->set_temp_path($this->ext_config->__get('contrib_temp_path'), true);
     $demo_url = '';
     if ($this->demo_manager->configure($branch, $contrib, $package)) {
         $result = $this->demo_manager->install();
         if (empty($result['error'])) {
             $demo_url = $this->demo_manager->get_demo_url($branch, $result['id']);
             $contrib->set_demo_url($branch, $demo_url);
             $contrib->submit();
         }
     }
     $package->cleanup();
     return $demo_url;
 }