本文整理汇总了PHP中PHPCI\Builder::getConfig方法的典型用法代码示例。如果您正苦于以下问题:PHP Builder::getConfig方法的具体用法?PHP Builder::getConfig怎么用?PHP Builder::getConfig使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPCI\Builder
的用法示例。
在下文中一共展示了Builder::getConfig方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: extendSvnCommandFromConfig
/**
* @param Builder $builder
*
* @return void
*/
protected function extendSvnCommandFromConfig(Builder $builder)
{
$cmd = $this->svnCommand;
$svn = $builder->getConfig('svn');
if ($svn) {
foreach ($svn as $key => $value) {
$cmd .= " --{$key} {$value} ";
}
}
$depth = $builder->getConfig('clone_depth');
if (!is_null($depth)) {
$cmd .= ' --depth ' . intval($depth) . ' ';
}
$this->svnCommand = $cmd;
}
示例2: __construct
public function __construct(Builder $phpci, Build $build, array $options = array())
{
$this->phpci = $phpci;
$this->build = $build;
$buildSettings = $phpci->getConfig('build_settings');
if (isset($buildSettings['redmine'])) {
$redmine = $buildSettings['redmine'];
$this->server = $redmine['server'];
$this->apiKey = $redmine['api_key'];
}
if (isset($options['enabled'])) {
$this->enabled = $options['enabled'];
}
if (isset($options['status'])) {
$this->status = $options['status'];
}
if (isset($options['prev_status'])) {
$this->prevStatus = $options['prev_status'];
}
if (isset($options['percent'])) {
$this->percent = $options['percent'];
}
if (isset($options['lang'])) {
$this->lang = $options['lang'];
}
if (isset($options['issue_regexp'])) {
$this->issueRegexp = $options['issue_regexp'];
}
$parser = new YamlParser();
$config = (array) $parser->parse(file_get_contents(__DIR__ . '/messages.yml'));
$this->messages = $config[$this->lang];
}
示例3: cloneBySsh
/**
* Use an SSH-based git clone.
*/
protected function cloneBySsh(Builder $builder, $cloneTo)
{
$keyFile = $this->writeSshKey($cloneTo);
if (!IS_WIN) {
$gitSshWrapper = $this->writeSshWrapper($cloneTo, $keyFile);
}
// Do the git clone:
$cmd = 'git clone --recursive ';
$depth = $builder->getConfig('clone_depth');
if (!is_null($depth)) {
$cmd .= ' --depth ' . intval($depth) . ' ';
}
$cmd .= ' -b %s %s "%s"';
if (!IS_WIN) {
$cmd = 'export GIT_SSH="' . $gitSshWrapper . '" && ' . $cmd;
}
$success = $builder->executeCommand($cmd, $this->getBranch(), $this->getCloneUrl(), $cloneTo);
if ($success) {
$success = $this->postCloneSetup($builder, $cloneTo);
}
// Remove the key file and git wrapper:
unlink($keyFile);
if (!IS_WIN) {
unlink($gitSshWrapper);
}
return $success;
}
示例4: __construct
/**
* @param Builder $phpci
* @param Build $build
* @param array $options
*/
public function __construct(Builder $phpci, Build $build, array $options = array())
{
$this->phpci = $phpci;
$this->build = $build;
$this->queries = $options;
$buildSettings = $phpci->getConfig('build_settings');
if (isset($buildSettings['sqlite'])) {
$sql = $buildSettings['sqlite'];
$this->path = $sql['path'];
}
}
示例5: __construct
/**
* @param Builder $phpci
* @param Build $build
* @param array $options
*/
public function __construct(Builder $phpci, Build $build, array $options = array())
{
$this->phpci = $phpci;
$this->build = $build;
$this->queries = $options;
$buildSettings = $phpci->getConfig('build_settings');
if (isset($buildSettings['pgsql'])) {
$sql = $buildSettings['pgsql'];
$this->host = $sql['host'];
$this->user = $sql['user'];
$this->pass = $sql['pass'];
}
}
示例6: __construct
/**
* Standard Constructor
*
* $options['directory'] Output Directory. Default: %BUILDPATH%
* $options['filename'] Phar Filename. Default: build.phar
* $options['regexp'] Regular Expression Filename Capture. Default: /\.php$/
* $options['stub'] Stub Content. No Default Value
*
* @param Builder $phpci
* @param Build $build
* @param array $options
*/
public function __construct(Builder $phpci, Build $build, array $options = array())
{
$this->phpci = $phpci;
$this->build = $build;
$this->message = $options['message'];
$buildSettings = $phpci->getConfig('build_settings');
if (isset($buildSettings['irc'])) {
$irc = $buildSettings['irc'];
$this->server = $irc['server'];
$this->port = $irc['port'];
$this->room = $irc['room'];
$this->nick = $irc['nick'];
}
}
示例7: cloneBySsh
/**
* Use an SSH-based git clone.
*/
protected function cloneBySsh(Builder $builder, $cloneTo)
{
// Do the git clone:
$cmd = 'git clone ';
$depth = $builder->getConfig('clone_depth');
if (!is_null($depth)) {
$cmd .= ' --depth ' . intval($depth) . ' ';
}
$cmd .= ' -b %s %s "%s"';
$success = $builder->executeCommand($cmd, $this->getBranch(), $this->getCloneUrl(), $cloneTo);
if ($success) {
$success = $this->postCloneSetup($builder, $cloneTo);
}
return $success;
}
示例8: __construct
/**
* Set up the plugin, configure options, etc.
* @param Builder $phpci
* @param Build $build
* @param array $options
* @throws \Exception
*/
public function __construct(Builder $phpci, Build $build, array $options = array())
{
$this->phpci = $phpci;
$this->build = $build;
$this->message = $options['message'];
$this->userAgent = "PHPCI/1.0 (+http://www.phptesting.org/)";
$this->cookie = "phpcicookie";
$buildSettings = $phpci->getConfig('build_settings');
if (isset($buildSettings['campfire'])) {
$campfire = $buildSettings['campfire'];
$this->url = $campfire['url'];
$this->authToken = $campfire['authToken'];
$this->roomId = $campfire['roomId'];
} else {
throw new \Exception(Lang::get('no_campfire_settings'));
}
}
示例9: __construct
/**
* @param Builder $phpci
* @param Build $build
* @param array $options
*/
public function __construct(Builder $phpci, Build $build, array $options = array())
{
$this->phpci = $phpci;
$this->build = $build;
$this->queries = $options;
$config = \b8\Database::getConnection('write')->getDetails();
$this->host = defined('PHPCI_DB_HOST') ? PHPCI_DB_HOST : null;
$this->user = $config['user'];
$this->pass = $config['pass'];
$buildSettings = $phpci->getConfig('build_settings');
if (!isset($buildSettings['mysql'])) {
return;
}
if (!empty($buildSettings['mysql']['host'])) {
$this->host = $this->phpci->interpolate($buildSettings['mysql']['host']);
}
if (!empty($buildSettings['mysql']['user'])) {
$this->user = $this->phpci->interpolate($buildSettings['mysql']['user']);
}
if (array_key_exists('pass', $buildSettings['mysql'])) {
$this->pass = $buildSettings['mysql']['pass'];
}
}