repository_name
stringlengths
5
67
func_path_in_repository
stringlengths
4
234
func_name
stringlengths
0
314
whole_func_string
stringlengths
52
3.87M
language
stringclasses
6 values
func_code_string
stringlengths
52
3.87M
func_code_tokens
listlengths
15
672k
func_documentation_string
stringlengths
1
47.2k
func_documentation_tokens
listlengths
1
3.92k
split_name
stringclasses
1 value
func_code_url
stringlengths
85
339
dancryer/PHPCI
PHPCI/Controller/ProjectController.php
ProjectController.getReferenceValidator
protected function getReferenceValidator($values) { return function ($val) use ($values) { $type = $values['type']; $validators = array( 'hg' => array( 'regex' => '/^(https?):\/\//', 'message' => Lang::get('error_mercurial') ...
php
protected function getReferenceValidator($values) { return function ($val) use ($values) { $type = $values['type']; $validators = array( 'hg' => array( 'regex' => '/^(https?):\/\//', 'message' => Lang::get('error_mercurial') ...
[ "protected", "function", "getReferenceValidator", "(", "$", "values", ")", "{", "return", "function", "(", "$", "val", ")", "use", "(", "$", "values", ")", "{", "$", "type", "=", "$", "values", "[", "'type'", "]", ";", "$", "validators", "=", "array", ...
Get the validator to use to check project references. @param $values @return callable
[ "Get", "the", "validator", "to", "use", "to", "check", "project", "references", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Controller/ProjectController.php#L418-L454
dancryer/PHPCI
PHPCI/Helper/WindowsCommandExecutor.php
WindowsCommandExecutor.findGlobalBinary
protected function findGlobalBinary($binary) { $command = sprintf('where %s', $binary); $result = shell_exec($command); return trim($result); }
php
protected function findGlobalBinary($binary) { $command = sprintf('where %s', $binary); $result = shell_exec($command); return trim($result); }
[ "protected", "function", "findGlobalBinary", "(", "$", "binary", ")", "{", "$", "command", "=", "sprintf", "(", "'where %s'", ",", "$", "binary", ")", ";", "$", "result", "=", "shell_exec", "(", "$", "command", ")", ";", "return", "trim", "(", "$", "re...
Use 'where' on Windows to find a binary, rather than 'which' @param string $binary @return null|string
[ "Use", "where", "on", "Windows", "to", "find", "a", "binary", "rather", "than", "which" ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Helper/WindowsCommandExecutor.php#L23-L29
dancryer/PHPCI
PHPCI/Logging/BuildDBLogHandler.php
BuildDBLogHandler.write
protected function write(array $record) { $message = (string)$record['message']; $message = str_replace($this->build->currentBuildPath, '/', $message); $this->logValue .= $message . PHP_EOL; $this->build->setLog($this->logValue); Factory::getStore('Build')->save($this->buil...
php
protected function write(array $record) { $message = (string)$record['message']; $message = str_replace($this->build->currentBuildPath, '/', $message); $this->logValue .= $message . PHP_EOL; $this->build->setLog($this->logValue); Factory::getStore('Build')->save($this->buil...
[ "protected", "function", "write", "(", "array", "$", "record", ")", "{", "$", "message", "=", "(", "string", ")", "$", "record", "[", "'message'", "]", ";", "$", "message", "=", "str_replace", "(", "$", "this", "->", "build", "->", "currentBuildPath", ...
Write a log entry to the build log. @param array $record
[ "Write", "a", "log", "entry", "to", "the", "build", "log", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Logging/BuildDBLogHandler.php#L50-L59
dancryer/PHPCI
PHPCI/Service/BuildService.php
BuildService.addBuildToQueue
public function addBuildToQueue(Build $build) { $buildId = $build->getId(); if (empty($buildId)) { return; } $config = Config::getInstance(); $settings = $config->get('phpci.worker', []); if (!empty($settings['host']) && !empty($settings['queue'])) { ...
php
public function addBuildToQueue(Build $build) { $buildId = $build->getId(); if (empty($buildId)) { return; } $config = Config::getInstance(); $settings = $config->get('phpci.worker', []); if (!empty($settings['host']) && !empty($settings['queue'])) { ...
[ "public", "function", "addBuildToQueue", "(", "Build", "$", "build", ")", "{", "$", "buildId", "=", "$", "build", "->", "getId", "(", ")", ";", "if", "(", "empty", "(", "$", "buildId", ")", ")", "{", "return", ";", "}", "$", "config", "=", "Config"...
Takes a build and puts it into the queue to be run (if using a queue) @param Build $build
[ "Takes", "a", "build", "and", "puts", "it", "into", "the", "queue", "to", "be", "run", "(", "if", "using", "a", "queue", ")" ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Service/BuildService.php#L154-L188
dancryer/PHPCI
PHPCI/Service/ProjectService.php
ProjectService.createProject
public function createProject($title, $type, $reference, $options = array()) { // Create base project and use updateProject() to set its properties: $project = new Project(); return $this->updateProject($project, $title, $type, $reference, $options); }
php
public function createProject($title, $type, $reference, $options = array()) { // Create base project and use updateProject() to set its properties: $project = new Project(); return $this->updateProject($project, $title, $type, $reference, $options); }
[ "public", "function", "createProject", "(", "$", "title", ",", "$", "type", ",", "$", "reference", ",", "$", "options", "=", "array", "(", ")", ")", "{", "// Create base project and use updateProject() to set its properties:", "$", "project", "=", "new", "Project"...
Create a new project model and use the project store to save it. @param string $title @param string $type @param string $reference @param array $options @return \PHPCI\Model\Project
[ "Create", "a", "new", "project", "model", "and", "use", "the", "project", "store", "to", "save", "it", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Service/ProjectService.php#L43-L48
dancryer/PHPCI
PHPCI/Service/ProjectService.php
ProjectService.updateProject
public function updateProject(Project $project, $title, $type, $reference, $options = array()) { // Set basic properties: $project->setTitle($title); $project->setType($type); $project->setReference($reference); $project->setAllowPublicStatus(0); // Handle extra proj...
php
public function updateProject(Project $project, $title, $type, $reference, $options = array()) { // Set basic properties: $project->setTitle($title); $project->setType($type); $project->setReference($reference); $project->setAllowPublicStatus(0); // Handle extra proj...
[ "public", "function", "updateProject", "(", "Project", "$", "project", ",", "$", "title", ",", "$", "type", ",", "$", "reference", ",", "$", "options", "=", "array", "(", ")", ")", "{", "// Set basic properties:", "$", "project", "->", "setTitle", "(", "...
Update the properties of a given project. @param Project $project @param string $title @param string $type @param string $reference @param array $options @return \PHPCI\Model\Project
[ "Update", "the", "properties", "of", "a", "given", "project", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Service/ProjectService.php#L59-L101
dancryer/PHPCI
PHPCI/Service/ProjectService.php
ProjectService.processAccessInformation
protected function processAccessInformation(Project &$project) { $matches = array(); $reference = $project->getReference(); if ($project->getType() == 'gitlab') { $info = array(); if (preg_match('`^(.+)@(.+):([0-9]*)\/?(.+)\.git`', $reference, $matches)) { ...
php
protected function processAccessInformation(Project &$project) { $matches = array(); $reference = $project->getReference(); if ($project->getType() == 'gitlab') { $info = array(); if (preg_match('`^(.+)@(.+):([0-9]*)\/?(.+)\.git`', $reference, $matches)) { ...
[ "protected", "function", "processAccessInformation", "(", "Project", "&", "$", "project", ")", "{", "$", "matches", "=", "array", "(", ")", ";", "$", "reference", "=", "$", "project", "->", "getReference", "(", ")", ";", "if", "(", "$", "project", "->", ...
In circumstances where it is necessary, populate access information based on other project properties. @see ProjectService::createProject() @param Project $project
[ "In", "circumstances", "where", "it", "is", "necessary", "populate", "access", "information", "based", "on", "other", "project", "properties", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Service/ProjectService.php#L118-L136
dancryer/PHPCI
PHPCI/Model/Build/SubversionBuild.php
SubversionBuild.getCloneUrl
protected function getCloneUrl() { $url = $this->getProject()->getReference(); if (substr($url, -1) != '/') { $url .= '/'; } $branch = $this->getBranch(); if (empty($branch) || $branch == 'trunk') { $url .= 'trunk'; } else { $url...
php
protected function getCloneUrl() { $url = $this->getProject()->getReference(); if (substr($url, -1) != '/') { $url .= '/'; } $branch = $this->getBranch(); if (empty($branch) || $branch == 'trunk') { $url .= 'trunk'; } else { $url...
[ "protected", "function", "getCloneUrl", "(", ")", "{", "$", "url", "=", "$", "this", "->", "getProject", "(", ")", "->", "getReference", "(", ")", ";", "if", "(", "substr", "(", "$", "url", ",", "-", "1", ")", "!=", "'/'", ")", "{", "$", "url", ...
Get the URL to be used to clone this remote repository.
[ "Get", "the", "URL", "to", "be", "used", "to", "clone", "this", "remote", "repository", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Model/Build/SubversionBuild.php#L28-L45
dancryer/PHPCI
PHPCI/Model/Build/SubversionBuild.php
SubversionBuild.extendSvnCommandFromConfig
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(...
php
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(...
[ "protected", "function", "extendSvnCommandFromConfig", "(", "Builder", "$", "builder", ")", "{", "$", "cmd", "=", "$", "this", "->", "svnCommand", ";", "$", "svn", "=", "$", "builder", "->", "getConfig", "(", "'svn'", ")", ";", "if", "(", "$", "svn", "...
@param Builder $builder @return void
[ "@param", "Builder", "$builder" ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Model/Build/SubversionBuild.php#L52-L70
dancryer/PHPCI
PHPCI/Model/Build/SubversionBuild.php
SubversionBuild.createWorkingCopy
public function createWorkingCopy(Builder $builder, $buildPath) { $this->handleConfig($builder, $buildPath); $this->extendSvnCommandFromConfig($builder); $key = trim($this->getProject()->getSshPrivateKey()); if (!empty($key)) { $success = $this->cloneBySsh($builder, $b...
php
public function createWorkingCopy(Builder $builder, $buildPath) { $this->handleConfig($builder, $buildPath); $this->extendSvnCommandFromConfig($builder); $key = trim($this->getProject()->getSshPrivateKey()); if (!empty($key)) { $success = $this->cloneBySsh($builder, $b...
[ "public", "function", "createWorkingCopy", "(", "Builder", "$", "builder", ",", "$", "buildPath", ")", "{", "$", "this", "->", "handleConfig", "(", "$", "builder", ",", "$", "buildPath", ")", ";", "$", "this", "->", "extendSvnCommandFromConfig", "(", "$", ...
Create a working copy by cloning, copying, or similar.
[ "Create", "a", "working", "copy", "by", "cloning", "copying", "or", "similar", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Model/Build/SubversionBuild.php#L75-L95
dancryer/PHPCI
PHPCI/Model/Build/SubversionBuild.php
SubversionBuild.cloneByHttp
protected function cloneByHttp(Builder $builder, $cloneTo) { $cmd = $this->svnCommand; if ($this->getCommitId() != 'Manual') { $cmd .= ' -r %s %s "%s"'; $success = $builder->executeCommand($cmd, $this->getCommitId(), $this->getCloneUrl(), $cloneTo); } else { ...
php
protected function cloneByHttp(Builder $builder, $cloneTo) { $cmd = $this->svnCommand; if ($this->getCommitId() != 'Manual') { $cmd .= ' -r %s %s "%s"'; $success = $builder->executeCommand($cmd, $this->getCommitId(), $this->getCloneUrl(), $cloneTo); } else { ...
[ "protected", "function", "cloneByHttp", "(", "Builder", "$", "builder", ",", "$", "cloneTo", ")", "{", "$", "cmd", "=", "$", "this", "->", "svnCommand", ";", "if", "(", "$", "this", "->", "getCommitId", "(", ")", "!=", "'Manual'", ")", "{", "$", "cmd...
Use an HTTP-based svn export.
[ "Use", "an", "HTTP", "-", "based", "svn", "export", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Model/Build/SubversionBuild.php#L100-L113
dancryer/PHPCI
PHPCI/Model/Build/SubversionBuild.php
SubversionBuild.cloneBySsh
protected function cloneBySsh(Builder $builder, $cloneTo) { $cmd = $this->svnCommand . ' %s "%s"'; if (!IS_WIN) { $keyFile = $this->writeSshKey($cloneTo); $sshWrapper = $this->writeSshWrapper($cloneTo, $keyFile); $cmd = 'export SVN_SSH="' . $sshWrapper ...
php
protected function cloneBySsh(Builder $builder, $cloneTo) { $cmd = $this->svnCommand . ' %s "%s"'; if (!IS_WIN) { $keyFile = $this->writeSshKey($cloneTo); $sshWrapper = $this->writeSshWrapper($cloneTo, $keyFile); $cmd = 'export SVN_SSH="' . $sshWrapper ...
[ "protected", "function", "cloneBySsh", "(", "Builder", "$", "builder", ",", "$", "cloneTo", ")", "{", "$", "cmd", "=", "$", "this", "->", "svnCommand", ".", "' %s \"%s\"'", ";", "if", "(", "!", "IS_WIN", ")", "{", "$", "keyFile", "=", "$", "this", "-...
Use an SSH-based svn export.
[ "Use", "an", "SSH", "-", "based", "svn", "export", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Model/Build/SubversionBuild.php#L118-L137
dancryer/PHPCI
PHPCI/Plugin/FlowdockNotify.php
FlowdockNotify.execute
public function execute() { $message = $this->phpci->interpolate($this->message); $successfulBuild = $this->build->isSuccessful() ? 'Success' : 'Failed'; $push = new Push($this->api_key); $flowMessage = TeamInboxMessage::create() ->setSource("PHPCI") ->setFro...
php
public function execute() { $message = $this->phpci->interpolate($this->message); $successfulBuild = $this->build->isSuccessful() ? 'Success' : 'Failed'; $push = new Push($this->api_key); $flowMessage = TeamInboxMessage::create() ->setSource("PHPCI") ->setFro...
[ "public", "function", "execute", "(", ")", "{", "$", "message", "=", "$", "this", "->", "phpci", "->", "interpolate", "(", "$", "this", "->", "message", ")", ";", "$", "successfulBuild", "=", "$", "this", "->", "build", "->", "isSuccessful", "(", ")", ...
Run the Flowdock plugin. @return bool @throws \Exception
[ "Run", "the", "Flowdock", "plugin", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Plugin/FlowdockNotify.php#L53-L72
dancryer/PHPCI
PHPCI/Plugin/Mysql.php
Mysql.execute
public function execute() { try { $opts = array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION); $pdo = new PDO('mysql:host=' . $this->host, $this->user, $this->pass, $opts); foreach ($this->queries as $query) { if (!is_array($query)) { ...
php
public function execute() { try { $opts = array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION); $pdo = new PDO('mysql:host=' . $this->host, $this->user, $this->pass, $opts); foreach ($this->queries as $query) { if (!is_array($query)) { ...
[ "public", "function", "execute", "(", ")", "{", "try", "{", "$", "opts", "=", "array", "(", "PDO", "::", "ATTR_ERRMODE", "=>", "PDO", "::", "ERRMODE_EXCEPTION", ")", ";", "$", "pdo", "=", "new", "PDO", "(", "'mysql:host='", ".", "$", "this", "->", "h...
Connects to MySQL and runs a specified set of queries. @return boolean
[ "Connects", "to", "MySQL", "and", "runs", "a", "specified", "set", "of", "queries", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Plugin/Mysql.php#L97-L119
dancryer/PHPCI
PHPCI/Plugin/Mysql.php
Mysql.getImportCommand
protected function getImportCommand($import_file, $database = null) { $decompression = array( 'bz2' => '| bzip2 --decompress', 'gz' => '| gzip --decompress', ); $extension = strtolower(pathinfo($import_file, PATHINFO_EXTENSION)); $decomp_cmd = ''; if ...
php
protected function getImportCommand($import_file, $database = null) { $decompression = array( 'bz2' => '| bzip2 --decompress', 'gz' => '| gzip --decompress', ); $extension = strtolower(pathinfo($import_file, PATHINFO_EXTENSION)); $decomp_cmd = ''; if ...
[ "protected", "function", "getImportCommand", "(", "$", "import_file", ",", "$", "database", "=", "null", ")", "{", "$", "decompression", "=", "array", "(", "'bz2'", "=>", "'| bzip2 --decompress'", ",", "'gz'", "=>", "'| gzip --decompress'", ",", ")", ";", "$",...
Builds the MySQL import command required to import/execute the specified file @param string $import_file Path to file, relative to the build root @param string $database If specified, this database is selected before execution @return string
[ "Builds", "the", "MySQL", "import", "command", "required", "to", "import", "/", "execute", "the", "specified", "file" ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Plugin/Mysql.php#L153-L175
dancryer/PHPCI
PHPCI/Plugin/Grunt.php
Grunt.execute
public function execute() { // if npm does not work, we cannot use grunt, so we return false $cmd = 'cd %s && npm install'; if (IS_WIN) { $cmd = 'cd /d %s && npm install'; } if (!$this->phpci->executeCommand($cmd, $this->directory)) { return false; ...
php
public function execute() { // if npm does not work, we cannot use grunt, so we return false $cmd = 'cd %s && npm install'; if (IS_WIN) { $cmd = 'cd /d %s && npm install'; } if (!$this->phpci->executeCommand($cmd, $this->directory)) { return false; ...
[ "public", "function", "execute", "(", ")", "{", "// if npm does not work, we cannot use grunt, so we return false", "$", "cmd", "=", "'cd %s && npm install'", ";", "if", "(", "IS_WIN", ")", "{", "$", "cmd", "=", "'cd /d %s && npm install'", ";", "}", "if", "(", "!",...
Executes grunt and runs a specified command (e.g. install / update)
[ "Executes", "grunt", "and", "runs", "a", "specified", "command", "(", "e", ".", "g", ".", "install", "/", "update", ")" ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Plugin/Grunt.php#L74-L96
dancryer/PHPCI
PHPCI/Plugin/Irc.php
Irc.execute
public function execute() { $msg = $this->phpci->interpolate($this->message); if (empty($this->server) || empty($this->room) || empty($this->nick)) { $this->phpci->logFailure(Lang::get('irc_settings')); } if (empty($this->port)) { $this->port = 6667; ...
php
public function execute() { $msg = $this->phpci->interpolate($this->message); if (empty($this->server) || empty($this->room) || empty($this->nick)) { $this->phpci->logFailure(Lang::get('irc_settings')); } if (empty($this->port)) { $this->port = 6667; ...
[ "public", "function", "execute", "(", ")", "{", "$", "msg", "=", "$", "this", "->", "phpci", "->", "interpolate", "(", "$", "this", "->", "message", ")", ";", "if", "(", "empty", "(", "$", "this", "->", "server", ")", "||", "empty", "(", "$", "th...
Run IRC plugin. @return bool
[ "Run", "IRC", "plugin", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Plugin/Irc.php#L67-L93
dancryer/PHPCI
PHPCI/Plugin/CopyBuild.php
CopyBuild.execute
public function execute() { $build = $this->phpci->buildPath; if ($this->directory == $build) { return false; } $this->wipeExistingDirectory(); $cmd = 'mkdir -p "%s" && cp -R "%s" "%s"'; if (IS_WIN) { $cmd = 'mkdir -p "%s" && xcopy /E "%s" "...
php
public function execute() { $build = $this->phpci->buildPath; if ($this->directory == $build) { return false; } $this->wipeExistingDirectory(); $cmd = 'mkdir -p "%s" && cp -R "%s" "%s"'; if (IS_WIN) { $cmd = 'mkdir -p "%s" && xcopy /E "%s" "...
[ "public", "function", "execute", "(", ")", "{", "$", "build", "=", "$", "this", "->", "phpci", "->", "buildPath", ";", "if", "(", "$", "this", "->", "directory", "==", "$", "build", ")", "{", "return", "false", ";", "}", "$", "this", "->", "wipeExi...
Copies files from the root of the build directory into the target folder
[ "Copies", "files", "from", "the", "root", "of", "the", "build", "directory", "into", "the", "target", "folder" ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Plugin/CopyBuild.php#L49-L69
dancryer/PHPCI
PHPCI/Plugin/CopyBuild.php
CopyBuild.wipeExistingDirectory
protected function wipeExistingDirectory() { if ($this->wipe === true && $this->directory != '/' && is_dir($this->directory)) { $cmd = 'rm -Rf "%s*"'; $success = $this->phpci->executeCommand($cmd, $this->directory); if (!$success) { throw new \Exception(L...
php
protected function wipeExistingDirectory() { if ($this->wipe === true && $this->directory != '/' && is_dir($this->directory)) { $cmd = 'rm -Rf "%s*"'; $success = $this->phpci->executeCommand($cmd, $this->directory); if (!$success) { throw new \Exception(L...
[ "protected", "function", "wipeExistingDirectory", "(", ")", "{", "if", "(", "$", "this", "->", "wipe", "===", "true", "&&", "$", "this", "->", "directory", "!=", "'/'", "&&", "is_dir", "(", "$", "this", "->", "directory", ")", ")", "{", "$", "cmd", "...
Wipe the destination directory if it already exists. @throws \Exception
[ "Wipe", "the", "destination", "directory", "if", "it", "already", "exists", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Plugin/CopyBuild.php#L75-L85
dancryer/PHPCI
PHPCI/Plugin/CopyBuild.php
CopyBuild.deleteIgnoredFiles
protected function deleteIgnoredFiles() { if ($this->ignore) { foreach ($this->phpci->ignore as $file) { $cmd = 'rm -Rf "%s/%s"'; if (IS_WIN) { $cmd = 'rmdir /S /Q "%s\%s"'; } $this->phpci->executeCommand($cmd, $...
php
protected function deleteIgnoredFiles() { if ($this->ignore) { foreach ($this->phpci->ignore as $file) { $cmd = 'rm -Rf "%s/%s"'; if (IS_WIN) { $cmd = 'rmdir /S /Q "%s\%s"'; } $this->phpci->executeCommand($cmd, $...
[ "protected", "function", "deleteIgnoredFiles", "(", ")", "{", "if", "(", "$", "this", "->", "ignore", ")", "{", "foreach", "(", "$", "this", "->", "phpci", "->", "ignore", "as", "$", "file", ")", "{", "$", "cmd", "=", "'rm -Rf \"%s/%s\"'", ";", "if", ...
Delete any ignored files from the build prior to copying.
[ "Delete", "any", "ignored", "files", "from", "the", "build", "prior", "to", "copying", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Plugin/CopyBuild.php#L90-L101
dancryer/PHPCI
PHPCI/Model/BuildError.php
BuildError.getSeverityString
public function getSeverityString() { switch ($this->getSeverity()) { case self::SEVERITY_CRITICAL: return 'critical'; case self::SEVERITY_HIGH: return 'high'; case self::SEVERITY_NORMAL: return 'normal'; case...
php
public function getSeverityString() { switch ($this->getSeverity()) { case self::SEVERITY_CRITICAL: return 'critical'; case self::SEVERITY_HIGH: return 'high'; case self::SEVERITY_NORMAL: return 'normal'; case...
[ "public", "function", "getSeverityString", "(", ")", "{", "switch", "(", "$", "this", "->", "getSeverity", "(", ")", ")", "{", "case", "self", "::", "SEVERITY_CRITICAL", ":", "return", "'critical'", ";", "case", "self", "::", "SEVERITY_HIGH", ":", "return", ...
Get the language string key for this error's severity level. @return string
[ "Get", "the", "language", "string", "key", "for", "this", "error", "s", "severity", "level", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Model/BuildError.php#L28-L43
dancryer/PHPCI
PHPCI/Model/BuildError.php
BuildError.getSeverityClass
public function getSeverityClass() { switch ($this->getSeverity()) { case self::SEVERITY_CRITICAL: return 'danger'; case self::SEVERITY_HIGH: return 'warning'; case self::SEVERITY_NORMAL: return 'info'; case s...
php
public function getSeverityClass() { switch ($this->getSeverity()) { case self::SEVERITY_CRITICAL: return 'danger'; case self::SEVERITY_HIGH: return 'warning'; case self::SEVERITY_NORMAL: return 'info'; case s...
[ "public", "function", "getSeverityClass", "(", ")", "{", "switch", "(", "$", "this", "->", "getSeverity", "(", ")", ")", "{", "case", "self", "::", "SEVERITY_CRITICAL", ":", "return", "'danger'", ";", "case", "self", "::", "SEVERITY_HIGH", ":", "return", "...
Get the class to apply to HTML elements representing this error. @return string
[ "Get", "the", "class", "to", "apply", "to", "HTML", "elements", "representing", "this", "error", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Model/BuildError.php#L49-L64
dancryer/PHPCI
PHPCI/Plugin/Gulp.php
Gulp.execute
public function execute() { // if npm does not work, we cannot use gulp, so we return false $cmd = 'cd %s && npm install'; if (IS_WIN) { $cmd = 'cd /d %s && npm install'; } if (!$this->phpci->executeCommand($cmd, $this->directory)) { return false; ...
php
public function execute() { // if npm does not work, we cannot use gulp, so we return false $cmd = 'cd %s && npm install'; if (IS_WIN) { $cmd = 'cd /d %s && npm install'; } if (!$this->phpci->executeCommand($cmd, $this->directory)) { return false; ...
[ "public", "function", "execute", "(", ")", "{", "// if npm does not work, we cannot use gulp, so we return false", "$", "cmd", "=", "'cd %s && npm install'", ";", "if", "(", "IS_WIN", ")", "{", "$", "cmd", "=", "'cd /d %s && npm install'", ";", "}", "if", "(", "!", ...
Executes gulp and runs a specified command (e.g. install / update)
[ "Executes", "gulp", "and", "runs", "a", "specified", "command", "(", "e", ".", "g", ".", "install", "/", "update", ")" ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Plugin/Gulp.php#L74-L96
dancryer/PHPCI
PHPCI/Plugin/Codeception.php
Codeception.runConfigFile
protected function runConfigFile($configPath) { $this->phpci->logExecOutput(false); $codecept = $this->phpci->findBinary('codecept'); if (!$codecept) { $this->phpci->logFailure(Lang::get('could_not_find', 'codecept')); return false; } $cmd = 'cd "%...
php
protected function runConfigFile($configPath) { $this->phpci->logExecOutput(false); $codecept = $this->phpci->findBinary('codecept'); if (!$codecept) { $this->phpci->logFailure(Lang::get('could_not_find', 'codecept')); return false; } $cmd = 'cd "%...
[ "protected", "function", "runConfigFile", "(", "$", "configPath", ")", "{", "$", "this", "->", "phpci", "->", "logExecOutput", "(", "false", ")", ";", "$", "codecept", "=", "$", "this", "->", "phpci", "->", "findBinary", "(", "'codecept'", ")", ";", "if"...
Run tests from a Codeception config file. @param $configPath @return bool|mixed @throws \Exception
[ "Run", "tests", "from", "a", "Codeception", "config", "file", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Plugin/Codeception.php#L120-L162
dancryer/PHPCI
PHPCI/Controller/PluginController.php
PluginController.index
public function index() { $this->requireAdmin(); $json = $this->getComposerJson(); $this->view->installedPackages = $json['require']; $pluginInfo = new PluginInformationCollection(); $pluginInfo->add(FilesPluginInformation::newFromDir( PHPCI_DIR . "PHPCI/Plugin/...
php
public function index() { $this->requireAdmin(); $json = $this->getComposerJson(); $this->view->installedPackages = $json['require']; $pluginInfo = new PluginInformationCollection(); $pluginInfo->add(FilesPluginInformation::newFromDir( PHPCI_DIR . "PHPCI/Plugin/...
[ "public", "function", "index", "(", ")", "{", "$", "this", "->", "requireAdmin", "(", ")", ";", "$", "json", "=", "$", "this", "->", "getComposerJson", "(", ")", ";", "$", "this", "->", "view", "->", "installedPackages", "=", "$", "json", "[", "'requ...
List all enabled plugins, installed and recommend packages. @return string
[ "List", "all", "enabled", "plugins", "installed", "and", "recommend", "packages", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Controller/PluginController.php#L30-L50
dancryer/PHPCI
PHPCI/Application.php
Application.init
public function init() { $request =& $this->request; $route = '/:controller/:action'; $opts = array('controller' => 'Home', 'action' => 'index'); // Inlined as a closure to fix "using $this when not in object context" on 5.3 $validateSession = function () { if (!...
php
public function init() { $request =& $this->request; $route = '/:controller/:action'; $opts = array('controller' => 'Home', 'action' => 'index'); // Inlined as a closure to fix "using $this when not in object context" on 5.3 $validateSession = function () { if (!...
[ "public", "function", "init", "(", ")", "{", "$", "request", "=", "&", "$", "this", "->", "request", ";", "$", "route", "=", "'/:controller/:action'", ";", "$", "opts", "=", "array", "(", "'controller'", "=>", "'Home'", ",", "'action'", "=>", "'index'", ...
Initialise PHPCI - Handles session verification, routing, etc.
[ "Initialise", "PHPCI", "-", "Handles", "session", "verification", "routing", "etc", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Application.php#L32-L78
dancryer/PHPCI
PHPCI/Application.php
Application.handleRequest
public function handleRequest() { try { $this->response = parent::handleRequest(); } catch (HttpException $ex) { $this->config->set('page_title', 'Error'); $view = new View('exception'); $view->exception = $ex; $this->response->setRespons...
php
public function handleRequest() { try { $this->response = parent::handleRequest(); } catch (HttpException $ex) { $this->config->set('page_title', 'Error'); $view = new View('exception'); $view->exception = $ex; $this->response->setRespons...
[ "public", "function", "handleRequest", "(", ")", "{", "try", "{", "$", "this", "->", "response", "=", "parent", "::", "handleRequest", "(", ")", ";", "}", "catch", "(", "HttpException", "$", "ex", ")", "{", "$", "this", "->", "config", "->", "set", "...
Handle an incoming web request. @return b8\b8\Http\Response|Response
[ "Handle", "an", "incoming", "web", "request", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Application.php#L85-L115
dancryer/PHPCI
PHPCI/Application.php
Application.loadController
protected function loadController($class) { $controller = parent::loadController($class); $controller->layout = new View('layout'); $controller->layout->title = 'PHPCI'; $controller->layout->breadcrumb = array(); return $controller; }
php
protected function loadController($class) { $controller = parent::loadController($class); $controller->layout = new View('layout'); $controller->layout->title = 'PHPCI'; $controller->layout->breadcrumb = array(); return $controller; }
[ "protected", "function", "loadController", "(", "$", "class", ")", "{", "$", "controller", "=", "parent", "::", "loadController", "(", "$", "class", ")", ";", "$", "controller", "->", "layout", "=", "new", "View", "(", "'layout'", ")", ";", "$", "control...
Loads a particular controller, and injects our layout view into it. @param $class @return mixed
[ "Loads", "a", "particular", "controller", "and", "injects", "our", "layout", "view", "into", "it", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Application.php#L122-L130
dancryer/PHPCI
PHPCI/Application.php
Application.setLayoutVariables
protected function setLayoutVariables(View &$layout) { $groups = array(); $groupStore = b8\Store\Factory::getStore('ProjectGroup'); $groupList = $groupStore->getWhere(array(), 100, 0, array(), array('title' => 'ASC')); foreach ($groupList['items'] as $group) { $thisGroup...
php
protected function setLayoutVariables(View &$layout) { $groups = array(); $groupStore = b8\Store\Factory::getStore('ProjectGroup'); $groupList = $groupStore->getWhere(array(), 100, 0, array(), array('title' => 'ASC')); foreach ($groupList['items'] as $group) { $thisGroup...
[ "protected", "function", "setLayoutVariables", "(", "View", "&", "$", "layout", ")", "{", "$", "groups", "=", "array", "(", ")", ";", "$", "groupStore", "=", "b8", "\\", "Store", "\\", "Factory", "::", "getStore", "(", "'ProjectGroup'", ")", ";", "$", ...
Injects variables into the layout before rendering it. @param View $layout
[ "Injects", "variables", "into", "the", "layout", "before", "rendering", "it", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Application.php#L136-L150
dancryer/PHPCI
PHPCI/Application.php
Application.shouldSkipAuth
protected function shouldSkipAuth() { $config = b8\Config::getInstance(); $state = (bool)$config->get('phpci.authentication_settings.state', false); $userId = $config->get('phpci.authentication_settings.user_id', 0); if (false !== $state && 0 != (int)$userId) { $user ...
php
protected function shouldSkipAuth() { $config = b8\Config::getInstance(); $state = (bool)$config->get('phpci.authentication_settings.state', false); $userId = $config->get('phpci.authentication_settings.user_id', 0); if (false !== $state && 0 != (int)$userId) { $user ...
[ "protected", "function", "shouldSkipAuth", "(", ")", "{", "$", "config", "=", "b8", "\\", "Config", "::", "getInstance", "(", ")", ";", "$", "state", "=", "(", "bool", ")", "$", "config", "->", "get", "(", "'phpci.authentication_settings.state'", ",", "fal...
Check whether we should skip auth (because it is disabled) @return bool
[ "Check", "whether", "we", "should", "skip", "auth", "(", "because", "it", "is", "disabled", ")" ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Application.php#L156-L173
dancryer/PHPCI
PHPCI/Plugin/PackageBuild.php
PackageBuild.execute
public function execute() { $path = $this->phpci->buildPath; $build = $this->build; if ($this->directory == $path) { return false; } $filename = str_replace('%build.commit%', $build->getCommitId(), $this->filename); $filename = str_replace('%build.id%',...
php
public function execute() { $path = $this->phpci->buildPath; $build = $this->build; if ($this->directory == $path) { return false; } $filename = str_replace('%build.commit%', $build->getCommitId(), $this->filename); $filename = str_replace('%build.id%',...
[ "public", "function", "execute", "(", ")", "{", "$", "path", "=", "$", "this", "->", "phpci", "->", "buildPath", ";", "$", "build", "=", "$", "this", "->", "build", ";", "if", "(", "$", "this", "->", "directory", "==", "$", "path", ")", "{", "ret...
Executes Composer and runs a specified command (e.g. install / update)
[ "Executes", "Composer", "and", "runs", "a", "specified", "command", "(", "e", ".", "g", ".", "install", "/", "update", ")" ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Plugin/PackageBuild.php#L47-L88
dancryer/PHPCI
PHPCI/Command/PollCommand.php
PollCommand.execute
protected function execute(InputInterface $input, OutputInterface $output) { $parser = new Parser(); $yaml = file_get_contents(APPLICATION_PATH . 'PHPCI/config.yml'); $this->settings = $parser->parse($yaml); $token = $this->settings['phpci']['github']['token']; if (!$token)...
php
protected function execute(InputInterface $input, OutputInterface $output) { $parser = new Parser(); $yaml = file_get_contents(APPLICATION_PATH . 'PHPCI/config.yml'); $this->settings = $parser->parse($yaml); $token = $this->settings['phpci']['github']['token']; if (!$token)...
[ "protected", "function", "execute", "(", "InputInterface", "$", "input", ",", "OutputInterface", "$", "output", ")", "{", "$", "parser", "=", "new", "Parser", "(", ")", ";", "$", "yaml", "=", "file_get_contents", "(", "APPLICATION_PATH", ".", "'PHPCI/config.ym...
Pulls all pending builds from the database and runs them.
[ "Pulls", "all", "pending", "builds", "from", "the", "database", "and", "runs", "them", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Command/PollCommand.php#L51-L104
dancryer/PHPCI
PHPCI/Controller/BuildController.php
BuildController.init
public function init() { $this->buildStore = b8\Store\Factory::getStore('Build'); $this->buildService = new BuildService($this->buildStore); }
php
public function init() { $this->buildStore = b8\Store\Factory::getStore('Build'); $this->buildService = new BuildService($this->buildStore); }
[ "public", "function", "init", "(", ")", "{", "$", "this", "->", "buildStore", "=", "b8", "\\", "Store", "\\", "Factory", "::", "getStore", "(", "'Build'", ")", ";", "$", "this", "->", "buildService", "=", "new", "BuildService", "(", "$", "this", "->", ...
Initialise the controller, set up stores and services.
[ "Initialise", "the", "controller", "set", "up", "stores", "and", "services", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Controller/BuildController.php#L43-L47
dancryer/PHPCI
PHPCI/Controller/BuildController.php
BuildController.view
public function view($buildId) { try { $build = BuildFactory::getBuildById($buildId); } catch (\Exception $ex) { $build = null; } if (empty($build)) { throw new NotFoundException(Lang::get('build_x_not_found', $buildId)); } $this-...
php
public function view($buildId) { try { $build = BuildFactory::getBuildById($buildId); } catch (\Exception $ex) { $build = null; } if (empty($build)) { throw new NotFoundException(Lang::get('build_x_not_found', $buildId)); } $this-...
[ "public", "function", "view", "(", "$", "buildId", ")", "{", "try", "{", "$", "build", "=", "BuildFactory", "::", "getBuildById", "(", "$", "buildId", ")", ";", "}", "catch", "(", "\\", "Exception", "$", "ex", ")", "{", "$", "build", "=", "null", "...
View a specific build.
[ "View", "a", "specific", "build", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Controller/BuildController.php#L52-L102
dancryer/PHPCI
PHPCI/Controller/BuildController.php
BuildController.getUiPlugins
protected function getUiPlugins() { $rtn = array(); $path = APPLICATION_PATH . 'public/assets/js/build-plugins/'; $dir = opendir($path); while ($item = readdir($dir)) { if (substr($item, 0, 1) == '.' || substr($item, -3) != '.js') { continue; ...
php
protected function getUiPlugins() { $rtn = array(); $path = APPLICATION_PATH . 'public/assets/js/build-plugins/'; $dir = opendir($path); while ($item = readdir($dir)) { if (substr($item, 0, 1) == '.' || substr($item, -3) != '.js') { continue; ...
[ "protected", "function", "getUiPlugins", "(", ")", "{", "$", "rtn", "=", "array", "(", ")", ";", "$", "path", "=", "APPLICATION_PATH", ".", "'public/assets/js/build-plugins/'", ";", "$", "dir", "=", "opendir", "(", "$", "path", ")", ";", "while", "(", "$...
Returns an array of the JS plugins to include. @return array
[ "Returns", "an", "array", "of", "the", "JS", "plugins", "to", "include", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Controller/BuildController.php#L108-L123
dancryer/PHPCI
PHPCI/Controller/BuildController.php
BuildController.data
public function data($buildId) { $response = new JsonResponse(); $build = BuildFactory::getBuildById($buildId); if (!$build) { $response->setResponseCode(404); $response->setContent(array()); return $response; } $response->setContent($thi...
php
public function data($buildId) { $response = new JsonResponse(); $build = BuildFactory::getBuildById($buildId); if (!$build) { $response->setResponseCode(404); $response->setContent(array()); return $response; } $response->setContent($thi...
[ "public", "function", "data", "(", "$", "buildId", ")", "{", "$", "response", "=", "new", "JsonResponse", "(", ")", ";", "$", "build", "=", "BuildFactory", "::", "getBuildById", "(", "$", "buildId", ")", ";", "if", "(", "!", "$", "build", ")", "{", ...
AJAX call to get build data:
[ "AJAX", "call", "to", "get", "build", "data", ":" ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Controller/BuildController.php#L128-L141
dancryer/PHPCI
PHPCI/Controller/BuildController.php
BuildController.meta
public function meta($buildId) { $build = BuildFactory::getBuildById($buildId); $key = $this->getParam('key', null); $numBuilds = $this->getParam('num_builds', 1); $data = null; if ($key && $build) { $data = $this->buildStore->getMeta($key, $build->getProjectId(...
php
public function meta($buildId) { $build = BuildFactory::getBuildById($buildId); $key = $this->getParam('key', null); $numBuilds = $this->getParam('num_builds', 1); $data = null; if ($key && $build) { $data = $this->buildStore->getMeta($key, $build->getProjectId(...
[ "public", "function", "meta", "(", "$", "buildId", ")", "{", "$", "build", "=", "BuildFactory", "::", "getBuildById", "(", "$", "buildId", ")", ";", "$", "key", "=", "$", "this", "->", "getParam", "(", "'key'", ",", "null", ")", ";", "$", "numBuilds"...
AJAX call to get build meta:
[ "AJAX", "call", "to", "get", "build", "meta", ":" ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Controller/BuildController.php#L146-L160
dancryer/PHPCI
PHPCI/Controller/BuildController.php
BuildController.getBuildData
protected function getBuildData(Build $build) { $data = array(); $data['status'] = (int)$build->getStatus(); $data['log'] = $this->cleanLog($build->getLog()); $data['created'] = !is_null($build->getCreated()) ? $build->getCreated()->format('Y-m-d H:i:s') :...
php
protected function getBuildData(Build $build) { $data = array(); $data['status'] = (int)$build->getStatus(); $data['log'] = $this->cleanLog($build->getLog()); $data['created'] = !is_null($build->getCreated()) ? $build->getCreated()->format('Y-m-d H:i:s') :...
[ "protected", "function", "getBuildData", "(", "Build", "$", "build", ")", "{", "$", "data", "=", "array", "(", ")", ";", "$", "data", "[", "'status'", "]", "=", "(", "int", ")", "$", "build", "->", "getStatus", "(", ")", ";", "$", "data", "[", "'...
Get build data from database and json encode it:
[ "Get", "build", "data", "from", "database", "and", "json", "encode", "it", ":" ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Controller/BuildController.php#L165-L188
dancryer/PHPCI
PHPCI/Controller/BuildController.php
BuildController.rebuild
public function rebuild($buildId) { $copy = BuildFactory::getBuildById($buildId); if (empty($copy)) { throw new NotFoundException(Lang::get('build_x_not_found', $buildId)); } $build = $this->buildService->createDuplicateBuild($copy); if ($this->buildService->...
php
public function rebuild($buildId) { $copy = BuildFactory::getBuildById($buildId); if (empty($copy)) { throw new NotFoundException(Lang::get('build_x_not_found', $buildId)); } $build = $this->buildService->createDuplicateBuild($copy); if ($this->buildService->...
[ "public", "function", "rebuild", "(", "$", "buildId", ")", "{", "$", "copy", "=", "BuildFactory", "::", "getBuildById", "(", "$", "buildId", ")", ";", "if", "(", "empty", "(", "$", "copy", ")", ")", "{", "throw", "new", "NotFoundException", "(", "Lang"...
Create a build using an existing build as a template:
[ "Create", "a", "build", "using", "an", "existing", "build", "as", "a", "template", ":" ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Controller/BuildController.php#L193-L210
dancryer/PHPCI
PHPCI/Controller/BuildController.php
BuildController.delete
public function delete($buildId) { $this->requireAdmin(); $build = BuildFactory::getBuildById($buildId); if (empty($build)) { throw new NotFoundException(Lang::get('build_x_not_found', $buildId)); } $this->buildService->deleteBuild($build); $response =...
php
public function delete($buildId) { $this->requireAdmin(); $build = BuildFactory::getBuildById($buildId); if (empty($build)) { throw new NotFoundException(Lang::get('build_x_not_found', $buildId)); } $this->buildService->deleteBuild($build); $response =...
[ "public", "function", "delete", "(", "$", "buildId", ")", "{", "$", "this", "->", "requireAdmin", "(", ")", ";", "$", "build", "=", "BuildFactory", "::", "getBuildById", "(", "$", "buildId", ")", ";", "if", "(", "empty", "(", "$", "build", ")", ")", ...
Delete a build.
[ "Delete", "a", "build", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Controller/BuildController.php#L215-L230
dancryer/PHPCI
PHPCI/Controller/BuildController.php
BuildController.formatBuilds
protected function formatBuilds($builds) { Project::$sleepable = array('id', 'title', 'reference', 'type'); $rtn = array('count' => $builds['count'], 'items' => array()); foreach ($builds['items'] as $build) { $item = $build->toArray(1); $header = new b8\View('Buil...
php
protected function formatBuilds($builds) { Project::$sleepable = array('id', 'title', 'reference', 'type'); $rtn = array('count' => $builds['count'], 'items' => array()); foreach ($builds['items'] as $build) { $item = $build->toArray(1); $header = new b8\View('Buil...
[ "protected", "function", "formatBuilds", "(", "$", "builds", ")", "{", "Project", "::", "$", "sleepable", "=", "array", "(", "'id'", ",", "'title'", ",", "'reference'", ",", "'type'", ")", ";", "$", "rtn", "=", "array", "(", "'count'", "=>", "$", "buil...
Formats a list of builds into rows suitable for the dropdowns in the PHPCI header bar. @param $builds @return array
[ "Formats", "a", "list", "of", "builds", "into", "rows", "suitable", "for", "the", "dropdowns", "in", "the", "PHPCI", "header", "bar", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Controller/BuildController.php#L260-L278
dancryer/PHPCI
PHPCI/Plugin/Git.php
Git.execute
public function execute() { $buildPath = $this->phpci->buildPath; // Check if there are any actions to be run for the branch we're running on: if (!array_key_exists($this->build->getBranch(), $this->actions)) { return true; } // If there are, run them: $...
php
public function execute() { $buildPath = $this->phpci->buildPath; // Check if there are any actions to be run for the branch we're running on: if (!array_key_exists($this->build->getBranch(), $this->actions)) { return true; } // If there are, run them: $...
[ "public", "function", "execute", "(", ")", "{", "$", "buildPath", "=", "$", "this", "->", "phpci", "->", "buildPath", ";", "// Check if there are any actions to be run for the branch we're running on:", "if", "(", "!", "array_key_exists", "(", "$", "this", "->", "bu...
Run the Git plugin. @return bool
[ "Run", "the", "Git", "plugin", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Plugin/Git.php#L45-L69
dancryer/PHPCI
PHPCI/Plugin/Git.php
Git.runAction
protected function runAction($action, array $options = array()) { switch ($action) { case 'merge': return $this->runMergeAction($options); case 'tag': return $this->runTagAction($options); case 'pull': return $this->runPul...
php
protected function runAction($action, array $options = array()) { switch ($action) { case 'merge': return $this->runMergeAction($options); case 'tag': return $this->runTagAction($options); case 'pull': return $this->runPul...
[ "protected", "function", "runAction", "(", "$", "action", ",", "array", "$", "options", "=", "array", "(", ")", ")", "{", "switch", "(", "$", "action", ")", "{", "case", "'merge'", ":", "return", "$", "this", "->", "runMergeAction", "(", "$", "options"...
Determine which action to run, and run it. @param $action @param array $options @return bool
[ "Determine", "which", "action", "to", "run", "and", "run", "it", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Plugin/Git.php#L77-L95
dancryer/PHPCI
PHPCI/Plugin/Git.php
Git.runMergeAction
protected function runMergeAction($options) { if (array_key_exists('branch', $options)) { $cmd = 'cd "%s" && git checkout %s && git merge "%s"'; $path = $this->phpci->buildPath; return $this->phpci->executeCommand($cmd, $path, $options['branch'], $this->build->getBranch()...
php
protected function runMergeAction($options) { if (array_key_exists('branch', $options)) { $cmd = 'cd "%s" && git checkout %s && git merge "%s"'; $path = $this->phpci->buildPath; return $this->phpci->executeCommand($cmd, $path, $options['branch'], $this->build->getBranch()...
[ "protected", "function", "runMergeAction", "(", "$", "options", ")", "{", "if", "(", "array_key_exists", "(", "'branch'", ",", "$", "options", ")", ")", "{", "$", "cmd", "=", "'cd \"%s\" && git checkout %s && git merge \"%s\"'", ";", "$", "path", "=", "$", "th...
Handle a merge action. @param $options @return bool
[ "Handle", "a", "merge", "action", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Plugin/Git.php#L102-L109
dancryer/PHPCI
PHPCI/Plugin/Git.php
Git.runTagAction
protected function runTagAction($options) { $tagName = date('Ymd-His'); $message = Lang::get('tag_created', date('Y-m-d H:i:s')); if (array_key_exists('name', $options)) { $tagName = $this->phpci->interpolate($options['name']); } if (array_key_exists('message', ...
php
protected function runTagAction($options) { $tagName = date('Ymd-His'); $message = Lang::get('tag_created', date('Y-m-d H:i:s')); if (array_key_exists('name', $options)) { $tagName = $this->phpci->interpolate($options['name']); } if (array_key_exists('message', ...
[ "protected", "function", "runTagAction", "(", "$", "options", ")", "{", "$", "tagName", "=", "date", "(", "'Ymd-His'", ")", ";", "$", "message", "=", "Lang", "::", "get", "(", "'tag_created'", ",", "date", "(", "'Y-m-d H:i:s'", ")", ")", ";", "if", "("...
Handle a tag action. @param $options @return bool
[ "Handle", "a", "tag", "action", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Plugin/Git.php#L116-L131
dancryer/PHPCI
PHPCI/Plugin/Git.php
Git.runPullAction
protected function runPullAction($options) { $branch = $this->build->getBranch(); $remote = 'origin'; if (array_key_exists('branch', $options)) { $branch = $this->phpci->interpolate($options['branch']); } if (array_key_exists('remote', $options)) { $...
php
protected function runPullAction($options) { $branch = $this->build->getBranch(); $remote = 'origin'; if (array_key_exists('branch', $options)) { $branch = $this->phpci->interpolate($options['branch']); } if (array_key_exists('remote', $options)) { $...
[ "protected", "function", "runPullAction", "(", "$", "options", ")", "{", "$", "branch", "=", "$", "this", "->", "build", "->", "getBranch", "(", ")", ";", "$", "remote", "=", "'origin'", ";", "if", "(", "array_key_exists", "(", "'branch'", ",", "$", "o...
Handle a pull action. @param $options @return bool
[ "Handle", "a", "pull", "action", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Plugin/Git.php#L138-L152
dancryer/PHPCI
PHPCI/Plugin/PhpDocblockChecker.php
PhpDocblockChecker.execute
public function execute() { // Check that the binary exists: $checker = $this->phpci->findBinary('phpdoccheck'); // Build ignore string: $ignore = ''; if (count($this->ignore)) { $ignore = ' --exclude="' . implode(',', $this->ignore) . '"'; } // ...
php
public function execute() { // Check that the binary exists: $checker = $this->phpci->findBinary('phpdoccheck'); // Build ignore string: $ignore = ''; if (count($this->ignore)) { $ignore = ' --exclude="' . implode(',', $this->ignore) . '"'; } // ...
[ "public", "function", "execute", "(", ")", "{", "// Check that the binary exists:", "$", "checker", "=", "$", "this", "->", "phpci", "->", "findBinary", "(", "'phpdoccheck'", ")", ";", "// Build ignore string:", "$", "ignore", "=", "''", ";", "if", "(", "count...
Runs PHP Mess Detector in a specified directory.
[ "Runs", "PHP", "Mess", "Detector", "in", "a", "specified", "directory", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Plugin/PhpDocblockChecker.php#L102-L153
dancryer/PHPCI
PHPCI/Plugin/PhpDocblockChecker.php
PhpDocblockChecker.reportErrors
protected function reportErrors($output) { foreach ($output as $error) { $message = 'Class ' . $error['class'] . ' is missing a docblock.'; $severity = PHPCI\Model\BuildError::SEVERITY_LOW; if ($error['type'] == 'method') { $message = $error['class'] . ':...
php
protected function reportErrors($output) { foreach ($output as $error) { $message = 'Class ' . $error['class'] . ' is missing a docblock.'; $severity = PHPCI\Model\BuildError::SEVERITY_LOW; if ($error['type'] == 'method') { $message = $error['class'] . ':...
[ "protected", "function", "reportErrors", "(", "$", "output", ")", "{", "foreach", "(", "$", "output", "as", "$", "error", ")", "{", "$", "message", "=", "'Class '", ".", "$", "error", "[", "'class'", "]", ".", "' is missing a docblock.'", ";", "$", "seve...
Report all of the errors we've encountered line-by-line. @param $output
[ "Report", "all", "of", "the", "errors", "we", "ve", "encountered", "line", "-", "by", "-", "line", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Plugin/PhpDocblockChecker.php#L159-L179
dancryer/PHPCI
PHPCI/Command/InstallCommand.php
InstallCommand.execute
protected function execute(InputInterface $input, OutputInterface $output) { $this->configFilePath = $input->getOption('config-path'); if (!$this->verifyNotInstalled($output)) { return; } $output->writeln(''); $output->writeln('<info>******************</info>');...
php
protected function execute(InputInterface $input, OutputInterface $output) { $this->configFilePath = $input->getOption('config-path'); if (!$this->verifyNotInstalled($output)) { return; } $output->writeln(''); $output->writeln('<info>******************</info>');...
[ "protected", "function", "execute", "(", "InputInterface", "$", "input", ",", "OutputInterface", "$", "output", ")", "{", "$", "this", "->", "configFilePath", "=", "$", "input", "->", "getOption", "(", "'config-path'", ")", ";", "if", "(", "!", "$", "this"...
Installs PHPCI - Can be run more than once as long as you ^C instead of entering an email address.
[ "Installs", "PHPCI", "-", "Can", "be", "run", "more", "than", "once", "as", "long", "as", "you", "^C", "instead", "of", "entering", "an", "email", "address", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Command/InstallCommand.php#L60-L105
dancryer/PHPCI
PHPCI/Command/InstallCommand.php
InstallCommand.checkRequirements
protected function checkRequirements(OutputInterface $output) { $output->write('Checking requirements...'); $errors = false; // Check PHP version: if (!(version_compare(PHP_VERSION, '5.3.8') >= 0)) { $output->writeln(''); $output->writeln('<error>'.Lang::get(...
php
protected function checkRequirements(OutputInterface $output) { $output->write('Checking requirements...'); $errors = false; // Check PHP version: if (!(version_compare(PHP_VERSION, '5.3.8') >= 0)) { $output->writeln(''); $output->writeln('<error>'.Lang::get(...
[ "protected", "function", "checkRequirements", "(", "OutputInterface", "$", "output", ")", "{", "$", "output", "->", "write", "(", "'Checking requirements...'", ")", ";", "$", "errors", "=", "false", ";", "// Check PHP version:", "if", "(", "!", "(", "version_com...
Check PHP version, required modules and for disabled functions. @param OutputInterface $output @throws \Exception
[ "Check", "PHP", "version", "required", "modules", "and", "for", "disabled", "functions", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Command/InstallCommand.php#L113-L159
dancryer/PHPCI
PHPCI/Command/InstallCommand.php
InstallCommand.getAdminInformation
protected function getAdminInformation(InputInterface $input, OutputInterface $output) { $admin = array(); /** * @var \Symfony\Component\Console\Helper\DialogHelper */ $dialog = $this->getHelperSet()->get('dialog'); // Function to validate mail address. $m...
php
protected function getAdminInformation(InputInterface $input, OutputInterface $output) { $admin = array(); /** * @var \Symfony\Component\Console\Helper\DialogHelper */ $dialog = $this->getHelperSet()->get('dialog'); // Function to validate mail address. $m...
[ "protected", "function", "getAdminInformation", "(", "InputInterface", "$", "input", ",", "OutputInterface", "$", "output", ")", "{", "$", "admin", "=", "array", "(", ")", ";", "/**\n * @var \\Symfony\\Component\\Console\\Helper\\DialogHelper\n */", "$", "...
Load information for admin user form CLI options or ask info to user. @param InputInterface $input @param OutputInterface $output @return array
[ "Load", "information", "for", "admin", "user", "form", "CLI", "options", "or", "ask", "info", "to", "user", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Command/InstallCommand.php#L168-L203
dancryer/PHPCI
PHPCI/Command/InstallCommand.php
InstallCommand.getPhpciConfigInformation
protected function getPhpciConfigInformation(InputInterface $input, OutputInterface $output) { $phpci = array(); /** * @var \Symfony\Component\Console\Helper\DialogHelper */ $dialog = $this->getHelperSet()->get('dialog'); // FUnction do validate URL. $urlV...
php
protected function getPhpciConfigInformation(InputInterface $input, OutputInterface $output) { $phpci = array(); /** * @var \Symfony\Component\Console\Helper\DialogHelper */ $dialog = $this->getHelperSet()->get('dialog'); // FUnction do validate URL. $urlV...
[ "protected", "function", "getPhpciConfigInformation", "(", "InputInterface", "$", "input", ",", "OutputInterface", "$", "output", ")", "{", "$", "phpci", "=", "array", "(", ")", ";", "/**\n * @var \\Symfony\\Component\\Console\\Helper\\DialogHelper\n */", "$...
Load configuration for PHPCI form CLI options or ask info to user. @param InputInterface $input @param OutputInterface $output @return array
[ "Load", "configuration", "for", "PHPCI", "form", "CLI", "options", "or", "ask", "info", "to", "user", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Command/InstallCommand.php#L212-L240
dancryer/PHPCI
PHPCI/Command/InstallCommand.php
InstallCommand.getQueueInformation
protected function getQueueInformation(InputInterface $input, OutputInterface $output, DialogHelper $dialog) { if ($input->getOption('queue-disabled')) { return null; } $rtn = []; $helper = $this->getHelper('question'); $question = new ConfirmationQuestion('Use ...
php
protected function getQueueInformation(InputInterface $input, OutputInterface $output, DialogHelper $dialog) { if ($input->getOption('queue-disabled')) { return null; } $rtn = []; $helper = $this->getHelper('question'); $question = new ConfirmationQuestion('Use ...
[ "protected", "function", "getQueueInformation", "(", "InputInterface", "$", "input", ",", "OutputInterface", "$", "output", ",", "DialogHelper", "$", "dialog", ")", "{", "if", "(", "$", "input", "->", "getOption", "(", "'queue-disabled'", ")", ")", "{", "retur...
If the user wants to use a queue, get the necessary details. @param InputInterface $input @param OutputInterface $output @param DialogHelper $dialog @return array
[ "If", "the", "user", "wants", "to", "use", "a", "queue", "get", "the", "necessary", "details", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Command/InstallCommand.php#L249-L274
dancryer/PHPCI
PHPCI/Command/InstallCommand.php
InstallCommand.getDatabaseInformation
protected function getDatabaseInformation(InputInterface $input, OutputInterface $output) { $db = array(); /** * @var \Symfony\Component\Console\Helper\DialogHelper */ $dialog = $this->getHelperSet()->get('dialog'); if (!$dbHost = $input->getOption('db-host')) { ...
php
protected function getDatabaseInformation(InputInterface $input, OutputInterface $output) { $db = array(); /** * @var \Symfony\Component\Console\Helper\DialogHelper */ $dialog = $this->getHelperSet()->get('dialog'); if (!$dbHost = $input->getOption('db-host')) { ...
[ "protected", "function", "getDatabaseInformation", "(", "InputInterface", "$", "input", ",", "OutputInterface", "$", "output", ")", "{", "$", "db", "=", "array", "(", ")", ";", "/**\n * @var \\Symfony\\Component\\Console\\Helper\\DialogHelper\n */", "$", "...
Load configuration for DB form CLI options or ask info to user. @param InputInterface $input @param OutputInterface $output @return array
[ "Load", "configuration", "for", "DB", "form", "CLI", "options", "or", "ask", "info", "to", "user", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Command/InstallCommand.php#L283-L315
dancryer/PHPCI
PHPCI/Command/InstallCommand.php
InstallCommand.verifyDatabaseDetails
protected function verifyDatabaseDetails(array $db, OutputInterface $output) { try { $pdo = new PDO( 'mysql:host='.$db['servers']['write'].';dbname='.$db['name'], $db['username'], $db['password'], array( \PDO::AT...
php
protected function verifyDatabaseDetails(array $db, OutputInterface $output) { try { $pdo = new PDO( 'mysql:host='.$db['servers']['write'].';dbname='.$db['name'], $db['username'], $db['password'], array( \PDO::AT...
[ "protected", "function", "verifyDatabaseDetails", "(", "array", "$", "db", ",", "OutputInterface", "$", "output", ")", "{", "try", "{", "$", "pdo", "=", "new", "PDO", "(", "'mysql:host='", ".", "$", "db", "[", "'servers'", "]", "[", "'write'", "]", ".", ...
Try and connect to MySQL using the details provided. @param array $db @param OutputInterface $output @return bool
[ "Try", "and", "connect", "to", "MySQL", "using", "the", "details", "provided", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Command/InstallCommand.php#L323-L348
dancryer/PHPCI
PHPCI/Command/InstallCommand.php
InstallCommand.writeConfigFile
protected function writeConfigFile(array $config) { $dumper = new \Symfony\Component\Yaml\Dumper(); $yaml = $dumper->dump($config, 4); file_put_contents($this->configFilePath, $yaml); }
php
protected function writeConfigFile(array $config) { $dumper = new \Symfony\Component\Yaml\Dumper(); $yaml = $dumper->dump($config, 4); file_put_contents($this->configFilePath, $yaml); }
[ "protected", "function", "writeConfigFile", "(", "array", "$", "config", ")", "{", "$", "dumper", "=", "new", "\\", "Symfony", "\\", "Component", "\\", "Yaml", "\\", "Dumper", "(", ")", ";", "$", "yaml", "=", "$", "dumper", "->", "dump", "(", "$", "c...
Write the PHPCI config.yml file. @param array $config
[ "Write", "the", "PHPCI", "config", ".", "yml", "file", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Command/InstallCommand.php#L354-L360
dancryer/PHPCI
PHPCI/Command/InstallCommand.php
InstallCommand.createAdminUser
protected function createAdminUser($admin, $output) { try { $this->reloadConfig(); $userStore = Factory::getStore('User'); $userService = new UserService($userStore); $userService->createUser($admin['name'], $admin['mail'], $admin['pass'], 1); $o...
php
protected function createAdminUser($admin, $output) { try { $this->reloadConfig(); $userStore = Factory::getStore('User'); $userService = new UserService($userStore); $userService->createUser($admin['name'], $admin['mail'], $admin['pass'], 1); $o...
[ "protected", "function", "createAdminUser", "(", "$", "admin", ",", "$", "output", ")", "{", "try", "{", "$", "this", "->", "reloadConfig", "(", ")", ";", "$", "userStore", "=", "Factory", "::", "getStore", "(", "'User'", ")", ";", "$", "userService", ...
Create admin user using information loaded before. @param array $admin @param OutputInterface $output
[ "Create", "admin", "user", "using", "information", "loaded", "before", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Command/InstallCommand.php#L379-L393
dancryer/PHPCI
PHPCI/Service/UserService.php
UserService.createUser
public function createUser($name, $emailAddress, $password, $isAdmin = false) { $user = new User(); $user->setName($name); $user->setEmail($emailAddress); $user->setHash(password_hash($password, PASSWORD_DEFAULT)); $user->setIsAdmin(($isAdmin ? 1 : 0)); return $this-...
php
public function createUser($name, $emailAddress, $password, $isAdmin = false) { $user = new User(); $user->setName($name); $user->setEmail($emailAddress); $user->setHash(password_hash($password, PASSWORD_DEFAULT)); $user->setIsAdmin(($isAdmin ? 1 : 0)); return $this-...
[ "public", "function", "createUser", "(", "$", "name", ",", "$", "emailAddress", ",", "$", "password", ",", "$", "isAdmin", "=", "false", ")", "{", "$", "user", "=", "new", "User", "(", ")", ";", "$", "user", "->", "setName", "(", "$", "name", ")", ...
Create a new user within PHPCI. @param $name @param $emailAddress @param $password @param bool $isAdmin @return \PHPCI\Model\User
[ "Create", "a", "new", "user", "within", "PHPCI", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Service/UserService.php#L43-L52
dancryer/PHPCI
PHPCI/Service/UserService.php
UserService.updateUser
public function updateUser(User $user, $name, $emailAddress, $password = null, $isAdmin = null) { $user->setName($name); $user->setEmail($emailAddress); if (!empty($password)) { $user->setHash(password_hash($password, PASSWORD_DEFAULT)); } if (!is_null($isAdmin)...
php
public function updateUser(User $user, $name, $emailAddress, $password = null, $isAdmin = null) { $user->setName($name); $user->setEmail($emailAddress); if (!empty($password)) { $user->setHash(password_hash($password, PASSWORD_DEFAULT)); } if (!is_null($isAdmin)...
[ "public", "function", "updateUser", "(", "User", "$", "user", ",", "$", "name", ",", "$", "emailAddress", ",", "$", "password", "=", "null", ",", "$", "isAdmin", "=", "null", ")", "{", "$", "user", "->", "setName", "(", "$", "name", ")", ";", "$", ...
Update a user. @param User $user @param $name @param $emailAddress @param null $password @param null $isAdmin @return \PHPCI\Model\User
[ "Update", "a", "user", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Service/UserService.php#L63-L77
dancryer/PHPCI
PHPCI/Controller/GroupController.php
GroupController.index
public function index() { $this->requireAdmin(); $groups = array(); $groupList = $this->groupStore->getWhere(array(), 100, 0, array(), array('title' => 'ASC')); foreach ($groupList['items'] as $group) { $thisGroup = array( 'title' => $group->getTitle(), ...
php
public function index() { $this->requireAdmin(); $groups = array(); $groupList = $this->groupStore->getWhere(array(), 100, 0, array(), array('title' => 'ASC')); foreach ($groupList['items'] as $group) { $thisGroup = array( 'title' => $group->getTitle(), ...
[ "public", "function", "index", "(", ")", "{", "$", "this", "->", "requireAdmin", "(", ")", ";", "$", "groups", "=", "array", "(", ")", ";", "$", "groupList", "=", "$", "this", "->", "groupStore", "->", "getWhere", "(", "array", "(", ")", ",", "100"...
List project groups.
[ "List", "project", "groups", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Controller/GroupController.php#L42-L60
dancryer/PHPCI
PHPCI/Controller/GroupController.php
GroupController.edit
public function edit($groupId = null) { $this->requireAdmin(); if (!is_null($groupId)) { $group = $this->groupStore->getById($groupId); } else { $group = new ProjectGroup(); } if ($this->request->getMethod() == 'POST') { $group->setTitle(...
php
public function edit($groupId = null) { $this->requireAdmin(); if (!is_null($groupId)) { $group = $this->groupStore->getById($groupId); } else { $group = new ProjectGroup(); } if ($this->request->getMethod() == 'POST') { $group->setTitle(...
[ "public", "function", "edit", "(", "$", "groupId", "=", "null", ")", "{", "$", "this", "->", "requireAdmin", "(", ")", ";", "if", "(", "!", "is_null", "(", "$", "groupId", ")", ")", "{", "$", "group", "=", "$", "this", "->", "groupStore", "->", "...
Add or edit a project group. @param null $groupId @return void|b8\Http\Response\RedirectResponse
[ "Add", "or", "edit", "a", "project", "group", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Controller/GroupController.php#L67-L103
dancryer/PHPCI
PHPCI/Controller/GroupController.php
GroupController.delete
public function delete($groupId) { $this->requireAdmin(); $group = $this->groupStore->getById($groupId); $this->groupStore->delete($group); $response = new b8\Http\Response\RedirectResponse(); $response->setHeader('Location', PHPCI_URL.'group'); return $response; ...
php
public function delete($groupId) { $this->requireAdmin(); $group = $this->groupStore->getById($groupId); $this->groupStore->delete($group); $response = new b8\Http\Response\RedirectResponse(); $response->setHeader('Location', PHPCI_URL.'group'); return $response; ...
[ "public", "function", "delete", "(", "$", "groupId", ")", "{", "$", "this", "->", "requireAdmin", "(", ")", ";", "$", "group", "=", "$", "this", "->", "groupStore", "->", "getById", "(", "$", "groupId", ")", ";", "$", "this", "->", "groupStore", "->"...
Delete a project group. @param $groupId @return b8\Http\Response\RedirectResponse
[ "Delete", "a", "project", "group", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Controller/GroupController.php#L110-L119
dancryer/PHPCI
PHPCI/Command/UpdateCommand.php
UpdateCommand.execute
protected function execute(InputInterface $input, OutputInterface $output) { if (!$this->verifyInstalled($output)) { return; } $output->write(Lang::get('updating_phpci')); shell_exec(PHPCI_DIR . 'vendor/bin/phinx migrate -c "' . PHPCI_DIR . 'phinx.php"'); $outp...
php
protected function execute(InputInterface $input, OutputInterface $output) { if (!$this->verifyInstalled($output)) { return; } $output->write(Lang::get('updating_phpci')); shell_exec(PHPCI_DIR . 'vendor/bin/phinx migrate -c "' . PHPCI_DIR . 'phinx.php"'); $outp...
[ "protected", "function", "execute", "(", "InputInterface", "$", "input", ",", "OutputInterface", "$", "output", ")", "{", "if", "(", "!", "$", "this", "->", "verifyInstalled", "(", "$", "output", ")", ")", "{", "return", ";", "}", "$", "output", "->", ...
Generates Model and Store classes by reading database meta data.
[ "Generates", "Model", "and", "Store", "classes", "by", "reading", "database", "meta", "data", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Command/UpdateCommand.php#L48-L59
dancryer/PHPCI
PHPCI/Helper/Diff.php
Diff.getLinePositions
public function getLinePositions($diff) { if (empty($diff)) { return null; } $rtn = array(); $diffLines = explode(PHP_EOL, $diff); while (count($diffLines)) { $line = array_shift($diffLines); if (substr($line, 0, 2) == '@@') { ...
php
public function getLinePositions($diff) { if (empty($diff)) { return null; } $rtn = array(); $diffLines = explode(PHP_EOL, $diff); while (count($diffLines)) { $line = array_shift($diffLines); if (substr($line, 0, 2) == '@@') { ...
[ "public", "function", "getLinePositions", "(", "$", "diff", ")", "{", "if", "(", "empty", "(", "$", "diff", ")", ")", "{", "return", "null", ";", "}", "$", "rtn", "=", "array", "(", ")", ";", "$", "diffLines", "=", "explode", "(", "PHP_EOL", ",", ...
Take a diff @param string $diff @return array
[ "Take", "a", "diff" ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Helper/Diff.php#L27-L61
dancryer/PHPCI
PHPCI/Store/ProjectStore.php
ProjectStore.getKnownBranches
public function getKnownBranches($projectId) { $query = 'SELECT DISTINCT branch from build WHERE project_id = :pid'; $stmt = Database::getConnection('read')->prepare($query); $stmt->bindValue(':pid', $projectId); if ($stmt->execute()) { $res = $stmt->fetchAll(\PDO::FETCH...
php
public function getKnownBranches($projectId) { $query = 'SELECT DISTINCT branch from build WHERE project_id = :pid'; $stmt = Database::getConnection('read')->prepare($query); $stmt->bindValue(':pid', $projectId); if ($stmt->execute()) { $res = $stmt->fetchAll(\PDO::FETCH...
[ "public", "function", "getKnownBranches", "(", "$", "projectId", ")", "{", "$", "query", "=", "'SELECT DISTINCT branch from build WHERE project_id = :pid'", ";", "$", "stmt", "=", "Database", "::", "getConnection", "(", "'read'", ")", "->", "prepare", "(", "$", "q...
Returns a list of all branch names PHPCI has run builds against. @param $projectId @return array
[ "Returns", "a", "list", "of", "all", "branch", "names", "PHPCI", "has", "run", "builds", "against", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Store/ProjectStore.php#L29-L47
dancryer/PHPCI
PHPCI/Store/ProjectStore.php
ProjectStore.getAll
public function getAll() { $query = 'SELECT * FROM `project` ORDER BY `title` ASC'; $stmt = Database::getConnection('read')->prepare($query); if ($stmt->execute()) { $res = $stmt->fetchAll(\PDO::FETCH_ASSOC); $map = function ($item) { return new Proj...
php
public function getAll() { $query = 'SELECT * FROM `project` ORDER BY `title` ASC'; $stmt = Database::getConnection('read')->prepare($query); if ($stmt->execute()) { $res = $stmt->fetchAll(\PDO::FETCH_ASSOC); $map = function ($item) { return new Proj...
[ "public", "function", "getAll", "(", ")", "{", "$", "query", "=", "'SELECT * FROM `project` ORDER BY `title` ASC'", ";", "$", "stmt", "=", "Database", "::", "getConnection", "(", "'read'", ")", "->", "prepare", "(", "$", "query", ")", ";", "if", "(", "$", ...
Get a list of all projects, ordered by their title. @return array
[ "Get", "a", "list", "of", "all", "projects", "ordered", "by", "their", "title", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Store/ProjectStore.php#L53-L73
dancryer/PHPCI
PHPCI/Store/ProjectStore.php
ProjectStore.getByGroupId
public function getByGroupId($value, $limit = 1000, $useConnection = 'read') { if (is_null($value)) { throw new \Exception('Value passed to ' . __FUNCTION__ . ' cannot be null.'); } $query = 'SELECT * FROM `project` WHERE `group_id` = :group_id ORDER BY title LIMIT :limit'; ...
php
public function getByGroupId($value, $limit = 1000, $useConnection = 'read') { if (is_null($value)) { throw new \Exception('Value passed to ' . __FUNCTION__ . ' cannot be null.'); } $query = 'SELECT * FROM `project` WHERE `group_id` = :group_id ORDER BY title LIMIT :limit'; ...
[ "public", "function", "getByGroupId", "(", "$", "value", ",", "$", "limit", "=", "1000", ",", "$", "useConnection", "=", "'read'", ")", "{", "if", "(", "is_null", "(", "$", "value", ")", ")", "{", "throw", "new", "\\", "Exception", "(", "'Value passed ...
Get multiple Project by GroupId. @param int $value @param int $limit @param string $useConnection @return array @throws \Exception
[ "Get", "multiple", "Project", "by", "GroupId", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Store/ProjectStore.php#L83-L108
dancryer/PHPCI
PHPCI/ProcessControl/Factory.php
Factory.createProcessControl
public static function createProcessControl() { switch (true) { case PosixProcessControl::isAvailable(): return new PosixProcessControl(); case WindowsProcessControl::isAvailable(): return new WindowsProcessControl(); case UnixProcessCont...
php
public static function createProcessControl() { switch (true) { case PosixProcessControl::isAvailable(): return new PosixProcessControl(); case WindowsProcessControl::isAvailable(): return new WindowsProcessControl(); case UnixProcessCont...
[ "public", "static", "function", "createProcessControl", "(", ")", "{", "switch", "(", "true", ")", "{", "case", "PosixProcessControl", "::", "isAvailable", "(", ")", ":", "return", "new", "PosixProcessControl", "(", ")", ";", "case", "WindowsProcessControl", "::...
Create a ProcessControl depending on available extensions and the underlying OS. Check PosixProcessControl, WindowsProcessControl and UnixProcessControl, in that order. @return ProcessControlInterface @internal
[ "Create", "a", "ProcessControl", "depending", "on", "available", "extensions", "and", "the", "underlying", "OS", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/ProcessControl/Factory.php#L48-L62
dancryer/PHPCI
PHPCI/Command/GenerateCommand.php
GenerateCommand.execute
protected function execute(InputInterface $input, OutputInterface $output) { $gen = new CodeGenerator( Database::getConnection(), array('default' => 'PHPCI'), array('default' => PHPCI_DIR), false ); $gen->generateModels(); $gen->genera...
php
protected function execute(InputInterface $input, OutputInterface $output) { $gen = new CodeGenerator( Database::getConnection(), array('default' => 'PHPCI'), array('default' => PHPCI_DIR), false ); $gen->generateModels(); $gen->genera...
[ "protected", "function", "execute", "(", "InputInterface", "$", "input", ",", "OutputInterface", "$", "output", ")", "{", "$", "gen", "=", "new", "CodeGenerator", "(", "Database", "::", "getConnection", "(", ")", ",", "array", "(", "'default'", "=>", "'PHPCI...
Generates Model and Store classes by reading database meta data.
[ "Generates", "Model", "and", "Store", "classes", "by", "reading", "database", "meta", "data", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Command/GenerateCommand.php#L36-L47
dancryer/PHPCI
PHPCI/Plugin/Util/FilesPluginInformation.php
FilesPluginInformation.loadPluginInfo
protected function loadPluginInfo() { $this->pluginInfo = array(); foreach ($this->files as $fileInfo) { if ($fileInfo instanceof \SplFileInfo) { if ($fileInfo->isFile() && $fileInfo->getExtension() == 'php') { $this->addPluginFromFile($fileInfo); ...
php
protected function loadPluginInfo() { $this->pluginInfo = array(); foreach ($this->files as $fileInfo) { if ($fileInfo instanceof \SplFileInfo) { if ($fileInfo->isFile() && $fileInfo->getExtension() == 'php') { $this->addPluginFromFile($fileInfo); ...
[ "protected", "function", "loadPluginInfo", "(", ")", "{", "$", "this", "->", "pluginInfo", "=", "array", "(", ")", ";", "foreach", "(", "$", "this", "->", "files", "as", "$", "fileInfo", ")", "{", "if", "(", "$", "fileInfo", "instanceof", "\\", "SplFil...
Load plugin information from a given list of files.
[ "Load", "plugin", "information", "from", "a", "given", "list", "of", "files", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Plugin/Util/FilesPluginInformation.php#L82-L92
dancryer/PHPCI
PHPCI/Plugin/Util/FilesPluginInformation.php
FilesPluginInformation.addPluginFromFile
protected function addPluginFromFile(\SplFileInfo $fileInfo) { $class = $this->getFullClassFromFile($fileInfo); if (!is_null($class)) { $newPlugin = new \stdClass(); $newPlugin->class = $class; $newPlugin->source = "core"; $parts ...
php
protected function addPluginFromFile(\SplFileInfo $fileInfo) { $class = $this->getFullClassFromFile($fileInfo); if (!is_null($class)) { $newPlugin = new \stdClass(); $newPlugin->class = $class; $newPlugin->source = "core"; $parts ...
[ "protected", "function", "addPluginFromFile", "(", "\\", "SplFileInfo", "$", "fileInfo", ")", "{", "$", "class", "=", "$", "this", "->", "getFullClassFromFile", "(", "$", "fileInfo", ")", ";", "if", "(", "!", "is_null", "(", "$", "class", ")", ")", "{", ...
Add a plugin to the list from a given file. @param \SplFileInfo $fileInfo
[ "Add", "a", "plugin", "to", "the", "list", "from", "a", "given", "file", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Plugin/Util/FilesPluginInformation.php#L98-L111
dancryer/PHPCI
PHPCI/Plugin/Util/FilesPluginInformation.php
FilesPluginInformation.getFullClassFromFile
protected function getFullClassFromFile(\SplFileInfo $fileInfo) { $contents = file_get_contents($fileInfo->getRealPath()); $matches = array(); preg_match('#class +([A-Za-z]+) +implements#i', $contents, $matches); if (isset($matches[1])) { $className = $matches[1]; ...
php
protected function getFullClassFromFile(\SplFileInfo $fileInfo) { $contents = file_get_contents($fileInfo->getRealPath()); $matches = array(); preg_match('#class +([A-Za-z]+) +implements#i', $contents, $matches); if (isset($matches[1])) { $className = $matches[1]; ...
[ "protected", "function", "getFullClassFromFile", "(", "\\", "SplFileInfo", "$", "fileInfo", ")", "{", "$", "contents", "=", "file_get_contents", "(", "$", "fileInfo", "->", "getRealPath", "(", ")", ")", ";", "$", "matches", "=", "array", "(", ")", ";", "pr...
Determine plugin class name for a given file. @param \SplFileInfo $fileInfo @return null|string
[ "Determine", "plugin", "class", "name", "for", "a", "given", "file", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Plugin/Util/FilesPluginInformation.php#L118-L136
dancryer/PHPCI
PHPCI/Plugin/CleanBuild.php
CleanBuild.execute
public function execute() { $cmd = 'rm -Rf "%s"'; if (IS_WIN) { $cmd = 'rmdir /S /Q "%s"'; } $this->phpci->executeCommand($cmd, $this->phpci->buildPath . 'composer.phar'); $this->phpci->executeCommand($cmd, $this->phpci->buildPath . 'composer.lock'); $suc...
php
public function execute() { $cmd = 'rm -Rf "%s"'; if (IS_WIN) { $cmd = 'rmdir /S /Q "%s"'; } $this->phpci->executeCommand($cmd, $this->phpci->buildPath . 'composer.phar'); $this->phpci->executeCommand($cmd, $this->phpci->buildPath . 'composer.lock'); $suc...
[ "public", "function", "execute", "(", ")", "{", "$", "cmd", "=", "'rm -Rf \"%s\"'", ";", "if", "(", "IS_WIN", ")", "{", "$", "cmd", "=", "'rmdir /S /Q \"%s\"'", ";", "}", "$", "this", "->", "phpci", "->", "executeCommand", "(", "$", "cmd", ",", "$", ...
Executes Composer and runs a specified command (e.g. install / update)
[ "Executes", "Composer", "and", "runs", "a", "specified", "command", "(", "e", ".", "g", ".", "install", "/", "update", ")" ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Plugin/CleanBuild.php#L50-L70
dancryer/PHPCI
PHPCI/Plugin/PhpLoc.php
PhpLoc.execute
public function execute() { $ignore = ''; if (count($this->phpci->ignore)) { $map = function ($item) { return ' --exclude ' . rtrim($item, DIRECTORY_SEPARATOR); }; $ignore = array_map($map, $this->phpci->ignore); $ignore = implode('',...
php
public function execute() { $ignore = ''; if (count($this->phpci->ignore)) { $map = function ($item) { return ' --exclude ' . rtrim($item, DIRECTORY_SEPARATOR); }; $ignore = array_map($map, $this->phpci->ignore); $ignore = implode('',...
[ "public", "function", "execute", "(", ")", "{", "$", "ignore", "=", "''", ";", "if", "(", "count", "(", "$", "this", "->", "phpci", "->", "ignore", ")", ")", "{", "$", "map", "=", "function", "(", "$", "item", ")", "{", "return", "' --exclude '", ...
Runs PHP Copy/Paste Detector in a specified directory.
[ "Runs", "PHP", "Copy", "/", "Paste", "Detector", "in", "a", "specified", "directory", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Plugin/PhpLoc.php#L69-L97
dancryer/PHPCI
PHPCI/Model/Base/UserBase.php
UserBase.setEmail
public function setEmail($value) { $this->_validateNotNull('Email', $value); $this->_validateString('Email', $value); if ($this->data['email'] === $value) { return; } $this->data['email'] = $value; $this->_setModified('email'); }
php
public function setEmail($value) { $this->_validateNotNull('Email', $value); $this->_validateString('Email', $value); if ($this->data['email'] === $value) { return; } $this->data['email'] = $value; $this->_setModified('email'); }
[ "public", "function", "setEmail", "(", "$", "value", ")", "{", "$", "this", "->", "_validateNotNull", "(", "'Email'", ",", "$", "value", ")", ";", "$", "this", "->", "_validateString", "(", "'Email'", ",", "$", "value", ")", ";", "if", "(", "$", "thi...
Set the value of Email / email. Must not be null. @param $value string
[ "Set", "the", "value", "of", "Email", "/", "email", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Model/Base/UserBase.php#L205-L217
dancryer/PHPCI
PHPCI/Model/Base/UserBase.php
UserBase.setIsAdmin
public function setIsAdmin($value) { $this->_validateNotNull('IsAdmin', $value); $this->_validateInt('IsAdmin', $value); if ($this->data['is_admin'] === $value) { return; } $this->data['is_admin'] = $value; $this->_setModified('is_admin'); }
php
public function setIsAdmin($value) { $this->_validateNotNull('IsAdmin', $value); $this->_validateInt('IsAdmin', $value); if ($this->data['is_admin'] === $value) { return; } $this->data['is_admin'] = $value; $this->_setModified('is_admin'); }
[ "public", "function", "setIsAdmin", "(", "$", "value", ")", "{", "$", "this", "->", "_validateNotNull", "(", "'IsAdmin'", ",", "$", "value", ")", ";", "$", "this", "->", "_validateInt", "(", "'IsAdmin'", ",", "$", "value", ")", ";", "if", "(", "$", "...
Set the value of IsAdmin / is_admin. Must not be null. @param $value int
[ "Set", "the", "value", "of", "IsAdmin", "/", "is_admin", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Model/Base/UserBase.php#L245-L257
dancryer/PHPCI
PHPCI/Model/Base/UserBase.php
UserBase.setName
public function setName($value) { $this->_validateNotNull('Name', $value); $this->_validateString('Name', $value); if ($this->data['name'] === $value) { return; } $this->data['name'] = $value; $this->_setModified('name'); }
php
public function setName($value) { $this->_validateNotNull('Name', $value); $this->_validateString('Name', $value); if ($this->data['name'] === $value) { return; } $this->data['name'] = $value; $this->_setModified('name'); }
[ "public", "function", "setName", "(", "$", "value", ")", "{", "$", "this", "->", "_validateNotNull", "(", "'Name'", ",", "$", "value", ")", ";", "$", "this", "->", "_validateString", "(", "'Name'", ",", "$", "value", ")", ";", "if", "(", "$", "this",...
Set the value of Name / name. Must not be null. @param $value string
[ "Set", "the", "value", "of", "Name", "/", "name", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Model/Base/UserBase.php#L265-L277
dancryer/PHPCI
PHPCI/Plugin/Campfire.php
Campfire.execute
public function execute() { $url = PHPCI_URL . "build/view/" . $this->build->getId(); $message = str_replace("%buildurl%", $url, $this->message); $this->joinRoom($this->roomId); $status = $this->speak($message, $this->roomId); $this->leaveRoom($this->roomId); return ...
php
public function execute() { $url = PHPCI_URL . "build/view/" . $this->build->getId(); $message = str_replace("%buildurl%", $url, $this->message); $this->joinRoom($this->roomId); $status = $this->speak($message, $this->roomId); $this->leaveRoom($this->roomId); return ...
[ "public", "function", "execute", "(", ")", "{", "$", "url", "=", "PHPCI_URL", ".", "\"build/view/\"", ".", "$", "this", "->", "build", "->", "getId", "(", ")", ";", "$", "message", "=", "str_replace", "(", "\"%buildurl%\"", ",", "$", "url", ",", "$", ...
Run the Campfire plugin. @return bool|mixed
[ "Run", "the", "Campfire", "plugin", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Plugin/Campfire.php#L64-L74
dancryer/PHPCI
PHPCI/Plugin/Campfire.php
Campfire.speak
public function speak($message, $roomId, $isPaste = false) { $page = '/room/'.$roomId.'/speak.json'; if ($isPaste) { $type = 'PasteMessage'; } else { $type = 'TextMessage'; } return $this->getPageByPost($page, array('message' => array('type' => $type...
php
public function speak($message, $roomId, $isPaste = false) { $page = '/room/'.$roomId.'/speak.json'; if ($isPaste) { $type = 'PasteMessage'; } else { $type = 'TextMessage'; } return $this->getPageByPost($page, array('message' => array('type' => $type...
[ "public", "function", "speak", "(", "$", "message", ",", "$", "roomId", ",", "$", "isPaste", "=", "false", ")", "{", "$", "page", "=", "'/room/'", ".", "$", "roomId", ".", "'/speak.json'", ";", "if", "(", "$", "isPaste", ")", "{", "$", "type", "=",...
Send a message to a campfire room. @param $message @param $roomId @param bool $isPaste @return bool|mixed
[ "Send", "a", "message", "to", "a", "campfire", "room", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Plugin/Campfire.php#L101-L113
dancryer/PHPCI
PHPCI/Plugin/Campfire.php
Campfire.getPageByPost
private function getPageByPost($page, $data = null) { $url = $this->url . $page; // The new API allows JSON, so we can pass // PHP data structures instead of old school POST $json = json_encode($data); // cURL init & config $handle = curl_init(); curl_setopt(...
php
private function getPageByPost($page, $data = null) { $url = $this->url . $page; // The new API allows JSON, so we can pass // PHP data structures instead of old school POST $json = json_encode($data); // cURL init & config $handle = curl_init(); curl_setopt(...
[ "private", "function", "getPageByPost", "(", "$", "page", ",", "$", "data", "=", "null", ")", "{", "$", "url", "=", "$", "this", "->", "url", ".", "$", "page", ";", "// The new API allows JSON, so we can pass", "// PHP data structures instead of old school POST", ...
Make a request to Campfire. @param $page @param null $data @return bool|mixed
[ "Make", "a", "request", "to", "Campfire", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Plugin/Campfire.php#L121-L155
dancryer/PHPCI
PHPCI/Controller/SettingsController.php
SettingsController.init
public function init() { parent::init(); $parser = new Parser(); $yaml = file_get_contents(PHPCI_CONFIG_FILE); $this->settings = $parser->parse($yaml); }
php
public function init() { parent::init(); $parser = new Parser(); $yaml = file_get_contents(PHPCI_CONFIG_FILE); $this->settings = $parser->parse($yaml); }
[ "public", "function", "init", "(", ")", "{", "parent", "::", "init", "(", ")", ";", "$", "parser", "=", "new", "Parser", "(", ")", ";", "$", "yaml", "=", "file_get_contents", "(", "PHPCI_CONFIG_FILE", ")", ";", "$", "this", "->", "settings", "=", "$"...
Initialise the controller, set up stores and services.
[ "Initialise", "the", "controller", "set", "up", "stores", "and", "services", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Controller/SettingsController.php#L38-L45
dancryer/PHPCI
PHPCI/Controller/SettingsController.php
SettingsController.index
public function index() { $this->requireAdmin(); $this->layout->title = Lang::get('settings'); $this->view->settings = $this->settings; $basicSettings = array(); if (isset($this->settings['phpci']['basic'])) { $basicSettings = $this->settings['phpci']['basic'];...
php
public function index() { $this->requireAdmin(); $this->layout->title = Lang::get('settings'); $this->view->settings = $this->settings; $basicSettings = array(); if (isset($this->settings['phpci']['basic'])) { $basicSettings = $this->settings['phpci']['basic'];...
[ "public", "function", "index", "(", ")", "{", "$", "this", "->", "requireAdmin", "(", ")", ";", "$", "this", "->", "layout", "->", "title", "=", "Lang", "::", "get", "(", "'settings'", ")", ";", "$", "this", "->", "view", "->", "settings", "=", "$"...
Display settings forms. @return string
[ "Display", "settings", "forms", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Controller/SettingsController.php#L51-L98
dancryer/PHPCI
PHPCI/Controller/SettingsController.php
SettingsController.github
public function github() { $this->requireAdmin(); $this->settings['phpci']['github']['id'] = $this->getParam('githubid', ''); $this->settings['phpci']['github']['secret'] = $this->getParam('githubsecret', ''); $error = $this->storeSettings()...
php
public function github() { $this->requireAdmin(); $this->settings['phpci']['github']['id'] = $this->getParam('githubid', ''); $this->settings['phpci']['github']['secret'] = $this->getParam('githubsecret', ''); $error = $this->storeSettings()...
[ "public", "function", "github", "(", ")", "{", "$", "this", "->", "requireAdmin", "(", ")", ";", "$", "this", "->", "settings", "[", "'phpci'", "]", "[", "'github'", "]", "[", "'id'", "]", "=", "$", "this", "->", "getParam", "(", "'githubid'", ",", ...
Save Github settings.
[ "Save", "Github", "settings", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Controller/SettingsController.php#L103-L120
dancryer/PHPCI
PHPCI/Controller/SettingsController.php
SettingsController.githubCallback
public function githubCallback() { $code = $this->getParam('code', null); $github = $this->settings['phpci']['github']; if (!is_null($code)) { $http = new HttpClient(); $url = 'https://github.com/login/oauth/access_token'; $params = array('client_i...
php
public function githubCallback() { $code = $this->getParam('code', null); $github = $this->settings['phpci']['github']; if (!is_null($code)) { $http = new HttpClient(); $url = 'https://github.com/login/oauth/access_token'; $params = array('client_i...
[ "public", "function", "githubCallback", "(", ")", "{", "$", "code", "=", "$", "this", "->", "getParam", "(", "'code'", ",", "null", ")", ";", "$", "github", "=", "$", "this", "->", "settings", "[", "'phpci'", "]", "[", "'github'", "]", ";", "if", "...
Github redirects users back to this URL when t
[ "Github", "redirects", "users", "back", "to", "this", "URL", "when", "t" ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Controller/SettingsController.php#L234-L260
dancryer/PHPCI
PHPCI/Controller/SettingsController.php
SettingsController.storeSettings
protected function storeSettings() { $dumper = new Dumper(); $yaml = $dumper->dump($this->settings, 4); file_put_contents(PHPCI_CONFIG_FILE, $yaml); if (error_get_last()) { $error_get_last = error_get_last(); return $error_get_last['message']; } ...
php
protected function storeSettings() { $dumper = new Dumper(); $yaml = $dumper->dump($this->settings, 4); file_put_contents(PHPCI_CONFIG_FILE, $yaml); if (error_get_last()) { $error_get_last = error_get_last(); return $error_get_last['message']; } ...
[ "protected", "function", "storeSettings", "(", ")", "{", "$", "dumper", "=", "new", "Dumper", "(", ")", ";", "$", "yaml", "=", "$", "dumper", "->", "dump", "(", "$", "this", "->", "settings", ",", "4", ")", ";", "file_put_contents", "(", "PHPCI_CONFIG_...
Convert config to yaml and store to file. @return mixed
[ "Convert", "config", "to", "yaml", "and", "store", "to", "file", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Controller/SettingsController.php#L267-L277
dancryer/PHPCI
PHPCI/Controller/SettingsController.php
SettingsController.getGithubForm
protected function getGithubForm() { $form = new Form(); $form->setMethod('POST'); $form->setAction(PHPCI_URL . 'settings/github'); $form->addField(new Form\Element\Csrf('csrf')); $field = new Form\Element\Text('githubid'); $field->setRequired(true); $field->...
php
protected function getGithubForm() { $form = new Form(); $form->setMethod('POST'); $form->setAction(PHPCI_URL . 'settings/github'); $form->addField(new Form\Element\Csrf('csrf')); $field = new Form\Element\Text('githubid'); $field->setRequired(true); $field->...
[ "protected", "function", "getGithubForm", "(", ")", "{", "$", "form", "=", "new", "Form", "(", ")", ";", "$", "form", "->", "setMethod", "(", "'POST'", ")", ";", "$", "form", "->", "setAction", "(", "PHPCI_URL", ".", "'settings/github'", ")", ";", "$",...
Get the Github settings form. @return Form
[ "Get", "the", "Github", "settings", "form", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Controller/SettingsController.php#L283-L320
dancryer/PHPCI
PHPCI/Controller/SettingsController.php
SettingsController.getEmailForm
protected function getEmailForm($values = array()) { $form = new Form(); $form->setMethod('POST'); $form->setAction(PHPCI_URL . 'settings/email'); $form->addField(new Form\Element\Csrf('csrf')); $field = new Form\Element\Text('smtp_address'); $field->setRequired(fals...
php
protected function getEmailForm($values = array()) { $form = new Form(); $form->setMethod('POST'); $form->setAction(PHPCI_URL . 'settings/email'); $form->addField(new Form\Element\Csrf('csrf')); $field = new Form\Element\Text('smtp_address'); $field->setRequired(fals...
[ "protected", "function", "getEmailForm", "(", "$", "values", "=", "array", "(", ")", ")", "{", "$", "form", "=", "new", "Form", "(", ")", ";", "$", "form", "->", "setMethod", "(", "'POST'", ")", ";", "$", "form", "->", "setAction", "(", "PHPCI_URL", ...
Get the email settings form. @param array $values @return Form
[ "Get", "the", "email", "settings", "form", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Controller/SettingsController.php#L327-L395
dancryer/PHPCI
PHPCI/Controller/SettingsController.php
SettingsController.getBuildForm
protected function getBuildForm($values = array()) { $form = new Form(); $form->setMethod('POST'); $form->setAction(PHPCI_URL . 'settings/build'); $field = new Form\Element\Select('failed_after'); $field->setRequired(false); $field->setLabel(Lang::get('failed_after')...
php
protected function getBuildForm($values = array()) { $form = new Form(); $form->setMethod('POST'); $form->setAction(PHPCI_URL . 'settings/build'); $field = new Form\Element\Select('failed_after'); $field->setRequired(false); $field->setLabel(Lang::get('failed_after')...
[ "protected", "function", "getBuildForm", "(", "$", "values", "=", "array", "(", ")", ")", "{", "$", "form", "=", "new", "Form", "(", ")", ";", "$", "form", "->", "setMethod", "(", "'POST'", ")", ";", "$", "form", "->", "setAction", "(", "PHPCI_URL", ...
Get the Build settings form. @param array $values @return Form
[ "Get", "the", "Build", "settings", "form", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Controller/SettingsController.php#L424-L454
dancryer/PHPCI
PHPCI/Controller/SettingsController.php
SettingsController.getBasicForm
protected function getBasicForm($values = array()) { $form = new Form(); $form->setMethod('POST'); $form->setAction(PHPCI_URL . 'settings/basic'); $field = new Form\Element\Select('language'); $field->setRequired(true); $field->setLabel(Lang::get('language')); ...
php
protected function getBasicForm($values = array()) { $form = new Form(); $form->setMethod('POST'); $form->setAction(PHPCI_URL . 'settings/basic'); $field = new Form\Element\Select('language'); $field->setRequired(true); $field->setLabel(Lang::get('language')); ...
[ "protected", "function", "getBasicForm", "(", "$", "values", "=", "array", "(", ")", ")", "{", "$", "form", "=", "new", "Form", "(", ")", ";", "$", "form", "->", "setMethod", "(", "'POST'", ")", ";", "$", "form", "->", "setAction", "(", "PHPCI_URL", ...
Get the Basic settings form. @param array $values @return Form
[ "Get", "the", "Basic", "settings", "form", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Controller/SettingsController.php#L495-L519
dancryer/PHPCI
PHPCI/Controller/SettingsController.php
SettingsController.getAuthenticationForm
protected function getAuthenticationForm($values = array()) { $form = new Form(); $form->setMethod('POST'); $form->setAction(PHPCI_URL . 'settings/authentication'); $form->addField(new Form\Element\Csrf('csrf')); $field = new Form\Element\Checkbox('disable_authentication'); ...
php
protected function getAuthenticationForm($values = array()) { $form = new Form(); $form->setMethod('POST'); $form->setAction(PHPCI_URL . 'settings/authentication'); $form->addField(new Form\Element\Csrf('csrf')); $field = new Form\Element\Checkbox('disable_authentication'); ...
[ "protected", "function", "getAuthenticationForm", "(", "$", "values", "=", "array", "(", ")", ")", "{", "$", "form", "=", "new", "Form", "(", ")", ";", "$", "form", "->", "setMethod", "(", "'POST'", ")", ";", "$", "form", "->", "setAction", "(", "PHP...
Form for disabling user authentication while using a default user @param array $values @return Form
[ "Form", "for", "disabling", "user", "authentication", "while", "using", "a", "default", "user" ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Controller/SettingsController.php#L527-L556
dancryer/PHPCI
PHPCI/Plugin/Composer.php
Composer.canExecute
public static function canExecute($stage, Builder $builder, Build $build) { $path = $builder->buildPath . DIRECTORY_SEPARATOR . 'composer.json'; if (file_exists($path) && $stage == 'setup') { return true; } return false; }
php
public static function canExecute($stage, Builder $builder, Build $build) { $path = $builder->buildPath . DIRECTORY_SEPARATOR . 'composer.json'; if (file_exists($path) && $stage == 'setup') { return true; } return false; }
[ "public", "static", "function", "canExecute", "(", "$", "stage", ",", "Builder", "$", "builder", ",", "Build", "$", "build", ")", "{", "$", "path", "=", "$", "builder", "->", "buildPath", ".", "DIRECTORY_SEPARATOR", ".", "'composer.json'", ";", "if", "(", ...
Check if this plugin can be executed. @param $stage @param Builder $builder @param Build $build @return bool
[ "Check", "if", "this", "plugin", "can", "be", "executed", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Plugin/Composer.php#L39-L48
dancryer/PHPCI
PHPCI/Plugin/Composer.php
Composer.execute
public function execute() { $composerLocation = $this->phpci->findBinary(array('composer', 'composer.phar')); $cmd = ''; if (IS_WIN) { $cmd = 'php '; } $cmd .= $composerLocation . ' --no-ansi --no-interaction '; if ($this->preferDist) { $th...
php
public function execute() { $composerLocation = $this->phpci->findBinary(array('composer', 'composer.phar')); $cmd = ''; if (IS_WIN) { $cmd = 'php '; } $cmd .= $composerLocation . ' --no-ansi --no-interaction '; if ($this->preferDist) { $th...
[ "public", "function", "execute", "(", ")", "{", "$", "composerLocation", "=", "$", "this", "->", "phpci", "->", "findBinary", "(", "array", "(", "'composer'", ",", "'composer.phar'", ")", ")", ";", "$", "cmd", "=", "''", ";", "if", "(", "IS_WIN", ")", ...
Executes Composer and runs a specified command (e.g. install / update)
[ "Executes", "Composer", "and", "runs", "a", "specified", "command", "(", "e", ".", "g", ".", "install", "/", "update", ")" ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Plugin/Composer.php#L92-L122
dancryer/PHPCI
PHPCI/Plugin/PhpSpec.php
PhpSpec.execute
public function execute() { $curdir = getcwd(); chdir($this->phpci->buildPath); $phpspec = $this->phpci->findBinary(array('phpspec', 'phpspec.php')); $success = $this->phpci->executeCommand($phpspec . ' --format=junit --no-code-generation run'); $output = $this->phpci->getL...
php
public function execute() { $curdir = getcwd(); chdir($this->phpci->buildPath); $phpspec = $this->phpci->findBinary(array('phpspec', 'phpspec.php')); $success = $this->phpci->executeCommand($phpspec . ' --format=junit --no-code-generation run'); $output = $this->phpci->getL...
[ "public", "function", "execute", "(", ")", "{", "$", "curdir", "=", "getcwd", "(", ")", ";", "chdir", "(", "$", "this", "->", "phpci", "->", "buildPath", ")", ";", "$", "phpspec", "=", "$", "this", "->", "phpci", "->", "findBinary", "(", "array", "...
Runs PHP Spec tests.
[ "Runs", "PHP", "Spec", "tests", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Plugin/PhpSpec.php#L55-L148
dancryer/PHPCI
PHPCI/Migrations/20150324174958_unique_email_and_name_user_fields.php
UniqueEmailAndNameUserFields.up
public function up() { $user_table = $this->table('user'); $user_table ->addIndex('email', array('unique' => true)) ->addIndex('name', array('unique' => true)) ->save(); }
php
public function up() { $user_table = $this->table('user'); $user_table ->addIndex('email', array('unique' => true)) ->addIndex('name', array('unique' => true)) ->save(); }
[ "public", "function", "up", "(", ")", "{", "$", "user_table", "=", "$", "this", "->", "table", "(", "'user'", ")", ";", "$", "user_table", "->", "addIndex", "(", "'email'", ",", "array", "(", "'unique'", "=>", "true", ")", ")", "->", "addIndex", "(",...
Migrate Up.
[ "Migrate", "Up", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Migrations/20150324174958_unique_email_and_name_user_fields.php#L10-L17
dancryer/PHPCI
PHPCI/Migrations/20150324174958_unique_email_and_name_user_fields.php
UniqueEmailAndNameUserFields.down
public function down() { $user_table = $this->table('user'); $user_table ->removeIndex('email', array('unique' => true)) ->removeIndex('name', array('unique' => true)) ->save(); }
php
public function down() { $user_table = $this->table('user'); $user_table ->removeIndex('email', array('unique' => true)) ->removeIndex('name', array('unique' => true)) ->save(); }
[ "public", "function", "down", "(", ")", "{", "$", "user_table", "=", "$", "this", "->", "table", "(", "'user'", ")", ";", "$", "user_table", "->", "removeIndex", "(", "'email'", ",", "array", "(", "'unique'", "=>", "true", ")", ")", "->", "removeIndex"...
Migrate Down.
[ "Migrate", "Down", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Migrations/20150324174958_unique_email_and_name_user_fields.php#L22-L29
dancryer/PHPCI
PHPCI/Plugin/Pdepend.php
Pdepend.execute
public function execute() { if (!file_exists($this->location)) { mkdir($this->location); } if (!is_writable($this->location)) { throw new \Exception(sprintf('The location %s is not writable or does not exist.', $this->location)); } $pdepend = $this->p...
php
public function execute() { if (!file_exists($this->location)) { mkdir($this->location); } if (!is_writable($this->location)) { throw new \Exception(sprintf('The location %s is not writable or does not exist.', $this->location)); } $pdepend = $this->p...
[ "public", "function", "execute", "(", ")", "{", "if", "(", "!", "file_exists", "(", "$", "this", "->", "location", ")", ")", "{", "mkdir", "(", "$", "this", "->", "location", ")", ";", "}", "if", "(", "!", "is_writable", "(", "$", "this", "->", "...
Runs Pdepend with the given criteria as arguments
[ "Runs", "Pdepend", "with", "the", "given", "criteria", "as", "arguments" ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Plugin/Pdepend.php#L74-L121
dancryer/PHPCI
PHPCI/Plugin/Pdepend.php
Pdepend.removeBuildArtifacts
protected function removeBuildArtifacts() { //Remove the created files first foreach (array($this->summary, $this->chart, $this->pyramid) as $file) { if (file_exists($this->location . DIRECTORY_SEPARATOR . $file)) { unlink($this->location . DIRECTORY_SEPARATOR . $file); ...
php
protected function removeBuildArtifacts() { //Remove the created files first foreach (array($this->summary, $this->chart, $this->pyramid) as $file) { if (file_exists($this->location . DIRECTORY_SEPARATOR . $file)) { unlink($this->location . DIRECTORY_SEPARATOR . $file); ...
[ "protected", "function", "removeBuildArtifacts", "(", ")", "{", "//Remove the created files first", "foreach", "(", "array", "(", "$", "this", "->", "summary", ",", "$", "this", "->", "chart", ",", "$", "this", "->", "pyramid", ")", "as", "$", "file", ")", ...
Remove files created from previous builds
[ "Remove", "files", "created", "from", "previous", "builds" ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Plugin/Pdepend.php#L126-L134
dancryer/PHPCI
PHPCI/BuildFactory.php
BuildFactory.getBuild
public static function getBuild(Build $build) { $project = $build->getProject(); if (!empty($project)) { switch ($project->getType()) { case 'remote': $type = 'RemoteGitBuild'; break; case 'local': ...
php
public static function getBuild(Build $build) { $project = $build->getProject(); if (!empty($project)) { switch ($project->getType()) { case 'remote': $type = 'RemoteGitBuild'; break; case 'local': ...
[ "public", "static", "function", "getBuild", "(", "Build", "$", "build", ")", "{", "$", "project", "=", "$", "build", "->", "getProject", "(", ")", ";", "if", "(", "!", "empty", "(", "$", "project", ")", ")", "{", "switch", "(", "$", "project", "->"...
Takes a generic build and returns a type-specific build model. @param Build $build The build from which to get a more specific build type. @return Build
[ "Takes", "a", "generic", "build", "and", "returns", "a", "type", "-", "specific", "build", "model", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/BuildFactory.php#L42-L78
dancryer/PHPCI
PHPCI/Helper/Lang.php
Lang.get
public static function get($string) { $vars = func_get_args(); if (array_key_exists($string, self::$strings)) { $vars[0] = self::$strings[$string]; return call_user_func_array('sprintf', $vars); } return '%%MISSING STRING: ' . $string . '%%'; }
php
public static function get($string) { $vars = func_get_args(); if (array_key_exists($string, self::$strings)) { $vars[0] = self::$strings[$string]; return call_user_func_array('sprintf', $vars); } return '%%MISSING STRING: ' . $string . '%%'; }
[ "public", "static", "function", "get", "(", "$", "string", ")", "{", "$", "vars", "=", "func_get_args", "(", ")", ";", "if", "(", "array_key_exists", "(", "$", "string", ",", "self", "::", "$", "strings", ")", ")", "{", "$", "vars", "[", "0", "]", ...
Get a specific string from the language file. @param $string @return mixed|string
[ "Get", "a", "specific", "string", "from", "the", "language", "file", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Helper/Lang.php#L31-L41
dancryer/PHPCI
PHPCI/Helper/Lang.php
Lang.setLanguage
public static function setLanguage($language) { if (in_array($language, self::$languages)) { self::$language = $language; self::$strings = self::loadLanguage(); return true; } return false; }
php
public static function setLanguage($language) { if (in_array($language, self::$languages)) { self::$language = $language; self::$strings = self::loadLanguage(); return true; } return false; }
[ "public", "static", "function", "setLanguage", "(", "$", "language", ")", "{", "if", "(", "in_array", "(", "$", "language", ",", "self", "::", "$", "languages", ")", ")", "{", "self", "::", "$", "language", "=", "$", "language", ";", "self", "::", "$...
Try and load a language, and if successful, set it for use throughout the system. @param $language @return bool
[ "Try", "and", "load", "a", "language", "and", "if", "successful", "set", "it", "for", "use", "throughout", "the", "system", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Helper/Lang.php#L68-L77