Fixed naming (phpci -> php-censor)
This commit is contained in:
parent
4fee89fb80
commit
31f92327c1
76 changed files with 357 additions and 348 deletions
|
|
@ -27,11 +27,12 @@ class BuildInterpolator
|
|||
|
||||
/**
|
||||
* Sets the variables that will be used for interpolation.
|
||||
* @param Build $build
|
||||
*
|
||||
* @param Build $build
|
||||
* @param string $buildPath
|
||||
* @param string $phpCiUrl
|
||||
* @param string $url
|
||||
*/
|
||||
public function setupInterpolationVars(Build $build, $buildPath, $phpCiUrl)
|
||||
public function setupInterpolationVars(Build $build, $buildPath, $url)
|
||||
{
|
||||
$this->interpolation_vars = [];
|
||||
$this->interpolation_vars['%PHPCI%'] = 1;
|
||||
|
|
@ -45,9 +46,9 @@ class BuildInterpolator
|
|||
$this->interpolation_vars['%PROJECT%'] = $build->getProjectId();
|
||||
$this->interpolation_vars['%BUILD%'] = $build->getId();
|
||||
$this->interpolation_vars['%PROJECT_TITLE%'] = $build->getProjectTitle();
|
||||
$this->interpolation_vars['%PROJECT_URI%'] = $phpCiUrl . "project/view/" . $build->getProjectId();
|
||||
$this->interpolation_vars['%PROJECT_URI%'] = $url . "project/view/" . $build->getProjectId();
|
||||
$this->interpolation_vars['%BUILD_PATH%'] = $buildPath;
|
||||
$this->interpolation_vars['%BUILD_URI%'] = $phpCiUrl . "build/view/" . $build->getId();
|
||||
$this->interpolation_vars['%BUILD_URI%'] = $url . "build/view/" . $build->getId();
|
||||
$this->interpolation_vars['%PHPCI_COMMIT%'] = $this->interpolation_vars['%COMMIT%'];
|
||||
$this->interpolation_vars['%PHPCI_SHORT_COMMIT%'] = $this->interpolation_vars['%SHORT_COMMIT%'];
|
||||
$this->interpolation_vars['%PHPCI_COMMIT_MESSAGE%'] = $this->interpolation_vars['%COMMIT_MESSAGE%'];
|
||||
|
|
|
|||
|
|
@ -100,14 +100,14 @@ class Email
|
|||
/**
|
||||
* Send the email.
|
||||
*
|
||||
* @param Builder $phpci
|
||||
* @param Builder $builder
|
||||
*
|
||||
* @return bool|int
|
||||
*/
|
||||
public function send(Builder $phpci)
|
||||
public function send(Builder $builder)
|
||||
{
|
||||
$smtpServer = $this->config->get('phpci.email_settings.smtp_address');
|
||||
$phpci->logDebug(sprintf("SMTP: '%s'", !empty($smtpServer) ? 'true' : 'false'));
|
||||
$smtpServer = $this->config->get('php-censor.email_settings.smtp_address');
|
||||
$builder->logDebug(sprintf("SMTP: '%s'", !empty($smtpServer) ? 'true' : 'false'));
|
||||
|
||||
if (empty($smtpServer)) {
|
||||
return $this->sendViaMail();
|
||||
|
|
@ -152,7 +152,7 @@ class Email
|
|||
*/
|
||||
protected function sendViaSwiftMailer()
|
||||
{
|
||||
$factory = new MailerFactory($this->config->get('phpci'));
|
||||
$factory = new MailerFactory($this->config->get('php-censor'));
|
||||
$mailer = $factory->getSwiftMailerFromConfig();
|
||||
|
||||
$message = \Swift_Message::newInstance($this->subject)
|
||||
|
|
@ -177,7 +177,7 @@ class Email
|
|||
*/
|
||||
protected function getFrom()
|
||||
{
|
||||
$email = $this->config->get('phpci.email_settings.from_address', self::DEFAULT_FROM);
|
||||
$email = $this->config->get('php-censor.email_settings.from_address', self::DEFAULT_FROM);
|
||||
|
||||
if (empty($email)) {
|
||||
$email = self::DEFAULT_FROM;
|
||||
|
|
|
|||
|
|
@ -70,14 +70,14 @@ class Github
|
|||
*/
|
||||
public function getRepositories()
|
||||
{
|
||||
$token = Config::getInstance()->get('phpci.github.token');
|
||||
$token = Config::getInstance()->get('php-censor.github.token');
|
||||
|
||||
if (!$token) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$cache = Cache::getCache(Cache::TYPE_APC);
|
||||
$rtn = $cache->get('phpci_github_repos');
|
||||
$rtn = $cache->get('php-censor-github-repos');
|
||||
|
||||
if (!$rtn) {
|
||||
$orgs = $this->makeRequest('/user/orgs', ['access_token' => $token]);
|
||||
|
|
@ -97,7 +97,7 @@ class Github
|
|||
}
|
||||
}
|
||||
|
||||
$cache->set('phpci_github_repos', $rtn);
|
||||
$cache->set('php-censor-github-repos', $rtn);
|
||||
}
|
||||
|
||||
return $rtn;
|
||||
|
|
@ -115,7 +115,7 @@ class Github
|
|||
*/
|
||||
public function createPullRequestComment($repo, $pullId, $commitId, $file, $line, $comment)
|
||||
{
|
||||
$token = Config::getInstance()->get('phpci.github.token');
|
||||
$token = Config::getInstance()->get('php-censor.github.token');
|
||||
|
||||
if (!$token) {
|
||||
return null;
|
||||
|
|
@ -150,7 +150,7 @@ class Github
|
|||
*/
|
||||
public function createCommitComment($repo, $commitId, $file, $line, $comment)
|
||||
{
|
||||
$token = Config::getInstance()->get('phpci.github.token');
|
||||
$token = Config::getInstance()->get('php-censor.github.token');
|
||||
|
||||
if (!$token) {
|
||||
return null;
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ class Lang
|
|||
self::loadAvailableLanguages();
|
||||
|
||||
// Try cookies first:
|
||||
if (isset($_COOKIE) && array_key_exists('phpcilang', $_COOKIE) && self::setLanguage($_COOKIE['phpcilang'])) {
|
||||
if (isset($_COOKIE) && array_key_exists('php-censor-language', $_COOKIE) && self::setLanguage($_COOKIE['php-censor-language'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -151,7 +151,7 @@ class Lang
|
|||
}
|
||||
|
||||
// Try the installation default language:
|
||||
$language = $config->get('phpci.basic.language', null);
|
||||
$language = $config->get('php-censor.basic.language', null);
|
||||
if (self::setLanguage($language)) {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ class LoginIsDisabled
|
|||
unset($method, $params);
|
||||
|
||||
$config = Config::getInstance();
|
||||
$state = (bool) $config->get('phpci.authentication_settings.state', false);
|
||||
$state = (bool) $config->get('php-censor.authentication_settings.state', false);
|
||||
|
||||
return (false !== $state);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ class SshKey
|
|||
|
||||
$return = ['private_key' => '', 'public_key' => ''];
|
||||
|
||||
$output = @shell_exec('ssh-keygen -t rsa -b 2048 -f '.$keyFile.' -N "" -C "deploy@phpci"');
|
||||
$output = @shell_exec('ssh-keygen -t rsa -b 2048 -f '.$keyFile.' -N "" -C "deploy@php-censor"');
|
||||
|
||||
if (!empty($output)) {
|
||||
$pub = file_get_contents($keyFile . '.pub');
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ class User
|
|||
*/
|
||||
public function __call($method, $params = [])
|
||||
{
|
||||
$user = $_SESSION['phpci_user'];
|
||||
$user = $_SESSION['php-censor-user'];
|
||||
|
||||
if (!is_object($user)) {
|
||||
return null;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue