当前位置: 首页>>代码示例>>PHP>>正文


PHP Source::validateSCM方法代码示例

本文整理汇总了PHP中Source::validateSCM方法的典型用法代码示例。如果您正苦于以下问题:PHP Source::validateSCM方法的具体用法?PHP Source::validateSCM怎么用?PHP Source::validateSCM使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Source的用法示例。


在下文中一共展示了Source::validateSCM方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: execute

 /**
  * @see Action::execute()
  */
 public function execute()
 {
     // call execute event
     parent::execute();
     if ($this->source->enableCheckout && $this->checkoutRepository) {
         // load scm driver
         $className = ucfirst(Source::validateSCM($this->source->scm));
         // check out repository
         require_once WCF_DIR . 'lib/system/scm/' . $className . '.class.php';
         call_user_func(array($className, 'checkout'), $this->source->url, $this->source->sourceDirectory, array('username' => $this->source->username, 'password' => $this->source->password));
         // set revision
         $revision = $this->source->getHeadRevision();
         $this->source->update(null, null, null, null, null, null, null, $revision);
     }
     // rebuild package data if requested
     if ($this->rebuildPackageData) {
         require_once PB_DIR . 'lib/system/package/PackageHelper.class.php';
         PackageHelper::readPackages($this->source);
     }
     // call executed event
     $this->executed();
     // forward
     HeaderUtil::redirect('index.php?page=SourceView&sourceID=' . $this->source->sourceID . SID_ARG_2ND_NOT_ENCODED);
     exit;
 }
开发者ID:ZerGabriel,项目名称:PackageBuilder,代码行数:28,代码来源:CheckoutAction.class.php

示例2: update

 /**
  * Updates the data of a source.
  *
  * @param 	string		$name			The name of the source
  * @param	string		$sourceDirectory	Source directory used for files
  * @param	string		$buildDirectory		Build directory contains all archives
  * @param	string		$scm			Defines used SCM, may be 'git', 'none' and 'subversion'
  * @param	string		$url			URL for accessing subversion
  * @param	string		$username		Username neccessary if subversion repository is protected
  * @param	string		$password		Password neccessary if subversion repository is protected
  * @param	string		$revision		Currently used revision
  * @param	boolean		$trustServerCert	Automaticly trust server certificate
  * @param	boolean		$enableCheckout		Enables checkout ability
  * @param	integer		$position		Position used to order sources
  */
 public function update($name = null, $sourceDirectory = null, $buildDirectory = null, $scm = null, $url = null, $username = null, $password = null, $revision = null, $trustServerCert = null, $enableCheckout = null, $position = null)
 {
     $fields = array();
     if ($name !== null) {
         $fields['name'] = $name;
     }
     if ($sourceDirectory !== null) {
         $fields['sourceDirectory'] = $sourceDirectory;
     }
     if ($buildDirectory !== null) {
         $fields['buildDirectory'] = $buildDirectory;
     }
     if ($scm !== null) {
         $fields['scm'] = Source::validateSCM($scm);
     }
     if ($url !== null) {
         $fields['url'] = $url;
     }
     if ($username !== null) {
         $fields['username'] = $username;
     }
     if ($password !== null) {
         $fields['password'] = $password;
     }
     if ($revision !== null) {
         $fields['revision'] = $revision;
     }
     if ($trustServerCert !== null) {
         $fields['trustServerCert'] = intval($trustServerCert);
     }
     if ($enableCheckout !== null) {
         $fields['enableCheckout'] = intval($enableCheckout);
     }
     if ($position !== null) {
         $fields['position'] = intval($position);
     }
     $this->updateData($fields);
 }
开发者ID:ZerGabriel,项目名称:PackageBuilder,代码行数:53,代码来源:SourceEditor.class.php

示例3: validateSCM

 /**
  * Validates SCM and resets input fields if unused
  */
 protected function validateSCM()
 {
     $this->scm = Source::validateSCM($this->scm);
     switch ($this->scm) {
         case 'none':
             // reset input if no SCM is active
             $this->username = $this->password = '';
             $this->trustServerCert = $this->enableCheckout = 0;
             break;
         default:
             if (empty($this->url)) {
                 throw new UserInputException('url', 'empty');
             }
             break;
     }
 }
开发者ID:ZerGabriel,项目名称:PackageBuilder,代码行数:19,代码来源:SourceAddForm.class.php


注:本文中的Source::validateSCM方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。