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/Plugin/PhpMessDetector.php
PhpMessDetector.executePhpMd
protected function executePhpMd($binaryPath) { $cmd = $binaryPath . ' "%s" xml %s %s %s'; $path = $this->getTargetPath(); $ignore = ''; if (count($this->ignore)) { $ignore = ' --exclude ' . implode(',', $this->ignore); } $suffixes = ''; if (coun...
php
protected function executePhpMd($binaryPath) { $cmd = $binaryPath . ' "%s" xml %s %s %s'; $path = $this->getTargetPath(); $ignore = ''; if (count($this->ignore)) { $ignore = ' --exclude ' . implode(',', $this->ignore); } $suffixes = ''; if (coun...
[ "protected", "function", "executePhpMd", "(", "$", "binaryPath", ")", "{", "$", "cmd", "=", "$", "binaryPath", ".", "' \"%s\" xml %s %s %s'", ";", "$", "path", "=", "$", "this", "->", "getTargetPath", "(", ")", ";", "$", "ignore", "=", "''", ";", "if", ...
Execute PHP Mess Detector. @param $binaryPath
[ "Execute", "PHP", "Mess", "Detector", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Plugin/PhpMessDetector.php#L207-L237
dancryer/PHPCI
PHPCI/Plugin/PhpMessDetector.php
PhpMessDetector.getTargetPath
protected function getTargetPath() { $path = $this->phpci->buildPath . $this->path; if (!empty($this->path) && $this->path{0} == '/') { $path = $this->path; return $path; } return $path; }
php
protected function getTargetPath() { $path = $this->phpci->buildPath . $this->path; if (!empty($this->path) && $this->path{0} == '/') { $path = $this->path; return $path; } return $path; }
[ "protected", "function", "getTargetPath", "(", ")", "{", "$", "path", "=", "$", "this", "->", "phpci", "->", "buildPath", ".", "$", "this", "->", "path", ";", "if", "(", "!", "empty", "(", "$", "this", "->", "path", ")", "&&", "$", "this", "->", ...
Get the path PHPMD should be run against. @return string
[ "Get", "the", "path", "PHPMD", "should", "be", "run", "against", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Plugin/PhpMessDetector.php#L243-L251
dancryer/PHPCI
PHPCI/Plugin/PhpMessDetector.php
PhpMessDetector.wasLastExecSuccessful
protected function wasLastExecSuccessful($errorCount) { $success = true; if ($this->allowed_warnings != -1 && $errorCount > $this->allowed_warnings) { $success = false; return $success; } return $success; }
php
protected function wasLastExecSuccessful($errorCount) { $success = true; if ($this->allowed_warnings != -1 && $errorCount > $this->allowed_warnings) { $success = false; return $success; } return $success; }
[ "protected", "function", "wasLastExecSuccessful", "(", "$", "errorCount", ")", "{", "$", "success", "=", "true", ";", "if", "(", "$", "this", "->", "allowed_warnings", "!=", "-", "1", "&&", "$", "errorCount", ">", "$", "this", "->", "allowed_warnings", ")"...
Returns a boolean indicating if the error count can be considered a success. @param int $errorCount @return bool
[ "Returns", "a", "boolean", "indicating", "if", "the", "error", "count", "can", "be", "considered", "a", "success", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Plugin/PhpMessDetector.php#L259-L268
dancryer/PHPCI
PHPCI/Controller.php
Controller.setControllerView
protected function setControllerView() { if (View::exists($this->className)) { $this->controllerView = new View($this->className); } else { $this->controllerView = new View\Template('{@content}'); } }
php
protected function setControllerView() { if (View::exists($this->className)) { $this->controllerView = new View($this->className); } else { $this->controllerView = new View\Template('{@content}'); } }
[ "protected", "function", "setControllerView", "(", ")", "{", "if", "(", "View", "::", "exists", "(", "$", "this", "->", "className", ")", ")", "{", "$", "this", "->", "controllerView", "=", "new", "View", "(", "$", "this", "->", "className", ")", ";", ...
Set the view that this controller should use.
[ "Set", "the", "view", "that", "this", "controller", "should", "use", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Controller.php#L64-L71
dancryer/PHPCI
PHPCI/Controller.php
Controller.setView
protected function setView($action) { if (View::exists($this->className . '/' . $action)) { $this->view = new View($this->className . '/' . $action); } }
php
protected function setView($action) { if (View::exists($this->className . '/' . $action)) { $this->view = new View($this->className . '/' . $action); } }
[ "protected", "function", "setView", "(", "$", "action", ")", "{", "if", "(", "View", "::", "exists", "(", "$", "this", "->", "className", ".", "'/'", ".", "$", "action", ")", ")", "{", "$", "this", "->", "view", "=", "new", "View", "(", "$", "thi...
Set the view that this controller action should use. @param $action
[ "Set", "the", "view", "that", "this", "controller", "action", "should", "use", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Controller.php#L77-L82
dancryer/PHPCI
PHPCI/Controller.php
Controller.handleAction
public function handleAction($action, $actionParams) { $this->setView($action); $response = parent::handleAction($action, $actionParams); if ($response instanceof Response) { return $response; } if (is_string($response)) { $this->controllerView->cont...
php
public function handleAction($action, $actionParams) { $this->setView($action); $response = parent::handleAction($action, $actionParams); if ($response instanceof Response) { return $response; } if (is_string($response)) { $this->controllerView->cont...
[ "public", "function", "handleAction", "(", "$", "action", ",", "$", "actionParams", ")", "{", "$", "this", "->", "setView", "(", "$", "action", ")", ";", "$", "response", "=", "parent", "::", "handleAction", "(", "$", "action", ",", "$", "actionParams", ...
Handle the incoming request. @param $action @param $actionParams @return \b8\b8\Http\Response|Response
[ "Handle", "the", "incoming", "request", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Controller.php#L90-L108
dancryer/PHPCI
PHPCI/Plugin/Atoum.php
Atoum.execute
public function execute() { $cmd = $this->executable; if ($this->args !== null) { $cmd .= " {$this->args}"; } if ($this->config !== null) { $cmd .= " -c '{$this->config}'"; } if ($this->directory !== null) { $dirPath = $this->phpci...
php
public function execute() { $cmd = $this->executable; if ($this->args !== null) { $cmd .= " {$this->args}"; } if ($this->config !== null) { $cmd .= " -c '{$this->config}'"; } if ($this->directory !== null) { $dirPath = $this->phpci...
[ "public", "function", "execute", "(", ")", "{", "$", "cmd", "=", "$", "this", "->", "executable", ";", "if", "(", "$", "this", "->", "args", "!==", "null", ")", "{", "$", "cmd", ".=", "\" {$this->args}\"", ";", "}", "if", "(", "$", "this", "->", ...
Run the Atoum plugin. @return bool
[ "Run", "the", "Atoum", "plugin", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Plugin/Atoum.php#L60-L89
dancryer/PHPCI
PHPCI/Plugin/PhpParallelLint.php
PhpParallelLint.execute
public function execute() { list($ignore) = $this->getFlags(); $phplint = $this->phpci->findBinary('parallel-lint'); $cmd = $phplint . ' -e %s' . '%s %s "%s"'; $success = $this->phpci->executeCommand( $cmd, $this->extensions, ($this->shortTag ? '...
php
public function execute() { list($ignore) = $this->getFlags(); $phplint = $this->phpci->findBinary('parallel-lint'); $cmd = $phplint . ' -e %s' . '%s %s "%s"'; $success = $this->phpci->executeCommand( $cmd, $this->extensions, ($this->shortTag ? '...
[ "public", "function", "execute", "(", ")", "{", "list", "(", "$", "ignore", ")", "=", "$", "this", "->", "getFlags", "(", ")", ";", "$", "phplint", "=", "$", "this", "->", "phpci", "->", "findBinary", "(", "'parallel-lint'", ")", ";", "$", "cmd", "...
Executes parallel lint
[ "Executes", "parallel", "lint" ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Plugin/PhpParallelLint.php#L101-L124
dancryer/PHPCI
PHPCI/Plugin/PhpParallelLint.php
PhpParallelLint.getFlags
protected function getFlags() { $ignoreFlags = array(); foreach ($this->ignore as $ignoreDir) { $ignoreFlags[] = '--exclude "' . $this->phpci->buildPath . $ignoreDir . '"'; } $ignore = implode(' ', $ignoreFlags); return array($ignore); }
php
protected function getFlags() { $ignoreFlags = array(); foreach ($this->ignore as $ignoreDir) { $ignoreFlags[] = '--exclude "' . $this->phpci->buildPath . $ignoreDir . '"'; } $ignore = implode(' ', $ignoreFlags); return array($ignore); }
[ "protected", "function", "getFlags", "(", ")", "{", "$", "ignoreFlags", "=", "array", "(", ")", ";", "foreach", "(", "$", "this", "->", "ignore", "as", "$", "ignoreDir", ")", "{", "$", "ignoreFlags", "[", "]", "=", "'--exclude \"'", ".", "$", "this", ...
Produce an argument string for PHP Parallel Lint. @return array
[ "Produce", "an", "argument", "string", "for", "PHP", "Parallel", "Lint", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Plugin/PhpParallelLint.php#L130-L139
dancryer/PHPCI
PHPCI/Controller/HomeController.php
HomeController.init
public function init() { $this->buildStore = b8\Store\Factory::getStore('Build'); $this->projectStore = b8\Store\Factory::getStore('Project'); $this->groupStore = b8\Store\Factory::getStore('ProjectGroup'); }
php
public function init() { $this->buildStore = b8\Store\Factory::getStore('Build'); $this->projectStore = b8\Store\Factory::getStore('Project'); $this->groupStore = b8\Store\Factory::getStore('ProjectGroup'); }
[ "public", "function", "init", "(", ")", "{", "$", "this", "->", "buildStore", "=", "b8", "\\", "Store", "\\", "Factory", "::", "getStore", "(", "'Build'", ")", ";", "$", "this", "->", "projectStore", "=", "b8", "\\", "Store", "\\", "Factory", "::", "...
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/HomeController.php#L43-L48
dancryer/PHPCI
PHPCI/Controller/HomeController.php
HomeController.index
public function index() { $this->layout->title = Lang::get('dashboard'); $builds = $this->buildStore->getLatestBuilds(null, 10); foreach ($builds as &$build) { $build = BuildFactory::getBuild($build); } $this->view->display_branch = $this->config->get('phpci.lat...
php
public function index() { $this->layout->title = Lang::get('dashboard'); $builds = $this->buildStore->getLatestBuilds(null, 10); foreach ($builds as &$build) { $build = BuildFactory::getBuild($build); } $this->view->display_branch = $this->config->get('phpci.lat...
[ "public", "function", "index", "(", ")", "{", "$", "this", "->", "layout", "->", "title", "=", "Lang", "::", "get", "(", "'dashboard'", ")", ";", "$", "builds", "=", "$", "this", "->", "buildStore", "->", "getLatestBuilds", "(", "null", ",", "10", ")...
Display PHPCI dashboard:
[ "Display", "PHPCI", "dashboard", ":" ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Controller/HomeController.php#L53-L68
dancryer/PHPCI
PHPCI/Controller/HomeController.php
HomeController.summary
public function summary() { $this->response->disableLayout(); $projects = $this->projectStore->getWhere(array(), 50, 0, array(), array('title' => 'ASC')); $this->response->setContent($this->getSummaryHtml($projects)); return $this->response; }
php
public function summary() { $this->response->disableLayout(); $projects = $this->projectStore->getWhere(array(), 50, 0, array(), array('title' => 'ASC')); $this->response->setContent($this->getSummaryHtml($projects)); return $this->response; }
[ "public", "function", "summary", "(", ")", "{", "$", "this", "->", "response", "->", "disableLayout", "(", ")", ";", "$", "projects", "=", "$", "this", "->", "projectStore", "->", "getWhere", "(", "array", "(", ")", ",", "50", ",", "0", ",", "array",...
Ajax request for the project overview section of the dashboard.
[ "Ajax", "request", "for", "the", "project", "overview", "section", "of", "the", "dashboard", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Controller/HomeController.php#L83-L89
dancryer/PHPCI
PHPCI/Controller/HomeController.php
HomeController.getSummaryHtml
protected function getSummaryHtml($projects) { $summaryBuilds = array(); $successes = array(); $failures = array(); $counts = array(); foreach ($projects as $project) { $summaryBuilds[$project->getId()] = $this->buildStore->getLatestBuilds($projec...
php
protected function getSummaryHtml($projects) { $summaryBuilds = array(); $successes = array(); $failures = array(); $counts = array(); foreach ($projects as $project) { $summaryBuilds[$project->getId()] = $this->buildStore->getLatestBuilds($projec...
[ "protected", "function", "getSummaryHtml", "(", "$", "projects", ")", "{", "$", "summaryBuilds", "=", "array", "(", ")", ";", "$", "successes", "=", "array", "(", ")", ";", "$", "failures", "=", "array", "(", ")", ";", "$", "counts", "=", "array", "(...
Generate the HTML for the project overview section of the dashboard. @param $projects @return string
[ "Generate", "the", "HTML", "for", "the", "project", "overview", "section", "of", "the", "dashboard", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Controller/HomeController.php#L96-L130
dancryer/PHPCI
PHPCI/Controller/HomeController.php
HomeController.getGroupInfo
protected function getGroupInfo() { $rtn = array(); $groups = $this->groupStore->getWhere(array(), 100, 0, array(), array('title' => 'ASC')); foreach ($groups['items'] as $group) { $thisGroup = array('title' => $group->getTitle()); $projects = $this->projectStore->ge...
php
protected function getGroupInfo() { $rtn = array(); $groups = $this->groupStore->getWhere(array(), 100, 0, array(), array('title' => 'ASC')); foreach ($groups['items'] as $group) { $thisGroup = array('title' => $group->getTitle()); $projects = $this->projectStore->ge...
[ "protected", "function", "getGroupInfo", "(", ")", "{", "$", "rtn", "=", "array", "(", ")", ";", "$", "groups", "=", "$", "this", "->", "groupStore", "->", "getWhere", "(", "array", "(", ")", ",", "100", ",", "0", ",", "array", "(", ")", ",", "ar...
Get a summary of the project groups we have, and what projects they have in them. @return array
[ "Get", "a", "summary", "of", "the", "project", "groups", "we", "have", "and", "what", "projects", "they", "have", "in", "them", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Controller/HomeController.php#L153-L167
dancryer/PHPCI
PHPCI/Plugin/Util/PluginInformationCollection.php
PluginInformationCollection.getInstalledPlugins
public function getInstalledPlugins() { $arr = array(); foreach ($this->pluginInformations as $single) { $arr = array_merge($arr, $single->getInstalledPlugins()); } return $arr; }
php
public function getInstalledPlugins() { $arr = array(); foreach ($this->pluginInformations as $single) { $arr = array_merge($arr, $single->getInstalledPlugins()); } return $arr; }
[ "public", "function", "getInstalledPlugins", "(", ")", "{", "$", "arr", "=", "array", "(", ")", ";", "foreach", "(", "$", "this", "->", "pluginInformations", "as", "$", "single", ")", "{", "$", "arr", "=", "array_merge", "(", "$", "arr", ",", "$", "s...
Returns an array of objects. Each one represents an available plugin and will have the following properties: name - The friendly name of the plugin (may be an empty string) class - The class of the plugin (will include namespace) @return \stdClass[]
[ "Returns", "an", "array", "of", "objects", ".", "Each", "one", "represents", "an", "available", "plugin", "and", "will", "have", "the", "following", "properties", ":", "name", "-", "The", "friendly", "name", "of", "the", "plugin", "(", "may", "be", "an", ...
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Plugin/Util/PluginInformationCollection.php#L32-L41
dancryer/PHPCI
PHPCI/Plugin/Util/PluginInformationCollection.php
PluginInformationCollection.getPluginClasses
public function getPluginClasses() { $arr = array(); foreach ($this->pluginInformations as $single) { $arr = array_merge($arr, $single->getPluginClasses()); } return $arr; }
php
public function getPluginClasses() { $arr = array(); foreach ($this->pluginInformations as $single) { $arr = array_merge($arr, $single->getPluginClasses()); } return $arr; }
[ "public", "function", "getPluginClasses", "(", ")", "{", "$", "arr", "=", "array", "(", ")", ";", "foreach", "(", "$", "this", "->", "pluginInformations", "as", "$", "single", ")", "{", "$", "arr", "=", "array_merge", "(", "$", "arr", ",", "$", "sing...
Returns an array of all the class names of plugins that have been loaded. @return string[]
[ "Returns", "an", "array", "of", "all", "the", "class", "names", "of", "plugins", "that", "have", "been", "loaded", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Plugin/Util/PluginInformationCollection.php#L49-L58
dancryer/PHPCI
PHPCI/Migrations/20140513143726_initial_migration.php
InitialMigration.up
public function up() { // Set up tables: $this->createBuildTable(); $this->createBuildMetaTable(); $this->createProjectTable(); $this->createUserTable(); // Set up foreign keys: $build = $this->table('build'); if (!$build->hasForeignKey('project_id')...
php
public function up() { // Set up tables: $this->createBuildTable(); $this->createBuildMetaTable(); $this->createProjectTable(); $this->createUserTable(); // Set up foreign keys: $build = $this->table('build'); if (!$build->hasForeignKey('project_id')...
[ "public", "function", "up", "(", ")", "{", "// Set up tables:", "$", "this", "->", "createBuildTable", "(", ")", ";", "$", "this", "->", "createBuildMetaTable", "(", ")", ";", "$", "this", "->", "createProjectTable", "(", ")", ";", "$", "this", "->", "cr...
Migrate Up.
[ "Migrate", "Up", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Migrations/20140513143726_initial_migration.php#L13-L41
dancryer/PHPCI
PHPCI/Worker/BuildWorker.php
BuildWorker.startWorker
public function startWorker() { $this->pheanstalk->watch($this->queue); $this->pheanstalk->ignore('default'); $buildStore = Factory::getStore('Build'); while ($this->run) { // Get a job from the queue: $job = $this->pheanstalk->reserve(); $this->...
php
public function startWorker() { $this->pheanstalk->watch($this->queue); $this->pheanstalk->ignore('default'); $buildStore = Factory::getStore('Build'); while ($this->run) { // Get a job from the queue: $job = $this->pheanstalk->reserve(); $this->...
[ "public", "function", "startWorker", "(", ")", "{", "$", "this", "->", "pheanstalk", "->", "watch", "(", "$", "this", "->", "queue", ")", ";", "$", "this", "->", "pheanstalk", "->", "ignore", "(", "'default'", ")", ";", "$", "buildStore", "=", "Factory...
Start the worker.
[ "Start", "the", "worker", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Worker/BuildWorker.php#L93-L164
dancryer/PHPCI
PHPCI/Worker/BuildWorker.php
BuildWorker.checkJobLimit
protected function checkJobLimit() { // Make sure we don't run more than maxJobs jobs on this worker: $this->totalJobs++; if ($this->maxJobs != -1 && $this->maxJobs <= $this->totalJobs) { $this->stopWorker(); } }
php
protected function checkJobLimit() { // Make sure we don't run more than maxJobs jobs on this worker: $this->totalJobs++; if ($this->maxJobs != -1 && $this->maxJobs <= $this->totalJobs) { $this->stopWorker(); } }
[ "protected", "function", "checkJobLimit", "(", ")", "{", "// Make sure we don't run more than maxJobs jobs on this worker:", "$", "this", "->", "totalJobs", "++", ";", "if", "(", "$", "this", "->", "maxJobs", "!=", "-", "1", "&&", "$", "this", "->", "maxJobs", "...
Checks if this worker has done the amount of jobs it is allowed to do, and if so tells it to stop after this job completes.
[ "Checks", "if", "this", "worker", "has", "done", "the", "amount", "of", "jobs", "it", "is", "allowed", "to", "do", "and", "if", "so", "tells", "it", "to", "stop", "after", "this", "job", "completes", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Worker/BuildWorker.php#L178-L186
dancryer/PHPCI
PHPCI/Worker/BuildWorker.php
BuildWorker.verifyJob
protected function verifyJob(Job $job, $jobData) { if (empty($jobData) || !is_array($jobData)) { // Probably not from PHPCI. $this->pheanstalk->delete($job); return false; } if (!array_key_exists('type', $jobData) || $jobData['type'] !== 'phpci.build') { ...
php
protected function verifyJob(Job $job, $jobData) { if (empty($jobData) || !is_array($jobData)) { // Probably not from PHPCI. $this->pheanstalk->delete($job); return false; } if (!array_key_exists('type', $jobData) || $jobData['type'] !== 'phpci.build') { ...
[ "protected", "function", "verifyJob", "(", "Job", "$", "job", ",", "$", "jobData", ")", "{", "if", "(", "empty", "(", "$", "jobData", ")", "||", "!", "is_array", "(", "$", "jobData", ")", ")", "{", "// Probably not from PHPCI.", "$", "this", "->", "phe...
Checks that the job received is actually from PHPCI, and has a valid type. @param Job $job @param $jobData @return bool
[ "Checks", "that", "the", "job", "received", "is", "actually", "from", "PHPCI", "and", "has", "a", "valid", "type", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Worker/BuildWorker.php#L194-L209
dancryer/PHPCI
PHPCI/Helper/SshKey.php
SshKey.generate
public function generate() { $tempPath = sys_get_temp_dir() . '/'; // FastCGI fix for Windows machines, where temp path is not available to // PHP, and defaults to the unwritable system directory. If the temp // path is pointing to the system directory, shift to the 'TEMP' ...
php
public function generate() { $tempPath = sys_get_temp_dir() . '/'; // FastCGI fix for Windows machines, where temp path is not available to // PHP, and defaults to the unwritable system directory. If the temp // path is pointing to the system directory, shift to the 'TEMP' ...
[ "public", "function", "generate", "(", ")", "{", "$", "tempPath", "=", "sys_get_temp_dir", "(", ")", ".", "'/'", ";", "// FastCGI fix for Windows machines, where temp path is not available to", "// PHP, and defaults to the unwritable system directory. If the temp", "// path is poi...
Uses ssh-keygen to generate a public/private key pair. @return array
[ "Uses", "ssh", "-", "keygen", "to", "generate", "a", "public", "/", "private", "key", "pair", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Helper/SshKey.php#L22-L58
dancryer/PHPCI
PHPCI/Migrations/20140730143702_fix_database_columns.php
FixDatabaseColumns.up
public function up() { $dbAdapter = $this->getAdapter(); if ($dbAdapter instanceof \Phinx\Db\Adapter\PdoAdapter) { $pdo = $dbAdapter->getConnection(); $pdo->exec('SET foreign_key_checks = 0'); } $build = $this->table('build'); $build->changeColumn('p...
php
public function up() { $dbAdapter = $this->getAdapter(); if ($dbAdapter instanceof \Phinx\Db\Adapter\PdoAdapter) { $pdo = $dbAdapter->getConnection(); $pdo->exec('SET foreign_key_checks = 0'); } $build = $this->table('build'); $build->changeColumn('p...
[ "public", "function", "up", "(", ")", "{", "$", "dbAdapter", "=", "$", "this", "->", "getAdapter", "(", ")", ";", "if", "(", "$", "dbAdapter", "instanceof", "\\", "Phinx", "\\", "Db", "\\", "Adapter", "\\", "PdoAdapter", ")", "{", "$", "pdo", "=", ...
Migrate Up.
[ "Migrate", "Up", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Migrations/20140730143702_fix_database_columns.php#L10-L60
dancryer/PHPCI
PHPCI/Model/Base/BuildErrorBase.php
BuildErrorBase.getCreatedDate
public function getCreatedDate() { $rtn = $this->data['created_date']; if (!empty($rtn)) { $rtn = new \DateTime($rtn); } return $rtn; }
php
public function getCreatedDate() { $rtn = $this->data['created_date']; if (!empty($rtn)) { $rtn = new \DateTime($rtn); } return $rtn; }
[ "public", "function", "getCreatedDate", "(", ")", "{", "$", "rtn", "=", "$", "this", "->", "data", "[", "'created_date'", "]", ";", "if", "(", "!", "empty", "(", "$", "rtn", ")", ")", "{", "$", "rtn", "=", "new", "\\", "DateTime", "(", "$", "rtn"...
Get the value of CreatedDate / created_date. @return \DateTime
[ "Get", "the", "value", "of", "CreatedDate", "/", "created_date", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Model/Base/BuildErrorBase.php#L278-L287
dancryer/PHPCI
PHPCI/Model/Base/BuildErrorBase.php
BuildErrorBase.setBuildId
public function setBuildId($value) { $this->_validateNotNull('BuildId', $value); $this->_validateInt('BuildId', $value); if ($this->data['build_id'] === $value) { return; } $this->data['build_id'] = $value; $this->_setModified('build_id'); }
php
public function setBuildId($value) { $this->_validateNotNull('BuildId', $value); $this->_validateInt('BuildId', $value); if ($this->data['build_id'] === $value) { return; } $this->data['build_id'] = $value; $this->_setModified('build_id'); }
[ "public", "function", "setBuildId", "(", "$", "value", ")", "{", "$", "this", "->", "_validateNotNull", "(", "'BuildId'", ",", "$", "value", ")", ";", "$", "this", "->", "_validateInt", "(", "'BuildId'", ",", "$", "value", ")", ";", "if", "(", "$", "...
Set the value of BuildId / build_id. Must not be null. @param $value int
[ "Set", "the", "value", "of", "BuildId", "/", "build_id", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Model/Base/BuildErrorBase.php#L339-L351
dancryer/PHPCI
PHPCI/Model/Base/BuildErrorBase.php
BuildErrorBase.setPlugin
public function setPlugin($value) { $this->_validateNotNull('Plugin', $value); $this->_validateString('Plugin', $value); if ($this->data['plugin'] === $value) { return; } $this->data['plugin'] = $value; $this->_setModified('plugin'); }
php
public function setPlugin($value) { $this->_validateNotNull('Plugin', $value); $this->_validateString('Plugin', $value); if ($this->data['plugin'] === $value) { return; } $this->data['plugin'] = $value; $this->_setModified('plugin'); }
[ "public", "function", "setPlugin", "(", "$", "value", ")", "{", "$", "this", "->", "_validateNotNull", "(", "'Plugin'", ",", "$", "value", ")", ";", "$", "this", "->", "_validateString", "(", "'Plugin'", ",", "$", "value", ")", ";", "if", "(", "$", "...
Set the value of Plugin / plugin. Must not be null. @param $value string
[ "Set", "the", "value", "of", "Plugin", "/", "plugin", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Model/Base/BuildErrorBase.php#L359-L371
dancryer/PHPCI
PHPCI/Model/Base/BuildErrorBase.php
BuildErrorBase.setFile
public function setFile($value) { $this->_validateString('File', $value); if ($this->data['file'] === $value) { return; } $this->data['file'] = $value; $this->_setModified('file'); }
php
public function setFile($value) { $this->_validateString('File', $value); if ($this->data['file'] === $value) { return; } $this->data['file'] = $value; $this->_setModified('file'); }
[ "public", "function", "setFile", "(", "$", "value", ")", "{", "$", "this", "->", "_validateString", "(", "'File'", ",", "$", "value", ")", ";", "if", "(", "$", "this", "->", "data", "[", "'file'", "]", "===", "$", "value", ")", "{", "return", ";", ...
Set the value of File / file. @param $value string
[ "Set", "the", "value", "of", "File", "/", "file", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Model/Base/BuildErrorBase.php#L378-L389
dancryer/PHPCI
PHPCI/Model/Base/BuildErrorBase.php
BuildErrorBase.setLineStart
public function setLineStart($value) { $this->_validateInt('LineStart', $value); if ($this->data['line_start'] === $value) { return; } $this->data['line_start'] = $value; $this->_setModified('line_start'); }
php
public function setLineStart($value) { $this->_validateInt('LineStart', $value); if ($this->data['line_start'] === $value) { return; } $this->data['line_start'] = $value; $this->_setModified('line_start'); }
[ "public", "function", "setLineStart", "(", "$", "value", ")", "{", "$", "this", "->", "_validateInt", "(", "'LineStart'", ",", "$", "value", ")", ";", "if", "(", "$", "this", "->", "data", "[", "'line_start'", "]", "===", "$", "value", ")", "{", "ret...
Set the value of LineStart / line_start. @param $value int
[ "Set", "the", "value", "of", "LineStart", "/", "line_start", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Model/Base/BuildErrorBase.php#L396-L407
dancryer/PHPCI
PHPCI/Model/Base/BuildErrorBase.php
BuildErrorBase.setLineEnd
public function setLineEnd($value) { $this->_validateInt('LineEnd', $value); if ($this->data['line_end'] === $value) { return; } $this->data['line_end'] = $value; $this->_setModified('line_end'); }
php
public function setLineEnd($value) { $this->_validateInt('LineEnd', $value); if ($this->data['line_end'] === $value) { return; } $this->data['line_end'] = $value; $this->_setModified('line_end'); }
[ "public", "function", "setLineEnd", "(", "$", "value", ")", "{", "$", "this", "->", "_validateInt", "(", "'LineEnd'", ",", "$", "value", ")", ";", "if", "(", "$", "this", "->", "data", "[", "'line_end'", "]", "===", "$", "value", ")", "{", "return", ...
Set the value of LineEnd / line_end. @param $value int
[ "Set", "the", "value", "of", "LineEnd", "/", "line_end", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Model/Base/BuildErrorBase.php#L414-L425
dancryer/PHPCI
PHPCI/Model/Base/BuildErrorBase.php
BuildErrorBase.setSeverity
public function setSeverity($value) { $this->_validateNotNull('Severity', $value); $this->_validateInt('Severity', $value); if ($this->data['severity'] === $value) { return; } $this->data['severity'] = $value; $this->_setModified('severity'); }
php
public function setSeverity($value) { $this->_validateNotNull('Severity', $value); $this->_validateInt('Severity', $value); if ($this->data['severity'] === $value) { return; } $this->data['severity'] = $value; $this->_setModified('severity'); }
[ "public", "function", "setSeverity", "(", "$", "value", ")", "{", "$", "this", "->", "_validateNotNull", "(", "'Severity'", ",", "$", "value", ")", ";", "$", "this", "->", "_validateInt", "(", "'Severity'", ",", "$", "value", ")", ";", "if", "(", "$", ...
Set the value of Severity / severity. Must not be null. @param $value int
[ "Set", "the", "value", "of", "Severity", "/", "severity", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Model/Base/BuildErrorBase.php#L433-L445
dancryer/PHPCI
PHPCI/Model/Base/BuildErrorBase.php
BuildErrorBase.setMessage
public function setMessage($value) { $this->_validateNotNull('Message', $value); $this->_validateString('Message', $value); if ($this->data['message'] === $value) { return; } $this->data['message'] = $value; $this->_setModified('message'); }
php
public function setMessage($value) { $this->_validateNotNull('Message', $value); $this->_validateString('Message', $value); if ($this->data['message'] === $value) { return; } $this->data['message'] = $value; $this->_setModified('message'); }
[ "public", "function", "setMessage", "(", "$", "value", ")", "{", "$", "this", "->", "_validateNotNull", "(", "'Message'", ",", "$", "value", ")", ";", "$", "this", "->", "_validateString", "(", "'Message'", ",", "$", "value", ")", ";", "if", "(", "$", ...
Set the value of Message / message. Must not be null. @param $value string
[ "Set", "the", "value", "of", "Message", "/", "message", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Model/Base/BuildErrorBase.php#L453-L465
dancryer/PHPCI
PHPCI/Model/Base/BuildErrorBase.php
BuildErrorBase.setCreatedDate
public function setCreatedDate($value) { $this->_validateNotNull('CreatedDate', $value); $this->_validateDate('CreatedDate', $value); if ($this->data['created_date'] === $value) { return; } $this->data['created_date'] = $value; $this->_setModified('crea...
php
public function setCreatedDate($value) { $this->_validateNotNull('CreatedDate', $value); $this->_validateDate('CreatedDate', $value); if ($this->data['created_date'] === $value) { return; } $this->data['created_date'] = $value; $this->_setModified('crea...
[ "public", "function", "setCreatedDate", "(", "$", "value", ")", "{", "$", "this", "->", "_validateNotNull", "(", "'CreatedDate'", ",", "$", "value", ")", ";", "$", "this", "->", "_validateDate", "(", "'CreatedDate'", ",", "$", "value", ")", ";", "if", "(...
Set the value of CreatedDate / created_date. Must not be null. @param $value \DateTime
[ "Set", "the", "value", "of", "CreatedDate", "/", "created_date", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Model/Base/BuildErrorBase.php#L473-L485
dancryer/PHPCI
PHPCI/Model/Base/BuildErrorBase.php
BuildErrorBase.setHash
public function setHash($value) { $this->_validateNotNull('Hash', $value); $this->_validateString('Hash', $value); if ($this->data['hash'] === $value) { return; } $this->data['hash'] = $value; $this->_setModified('hash'); }
php
public function setHash($value) { $this->_validateNotNull('Hash', $value); $this->_validateString('Hash', $value); if ($this->data['hash'] === $value) { return; } $this->data['hash'] = $value; $this->_setModified('hash'); }
[ "public", "function", "setHash", "(", "$", "value", ")", "{", "$", "this", "->", "_validateNotNull", "(", "'Hash'", ",", "$", "value", ")", ";", "$", "this", "->", "_validateString", "(", "'Hash'", ",", "$", "value", ")", ";", "if", "(", "$", "this",...
Set the value of Hash / hash. Must not be null. @param $value string
[ "Set", "the", "value", "of", "Hash", "/", "hash", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Model/Base/BuildErrorBase.php#L493-L505
dancryer/PHPCI
PHPCI/Model/Base/BuildErrorBase.php
BuildErrorBase.setIsNew
public function setIsNew($value) { $value = ($value == true) ? 1 : 0; if ($this->data['is_new'] === $value) { return; } $this->data['is_new'] = $value; $this->_setModified('is_new'); }
php
public function setIsNew($value) { $value = ($value == true) ? 1 : 0; if ($this->data['is_new'] === $value) { return; } $this->data['is_new'] = $value; $this->_setModified('is_new'); }
[ "public", "function", "setIsNew", "(", "$", "value", ")", "{", "$", "value", "=", "(", "$", "value", "==", "true", ")", "?", "1", ":", "0", ";", "if", "(", "$", "this", "->", "data", "[", "'is_new'", "]", "===", "$", "value", ")", "{", "return"...
Set the value of IsNew / is_new. Must not be null. @param $value bool
[ "Set", "the", "value", "of", "IsNew", "/", "is_new", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Model/Base/BuildErrorBase.php#L513-L524
dancryer/PHPCI
PHPCI/Model/Base/BuildErrorBase.php
BuildErrorBase.getBuild
public function getBuild() { $key = $this->getBuildId(); if (empty($key)) { return null; } $cacheKey = 'Cache.Build.' . $key; $rtn = $this->cache->get($cacheKey, null); if (empty($rtn)) { $rtn = Factory::getStore('Build', 'PHPCI'...
php
public function getBuild() { $key = $this->getBuildId(); if (empty($key)) { return null; } $cacheKey = 'Cache.Build.' . $key; $rtn = $this->cache->get($cacheKey, null); if (empty($rtn)) { $rtn = Factory::getStore('Build', 'PHPCI'...
[ "public", "function", "getBuild", "(", ")", "{", "$", "key", "=", "$", "this", "->", "getBuildId", "(", ")", ";", "if", "(", "empty", "(", "$", "key", ")", ")", "{", "return", "null", ";", "}", "$", "cacheKey", "=", "'Cache.Build.'", ".", "$", "k...
Get the Build model for this BuildError by Id. @uses \PHPCI\Store\BuildStore::getById() @uses \PHPCI\Model\Build @return \PHPCI\Model\Build
[ "Get", "the", "Build", "model", "for", "this", "BuildError", "by", "Id", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Model/Base/BuildErrorBase.php#L533-L550
dancryer/PHPCI
PHPCI/Model/Base/BuildErrorBase.php
BuildErrorBase.setBuild
public function setBuild($value) { // Is this an instance of Build? if ($value instanceof \PHPCI\Model\Build) { return $this->setBuildObject($value); } // Is this an array representing a Build item? if (is_array($value) && !empty($value['id'])) { retu...
php
public function setBuild($value) { // Is this an instance of Build? if ($value instanceof \PHPCI\Model\Build) { return $this->setBuildObject($value); } // Is this an array representing a Build item? if (is_array($value) && !empty($value['id'])) { retu...
[ "public", "function", "setBuild", "(", "$", "value", ")", "{", "// Is this an instance of Build?", "if", "(", "$", "value", "instanceof", "\\", "PHPCI", "\\", "Model", "\\", "Build", ")", "{", "return", "$", "this", "->", "setBuildObject", "(", "$", "value",...
Set Build - Accepts an ID, an array representing a Build or a Build model. @param $value mixed
[ "Set", "Build", "-", "Accepts", "an", "ID", "an", "array", "representing", "a", "Build", "or", "a", "Build", "model", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Model/Base/BuildErrorBase.php#L557-L571
dancryer/PHPCI
PHPCI/Controller/BuildStatusController.php
BuildStatusController.init
public function init() { $this->response->disableLayout(); $this->buildStore = Store\Factory::getStore('Build'); $this->projectStore = Store\Factory::getStore('Project'); }
php
public function init() { $this->response->disableLayout(); $this->buildStore = Store\Factory::getStore('Build'); $this->projectStore = Store\Factory::getStore('Project'); }
[ "public", "function", "init", "(", ")", "{", "$", "this", "->", "response", "->", "disableLayout", "(", ")", ";", "$", "this", "->", "buildStore", "=", "Store", "\\", "Factory", "::", "getStore", "(", "'Build'", ")", ";", "$", "this", "->", "projectSto...
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/BuildStatusController.php#L36-L41
dancryer/PHPCI
PHPCI/Controller/BuildStatusController.php
BuildStatusController.getStatus
protected function getStatus($projectId) { $branch = $this->getParam('branch', 'master'); try { $project = $this->projectStore->getById($projectId); $status = 'passing'; if (!$project->getAllowPublicStatus()) { return null; } ...
php
protected function getStatus($projectId) { $branch = $this->getParam('branch', 'master'); try { $project = $this->projectStore->getById($projectId); $status = 'passing'; if (!$project->getAllowPublicStatus()) { return null; } ...
[ "protected", "function", "getStatus", "(", "$", "projectId", ")", "{", "$", "branch", "=", "$", "this", "->", "getParam", "(", "'branch'", ",", "'master'", ")", ";", "try", "{", "$", "project", "=", "$", "this", "->", "projectStore", "->", "getById", "...
Returns status of the last build @param $projectId @return string
[ "Returns", "status", "of", "the", "last", "build" ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Controller/BuildStatusController.php#L48-L71
dancryer/PHPCI
PHPCI/Controller/BuildStatusController.php
BuildStatusController.ccxml
public function ccxml($projectId) { /* @var Project $project */ $project = $this->projectStore->getById($projectId); $xml = new \SimpleXMLElement('<Projects/>'); if (!$project instanceof Project || !$project->getAllowPublicStatus()) { return $this->renderXml($xml); ...
php
public function ccxml($projectId) { /* @var Project $project */ $project = $this->projectStore->getById($projectId); $xml = new \SimpleXMLElement('<Projects/>'); if (!$project instanceof Project || !$project->getAllowPublicStatus()) { return $this->renderXml($xml); ...
[ "public", "function", "ccxml", "(", "$", "projectId", ")", "{", "/* @var Project $project */", "$", "project", "=", "$", "this", "->", "projectStore", "->", "getById", "(", "$", "projectId", ")", ";", "$", "xml", "=", "new", "\\", "SimpleXMLElement", "(", ...
Displays projects information in ccmenu format @param $projectId @return bool @throws \Exception @throws b8\Exception\HttpException
[ "Displays", "projects", "information", "in", "ccmenu", "format" ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Controller/BuildStatusController.php#L81-L112
dancryer/PHPCI
PHPCI/Controller/BuildStatusController.php
BuildStatusController.image
public function image($projectId) { // plastic|flat|flat-squared|social $style = $this->getParam('style', 'plastic'); $label = $this->getParam('label', 'build'); $optionalParams = [ 'logo' => $this->getParam('logo'), 'logoWidth' => $this->getParam('logoW...
php
public function image($projectId) { // plastic|flat|flat-squared|social $style = $this->getParam('style', 'plastic'); $label = $this->getParam('label', 'build'); $optionalParams = [ 'logo' => $this->getParam('logo'), 'logoWidth' => $this->getParam('logoW...
[ "public", "function", "image", "(", "$", "projectId", ")", "{", "// plastic|flat|flat-squared|social", "$", "style", "=", "$", "this", "->", "getParam", "(", "'style'", ",", "'plastic'", ")", ";", "$", "label", "=", "$", "this", "->", "getParam", "(", "'la...
Returns the appropriate build status image in SVG format for a given project.
[ "Returns", "the", "appropriate", "build", "status", "image", "in", "SVG", "format", "for", "a", "given", "project", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Controller/BuildStatusController.php#L131-L172
dancryer/PHPCI
PHPCI/Controller/BuildStatusController.php
BuildStatusController.view
public function view($projectId) { $project = $this->projectStore->getById($projectId); if (empty($project)) { throw new NotFoundException('Project with id: ' . $projectId . ' not found'); } if (!$project->getAllowPublicStatus()) { throw new NotFoundExceptio...
php
public function view($projectId) { $project = $this->projectStore->getById($projectId); if (empty($project)) { throw new NotFoundException('Project with id: ' . $projectId . ' not found'); } if (!$project->getAllowPublicStatus()) { throw new NotFoundExceptio...
[ "public", "function", "view", "(", "$", "projectId", ")", "{", "$", "project", "=", "$", "this", "->", "projectStore", "->", "getById", "(", "$", "projectId", ")", ";", "if", "(", "empty", "(", "$", "project", ")", ")", "{", "throw", "new", "NotFound...
View the public status page of a given project, if enabled. @param $projectId @return string @throws \b8\Exception\HttpException\NotFoundException
[ "View", "the", "public", "status", "page", "of", "a", "given", "project", "if", "enabled", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Controller/BuildStatusController.php#L180-L202
dancryer/PHPCI
PHPCI/Plugin/Wipe.php
Wipe.execute
public function execute() { $build = $this->phpci->buildPath; if ($this->directory == $build || empty($this->directory)) { return true; } if (is_dir($this->directory)) { $cmd = 'rm -Rf "%s"'; if (IS_WIN) { $cmd = 'rmdir /S /Q "%s"'...
php
public function execute() { $build = $this->phpci->buildPath; if ($this->directory == $build || empty($this->directory)) { return true; } if (is_dir($this->directory)) { $cmd = 'rm -Rf "%s"'; if (IS_WIN) { $cmd = 'rmdir /S /Q "%s"'...
[ "public", "function", "execute", "(", ")", "{", "$", "build", "=", "$", "this", "->", "phpci", "->", "buildPath", ";", "if", "(", "$", "this", "->", "directory", "==", "$", "build", "||", "empty", "(", "$", "this", "->", "directory", ")", ")", "{",...
Wipes a directory's contents
[ "Wipes", "a", "directory", "s", "contents" ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Plugin/Wipe.php#L52-L67
dancryer/PHPCI
PHPCI/Logging/LoggerConfig.php
LoggerConfig.getFor
public function getFor($name) { if (isset($this->cache[$name])) { return $this->cache[$name]; } $handlers = $this->getHandlers(self::KEY_ALWAYS_LOADED); if ($name !== self::KEY_ALWAYS_LOADED) { $handlers = array_merge($handlers, $this->getHandlers($name)); ...
php
public function getFor($name) { if (isset($this->cache[$name])) { return $this->cache[$name]; } $handlers = $this->getHandlers(self::KEY_ALWAYS_LOADED); if ($name !== self::KEY_ALWAYS_LOADED) { $handlers = array_merge($handlers, $this->getHandlers($name)); ...
[ "public", "function", "getFor", "(", "$", "name", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "cache", "[", "$", "name", "]", ")", ")", "{", "return", "$", "this", "->", "cache", "[", "$", "name", "]", ";", "}", "$", "handlers", "=", ...
Returns an instance of Monolog with all configured handlers added. The Monolog instance will be given $name. @param $name @return Logger
[ "Returns", "an", "instance", "of", "Monolog", "with", "all", "configured", "handlers", "added", ".", "The", "Monolog", "instance", "will", "be", "given", "$name", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Logging/LoggerConfig.php#L59-L75
dancryer/PHPCI
PHPCI/Logging/LoggerConfig.php
LoggerConfig.getHandlers
protected function getHandlers($key) { $handlers = array(); // They key is expected to either be an array or // a callable function that returns an array if (isset($this->config[$key])) { if (is_callable($this->config[$key])) { $handlers = call_user_func(...
php
protected function getHandlers($key) { $handlers = array(); // They key is expected to either be an array or // a callable function that returns an array if (isset($this->config[$key])) { if (is_callable($this->config[$key])) { $handlers = call_user_func(...
[ "protected", "function", "getHandlers", "(", "$", "key", ")", "{", "$", "handlers", "=", "array", "(", ")", ";", "// They key is expected to either be an array or", "// a callable function that returns an array", "if", "(", "isset", "(", "$", "this", "->", "config", ...
Return an array of enabled log handlers. @param $key @return array|mixed
[ "Return", "an", "array", "of", "enabled", "log", "handlers", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Logging/LoggerConfig.php#L82-L96
dancryer/PHPCI
PHPCI/Store/BuildErrorStore.php
BuildErrorStore.getErrorsForBuild
public function getErrorsForBuild($buildId, $since = null) { $query = 'SELECT * FROM build_error WHERE build_id = :build'; if (!is_null($since)) { $query .= ' AND created_date > :since'; } $query .= ' LIMIT 15000'; $stmt = Database::getConne...
php
public function getErrorsForBuild($buildId, $since = null) { $query = 'SELECT * FROM build_error WHERE build_id = :build'; if (!is_null($since)) { $query .= ' AND created_date > :since'; } $query .= ' LIMIT 15000'; $stmt = Database::getConne...
[ "public", "function", "getErrorsForBuild", "(", "$", "buildId", ",", "$", "since", "=", "null", ")", "{", "$", "query", "=", "'SELECT * FROM build_error\n WHERE build_id = :build'", ";", "if", "(", "!", "is_null", "(", "$", "since", ")", ")", ...
Get a list of errors for a given build, since a given time. @param $buildId @param string $since date string @return array
[ "Get", "a", "list", "of", "errors", "for", "a", "given", "build", "since", "a", "given", "time", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Store/BuildErrorStore.php#L25-L56
dancryer/PHPCI
PHPCI/Store/BuildErrorStore.php
BuildErrorStore.getErrorTotalForBuild
public function getErrorTotalForBuild($buildId) { $query = 'SELECT COUNT(*) AS total FROM build_error WHERE build_id = :build'; $stmt = Database::getConnection('read')->prepare($query); $stmt->bindValue(':build', $buildId, \PDO::PARAM_INT); if ($stmt->execute()...
php
public function getErrorTotalForBuild($buildId) { $query = 'SELECT COUNT(*) AS total FROM build_error WHERE build_id = :build'; $stmt = Database::getConnection('read')->prepare($query); $stmt->bindValue(':build', $buildId, \PDO::PARAM_INT); if ($stmt->execute()...
[ "public", "function", "getErrorTotalForBuild", "(", "$", "buildId", ")", "{", "$", "query", "=", "'SELECT COUNT(*) AS total FROM build_error\n WHERE build_id = :build'", ";", "$", "stmt", "=", "Database", "::", "getConnection", "(", "'read'", ")", "->",...
Gets the total number of errors for a given build. @param $buildId @param string $since date string @return array
[ "Gets", "the", "total", "number", "of", "errors", "for", "a", "given", "build", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Store/BuildErrorStore.php#L64-L79
dancryer/PHPCI
PHPCI/Store/BuildErrorStore.php
BuildErrorStore.getIsNewError
public function getIsNewError($hash) { $query = 'SELECT COUNT(*) AS total FROM build_error WHERE `hash` = :errorhash'; $stmt = Database::getConnection('read')->prepare($query); $stmt->bindValue(':errorhash', $hash, \PDO::PARAM_INT); if ($stmt->execute()) { ...
php
public function getIsNewError($hash) { $query = 'SELECT COUNT(*) AS total FROM build_error WHERE `hash` = :errorhash'; $stmt = Database::getConnection('read')->prepare($query); $stmt->bindValue(':errorhash', $hash, \PDO::PARAM_INT); if ($stmt->execute()) { ...
[ "public", "function", "getIsNewError", "(", "$", "hash", ")", "{", "$", "query", "=", "'SELECT COUNT(*) AS total FROM build_error\n WHERE `hash` = :errorhash'", ";", "$", "stmt", "=", "Database", "::", "getConnection", "(", "'read'", ")", "->", "prepa...
Check if a build error is new.
[ "Check", "if", "a", "build", "error", "is", "new", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Store/BuildErrorStore.php#L84-L99
dancryer/PHPCI
PHPCI/Plugin/PhpCpd.php
PhpCpd.execute
public function execute() { $ignore = ''; if (count($this->ignore)) { $namesExclude = ' --names-exclude '; foreach ($this->ignore as $item) { // remove the trailing slash $item = rtrim($item, DIRECTORY_SEPARATOR); if (is_file(r...
php
public function execute() { $ignore = ''; if (count($this->ignore)) { $namesExclude = ' --names-exclude '; foreach ($this->ignore as $item) { // remove the trailing slash $item = rtrim($item, DIRECTORY_SEPARATOR); if (is_file(r...
[ "public", "function", "execute", "(", ")", "{", "$", "ignore", "=", "''", ";", "if", "(", "count", "(", "$", "this", "->", "ignore", ")", ")", "{", "$", "namesExclude", "=", "' --names-exclude '", ";", "foreach", "(", "$", "this", "->", "ignore", "as...
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/PhpCpd.php#L67-L105
dancryer/PHPCI
PHPCI/Plugin/PhpCpd.php
PhpCpd.processReport
protected function processReport($xmlString) { $xml = simplexml_load_string($xmlString); if ($xml === false) { $this->phpci->log($xmlString); throw new \Exception(Lang::get('could_not_process_report')); } $warnings = 0; foreach ($xml->duplication as ...
php
protected function processReport($xmlString) { $xml = simplexml_load_string($xmlString); if ($xml === false) { $this->phpci->log($xmlString); throw new \Exception(Lang::get('could_not_process_report')); } $warnings = 0; foreach ($xml->duplication as ...
[ "protected", "function", "processReport", "(", "$", "xmlString", ")", "{", "$", "xml", "=", "simplexml_load_string", "(", "$", "xmlString", ")", ";", "if", "(", "$", "xml", "===", "false", ")", "{", "$", "this", "->", "phpci", "->", "log", "(", "$", ...
Process the PHPCPD XML report. @param $xmlString @return array @throws \Exception
[ "Process", "the", "PHPCPD", "XML", "report", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Plugin/PhpCpd.php#L113-L151
dancryer/PHPCI
PHPCI/Model/Base/ProjectBase.php
ProjectBase.setTitle
public function setTitle($value) { $this->_validateNotNull('Title', $value); $this->_validateString('Title', $value); if ($this->data['title'] === $value) { return; } $this->data['title'] = $value; $this->_setModified('title'); }
php
public function setTitle($value) { $this->_validateNotNull('Title', $value); $this->_validateString('Title', $value); if ($this->data['title'] === $value) { return; } $this->data['title'] = $value; $this->_setModified('title'); }
[ "public", "function", "setTitle", "(", "$", "value", ")", "{", "$", "this", "->", "_validateNotNull", "(", "'Title'", ",", "$", "value", ")", ";", "$", "this", "->", "_validateString", "(", "'Title'", ",", "$", "value", ")", ";", "if", "(", "$", "thi...
Set the value of Title / title. Must not be null. @param $value string
[ "Set", "the", "value", "of", "Title", "/", "title", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Model/Base/ProjectBase.php#L375-L387
dancryer/PHPCI
PHPCI/Model/Base/ProjectBase.php
ProjectBase.setReference
public function setReference($value) { $this->_validateNotNull('Reference', $value); $this->_validateString('Reference', $value); if ($this->data['reference'] === $value) { return; } $this->data['reference'] = $value; $this->_setModified('reference'); ...
php
public function setReference($value) { $this->_validateNotNull('Reference', $value); $this->_validateString('Reference', $value); if ($this->data['reference'] === $value) { return; } $this->data['reference'] = $value; $this->_setModified('reference'); ...
[ "public", "function", "setReference", "(", "$", "value", ")", "{", "$", "this", "->", "_validateNotNull", "(", "'Reference'", ",", "$", "value", ")", ";", "$", "this", "->", "_validateString", "(", "'Reference'", ",", "$", "value", ")", ";", "if", "(", ...
Set the value of Reference / reference. Must not be null. @param $value string
[ "Set", "the", "value", "of", "Reference", "/", "reference", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Model/Base/ProjectBase.php#L395-L407
dancryer/PHPCI
PHPCI/Model/Base/ProjectBase.php
ProjectBase.setSshPrivateKey
public function setSshPrivateKey($value) { $this->_validateString('SshPrivateKey', $value); if ($this->data['ssh_private_key'] === $value) { return; } $this->data['ssh_private_key'] = $value; $this->_setModified('ssh_private_key'); }
php
public function setSshPrivateKey($value) { $this->_validateString('SshPrivateKey', $value); if ($this->data['ssh_private_key'] === $value) { return; } $this->data['ssh_private_key'] = $value; $this->_setModified('ssh_private_key'); }
[ "public", "function", "setSshPrivateKey", "(", "$", "value", ")", "{", "$", "this", "->", "_validateString", "(", "'SshPrivateKey'", ",", "$", "value", ")", ";", "if", "(", "$", "this", "->", "data", "[", "'ssh_private_key'", "]", "===", "$", "value", ")...
Set the value of SshPrivateKey / ssh_private_key. @param $value string
[ "Set", "the", "value", "of", "SshPrivateKey", "/", "ssh_private_key", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Model/Base/ProjectBase.php#L434-L445
dancryer/PHPCI
PHPCI/Model/Base/ProjectBase.php
ProjectBase.setType
public function setType($value) { $this->_validateNotNull('Type', $value); $this->_validateString('Type', $value); if ($this->data['type'] === $value) { return; } $this->data['type'] = $value; $this->_setModified('type'); }
php
public function setType($value) { $this->_validateNotNull('Type', $value); $this->_validateString('Type', $value); if ($this->data['type'] === $value) { return; } $this->data['type'] = $value; $this->_setModified('type'); }
[ "public", "function", "setType", "(", "$", "value", ")", "{", "$", "this", "->", "_validateNotNull", "(", "'Type'", ",", "$", "value", ")", ";", "$", "this", "->", "_validateString", "(", "'Type'", ",", "$", "value", ")", ";", "if", "(", "$", "this",...
Set the value of Type / type. Must not be null. @param $value string
[ "Set", "the", "value", "of", "Type", "/", "type", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Model/Base/ProjectBase.php#L453-L465
dancryer/PHPCI
PHPCI/Model/Base/ProjectBase.php
ProjectBase.setAccessInformation
public function setAccessInformation($value) { $this->_validateString('AccessInformation', $value); if ($this->data['access_information'] === $value) { return; } $this->data['access_information'] = $value; $this->_setModified('access_information'); }
php
public function setAccessInformation($value) { $this->_validateString('AccessInformation', $value); if ($this->data['access_information'] === $value) { return; } $this->data['access_information'] = $value; $this->_setModified('access_information'); }
[ "public", "function", "setAccessInformation", "(", "$", "value", ")", "{", "$", "this", "->", "_validateString", "(", "'AccessInformation'", ",", "$", "value", ")", ";", "if", "(", "$", "this", "->", "data", "[", "'access_information'", "]", "===", "$", "v...
Set the value of AccessInformation / access_information. @param $value string
[ "Set", "the", "value", "of", "AccessInformation", "/", "access_information", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Model/Base/ProjectBase.php#L472-L483
dancryer/PHPCI
PHPCI/Model/Base/ProjectBase.php
ProjectBase.setLastCommit
public function setLastCommit($value) { $this->_validateString('LastCommit', $value); if ($this->data['last_commit'] === $value) { return; } $this->data['last_commit'] = $value; $this->_setModified('last_commit'); }
php
public function setLastCommit($value) { $this->_validateString('LastCommit', $value); if ($this->data['last_commit'] === $value) { return; } $this->data['last_commit'] = $value; $this->_setModified('last_commit'); }
[ "public", "function", "setLastCommit", "(", "$", "value", ")", "{", "$", "this", "->", "_validateString", "(", "'LastCommit'", ",", "$", "value", ")", ";", "if", "(", "$", "this", "->", "data", "[", "'last_commit'", "]", "===", "$", "value", ")", "{", ...
Set the value of LastCommit / last_commit. @param $value string
[ "Set", "the", "value", "of", "LastCommit", "/", "last_commit", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Model/Base/ProjectBase.php#L490-L501
dancryer/PHPCI
PHPCI/Model/Base/ProjectBase.php
ProjectBase.setBuildConfig
public function setBuildConfig($value) { $this->_validateString('BuildConfig', $value); if ($this->data['build_config'] === $value) { return; } $this->data['build_config'] = $value; $this->_setModified('build_config'); }
php
public function setBuildConfig($value) { $this->_validateString('BuildConfig', $value); if ($this->data['build_config'] === $value) { return; } $this->data['build_config'] = $value; $this->_setModified('build_config'); }
[ "public", "function", "setBuildConfig", "(", "$", "value", ")", "{", "$", "this", "->", "_validateString", "(", "'BuildConfig'", ",", "$", "value", ")", ";", "if", "(", "$", "this", "->", "data", "[", "'build_config'", "]", "===", "$", "value", ")", "{...
Set the value of BuildConfig / build_config. @param $value string
[ "Set", "the", "value", "of", "BuildConfig", "/", "build_config", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Model/Base/ProjectBase.php#L508-L519
dancryer/PHPCI
PHPCI/Model/Base/ProjectBase.php
ProjectBase.setSshPublicKey
public function setSshPublicKey($value) { $this->_validateString('SshPublicKey', $value); if ($this->data['ssh_public_key'] === $value) { return; } $this->data['ssh_public_key'] = $value; $this->_setModified('ssh_public_key'); }
php
public function setSshPublicKey($value) { $this->_validateString('SshPublicKey', $value); if ($this->data['ssh_public_key'] === $value) { return; } $this->data['ssh_public_key'] = $value; $this->_setModified('ssh_public_key'); }
[ "public", "function", "setSshPublicKey", "(", "$", "value", ")", "{", "$", "this", "->", "_validateString", "(", "'SshPublicKey'", ",", "$", "value", ")", ";", "if", "(", "$", "this", "->", "data", "[", "'ssh_public_key'", "]", "===", "$", "value", ")", ...
Set the value of SshPublicKey / ssh_public_key. @param $value string
[ "Set", "the", "value", "of", "SshPublicKey", "/", "ssh_public_key", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Model/Base/ProjectBase.php#L526-L537
dancryer/PHPCI
PHPCI/Model/Base/ProjectBase.php
ProjectBase.setAllowPublicStatus
public function setAllowPublicStatus($value) { $this->_validateNotNull('AllowPublicStatus', $value); $this->_validateInt('AllowPublicStatus', $value); if ($this->data['allow_public_status'] === $value) { return; } $this->data['allow_public_status'] = $value; ...
php
public function setAllowPublicStatus($value) { $this->_validateNotNull('AllowPublicStatus', $value); $this->_validateInt('AllowPublicStatus', $value); if ($this->data['allow_public_status'] === $value) { return; } $this->data['allow_public_status'] = $value; ...
[ "public", "function", "setAllowPublicStatus", "(", "$", "value", ")", "{", "$", "this", "->", "_validateNotNull", "(", "'AllowPublicStatus'", ",", "$", "value", ")", ";", "$", "this", "->", "_validateInt", "(", "'AllowPublicStatus'", ",", "$", "value", ")", ...
Set the value of AllowPublicStatus / allow_public_status. Must not be null. @param $value int
[ "Set", "the", "value", "of", "AllowPublicStatus", "/", "allow_public_status", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Model/Base/ProjectBase.php#L545-L557
dancryer/PHPCI
PHPCI/Model/Base/ProjectBase.php
ProjectBase.setArchived
public function setArchived($value) { $this->_validateNotNull('Archived', $value); $this->_validateInt('Archived', $value); if ($this->data['archived'] === $value) { return; } $this->data['archived'] = $value; $this->_setModified('archived'); }
php
public function setArchived($value) { $this->_validateNotNull('Archived', $value); $this->_validateInt('Archived', $value); if ($this->data['archived'] === $value) { return; } $this->data['archived'] = $value; $this->_setModified('archived'); }
[ "public", "function", "setArchived", "(", "$", "value", ")", "{", "$", "this", "->", "_validateNotNull", "(", "'Archived'", ",", "$", "value", ")", ";", "$", "this", "->", "_validateInt", "(", "'Archived'", ",", "$", "value", ")", ";", "if", "(", "$", ...
Set the value of Archived / archived. Must not be null. @param $value int
[ "Set", "the", "value", "of", "Archived", "/", "archived", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Model/Base/ProjectBase.php#L565-L577
dancryer/PHPCI
PHPCI/Model/Base/ProjectBase.php
ProjectBase.setGroupId
public function setGroupId($value) { $this->_validateNotNull('GroupId', $value); $this->_validateInt('GroupId', $value); if ($this->data['group_id'] === $value) { return; } $this->data['group_id'] = $value; $this->_setModified('group_id'); }
php
public function setGroupId($value) { $this->_validateNotNull('GroupId', $value); $this->_validateInt('GroupId', $value); if ($this->data['group_id'] === $value) { return; } $this->data['group_id'] = $value; $this->_setModified('group_id'); }
[ "public", "function", "setGroupId", "(", "$", "value", ")", "{", "$", "this", "->", "_validateNotNull", "(", "'GroupId'", ",", "$", "value", ")", ";", "$", "this", "->", "_validateInt", "(", "'GroupId'", ",", "$", "value", ")", ";", "if", "(", "$", "...
Set the value of GroupId / group_id. Must not be null. @param $value int
[ "Set", "the", "value", "of", "GroupId", "/", "group_id", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Model/Base/ProjectBase.php#L585-L597
dancryer/PHPCI
PHPCI/Model/Base/ProjectBase.php
ProjectBase.getGroup
public function getGroup() { $key = $this->getGroupId(); if (empty($key)) { return null; } $cacheKey = 'Cache.ProjectGroup.' . $key; $rtn = $this->cache->get($cacheKey, null); if (empty($rtn)) { $rtn = Factory::getStore('ProjectG...
php
public function getGroup() { $key = $this->getGroupId(); if (empty($key)) { return null; } $cacheKey = 'Cache.ProjectGroup.' . $key; $rtn = $this->cache->get($cacheKey, null); if (empty($rtn)) { $rtn = Factory::getStore('ProjectG...
[ "public", "function", "getGroup", "(", ")", "{", "$", "key", "=", "$", "this", "->", "getGroupId", "(", ")", ";", "if", "(", "empty", "(", "$", "key", ")", ")", "{", "return", "null", ";", "}", "$", "cacheKey", "=", "'Cache.ProjectGroup.'", ".", "$...
Get the ProjectGroup model for this Project by Id. @uses \PHPCI\Store\ProjectGroupStore::getById() @uses \PHPCI\Model\ProjectGroup @return \PHPCI\Model\ProjectGroup
[ "Get", "the", "ProjectGroup", "model", "for", "this", "Project", "by", "Id", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Model/Base/ProjectBase.php#L606-L623
dancryer/PHPCI
PHPCI/Model/Base/ProjectBase.php
ProjectBase.setGroup
public function setGroup($value) { // Is this an instance of ProjectGroup? if ($value instanceof \PHPCI\Model\ProjectGroup) { return $this->setGroupObject($value); } // Is this an array representing a ProjectGroup item? if (is_array($value) && !empty($value['id']...
php
public function setGroup($value) { // Is this an instance of ProjectGroup? if ($value instanceof \PHPCI\Model\ProjectGroup) { return $this->setGroupObject($value); } // Is this an array representing a ProjectGroup item? if (is_array($value) && !empty($value['id']...
[ "public", "function", "setGroup", "(", "$", "value", ")", "{", "// Is this an instance of ProjectGroup?", "if", "(", "$", "value", "instanceof", "\\", "PHPCI", "\\", "Model", "\\", "ProjectGroup", ")", "{", "return", "$", "this", "->", "setGroupObject", "(", "...
Set Group - Accepts an ID, an array representing a ProjectGroup or a ProjectGroup model. @param $value mixed
[ "Set", "Group", "-", "Accepts", "an", "ID", "an", "array", "representing", "a", "ProjectGroup", "or", "a", "ProjectGroup", "model", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Model/Base/ProjectBase.php#L630-L644
dancryer/PHPCI
PHPCI/Command/DaemoniseCommand.php
DaemoniseCommand.execute
protected function execute(InputInterface $input, OutputInterface $output) { $cmd = "echo %s > '%s/daemon/daemon.pid'"; $command = sprintf($cmd, getmypid(), PHPCI_DIR); exec($command); $this->output = $output; $this->run = true; $this->sleep = 0; $runner ...
php
protected function execute(InputInterface $input, OutputInterface $output) { $cmd = "echo %s > '%s/daemon/daemon.pid'"; $command = sprintf($cmd, getmypid(), PHPCI_DIR); exec($command); $this->output = $output; $this->run = true; $this->sleep = 0; $runner ...
[ "protected", "function", "execute", "(", "InputInterface", "$", "input", ",", "OutputInterface", "$", "output", ")", "{", "$", "cmd", "=", "\"echo %s > '%s/daemon/daemon.pid'\"", ";", "$", "command", "=", "sprintf", "(", "$", "cmd", ",", "getmypid", "(", ")", ...
Loops through running.
[ "Loops", "through", "running", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Command/DaemoniseCommand.php#L66-L100
dancryer/PHPCI
PHPCI/Command/RebuildCommand.php
RebuildCommand.execute
protected function execute(InputInterface $input, OutputInterface $output) { $runner = new RunCommand($this->logger); $runner->setMaxBuilds(1); $runner->setDaemon(false); /** @var \PHPCI\Store\BuildStore $store */ $store = Factory::getStore('Build'); $service = new B...
php
protected function execute(InputInterface $input, OutputInterface $output) { $runner = new RunCommand($this->logger); $runner->setMaxBuilds(1); $runner->setDaemon(false); /** @var \PHPCI\Store\BuildStore $store */ $store = Factory::getStore('Build'); $service = new B...
[ "protected", "function", "execute", "(", "InputInterface", "$", "input", ",", "OutputInterface", "$", "output", ")", "{", "$", "runner", "=", "new", "RunCommand", "(", "$", "this", "->", "logger", ")", ";", "$", "runner", "->", "setMaxBuilds", "(", "1", ...
Loops through running.
[ "Loops", "through", "running", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Command/RebuildCommand.php#L68-L83
dancryer/PHPCI
PHPCI/Plugin/Sqlite.php
Sqlite.execute
public function execute() { try { $opts = array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION); $pdo = new PDO('sqlite:' . $this->path, $opts); foreach ($this->queries as $query) { $pdo->query($this->phpci->interpolate($query)); } } catc...
php
public function execute() { try { $opts = array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION); $pdo = new PDO('sqlite:' . $this->path, $opts); foreach ($this->queries as $query) { $pdo->query($this->phpci->interpolate($query)); } } catc...
[ "public", "function", "execute", "(", ")", "{", "try", "{", "$", "opts", "=", "array", "(", "PDO", "::", "ATTR_ERRMODE", "=>", "PDO", "::", "ERRMODE_EXCEPTION", ")", ";", "$", "pdo", "=", "new", "PDO", "(", "'sqlite:'", ".", "$", "this", "->", "path"...
Connects to SQLite and runs a specified set of queries. @return boolean
[ "Connects", "to", "SQLite", "and", "runs", "a", "specified", "set", "of", "queries", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Plugin/Sqlite.php#L66-L80
dancryer/PHPCI
PHPCI/Plugin/Shell.php
Shell.execute
public function execute() { if (!defined('ENABLE_SHELL_PLUGIN') || !ENABLE_SHELL_PLUGIN) { throw new \Exception(Lang::get('shell_not_enabled')); } $success = true; foreach ($this->commands as $command) { $command = $this->phpci->interpolate($command); ...
php
public function execute() { if (!defined('ENABLE_SHELL_PLUGIN') || !ENABLE_SHELL_PLUGIN) { throw new \Exception(Lang::get('shell_not_enabled')); } $success = true; foreach ($this->commands as $command) { $command = $this->phpci->interpolate($command); ...
[ "public", "function", "execute", "(", ")", "{", "if", "(", "!", "defined", "(", "'ENABLE_SHELL_PLUGIN'", ")", "||", "!", "ENABLE_SHELL_PLUGIN", ")", "{", "throw", "new", "\\", "Exception", "(", "Lang", "::", "get", "(", "'shell_not_enabled'", ")", ")", ";"...
Runs the shell command.
[ "Runs", "the", "shell", "command", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Plugin/Shell.php#L80-L97
dancryer/PHPCI
PHPCI/Plugin/Deployer.php
Deployer.execute
public function execute() { if (empty($this->webhookUrl)) { $this->phpci->logFailure('You must specify a webhook URL.'); return false; } $http = new HttpClient(); $response = $http->post($this->webhookUrl, array( 'reason' => $this->phpci->interpo...
php
public function execute() { if (empty($this->webhookUrl)) { $this->phpci->logFailure('You must specify a webhook URL.'); return false; } $http = new HttpClient(); $response = $http->post($this->webhookUrl, array( 'reason' => $this->phpci->interpo...
[ "public", "function", "execute", "(", ")", "{", "if", "(", "empty", "(", "$", "this", "->", "webhookUrl", ")", ")", "{", "$", "this", "->", "phpci", "->", "logFailure", "(", "'You must specify a webhook URL.'", ")", ";", "return", "false", ";", "}", "$",...
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/Deployer.php#L54-L73
dancryer/PHPCI
PHPCI/Builder.php
Builder.setConfigArray
public function setConfigArray($config) { if (is_null($config) || !is_array($config)) { throw new \Exception(Lang::get('missing_phpci_yml')); } $this->config = $config; }
php
public function setConfigArray($config) { if (is_null($config) || !is_array($config)) { throw new \Exception(Lang::get('missing_phpci_yml')); } $this->config = $config; }
[ "public", "function", "setConfigArray", "(", "$", "config", ")", "{", "if", "(", "is_null", "(", "$", "config", ")", "||", "!", "is_array", "(", "$", "config", ")", ")", "{", "throw", "new", "\\", "Exception", "(", "Lang", "::", "get", "(", "'missing...
Set the config array, as read from phpci.yml @param array|null $config @throws \Exception
[ "Set", "the", "config", "array", "as", "read", "from", "phpci", ".", "yml" ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Builder.php#L136-L143
dancryer/PHPCI
PHPCI/Builder.php
Builder.execute
public function execute() { // Update the build in the database, ping any external services. $this->build->setStatus(Build::STATUS_RUNNING); $this->build->setStarted(new \DateTime()); $this->store->save($this->build); $this->build->sendStatusPostback(); $success = tru...
php
public function execute() { // Update the build in the database, ping any external services. $this->build->setStatus(Build::STATUS_RUNNING); $this->build->setStarted(new \DateTime()); $this->store->save($this->build); $this->build->sendStatusPostback(); $success = tru...
[ "public", "function", "execute", "(", ")", "{", "// Update the build in the database, ping any external services.", "$", "this", "->", "build", "->", "setStatus", "(", "Build", "::", "STATUS_RUNNING", ")", ";", "$", "this", "->", "build", "->", "setStarted", "(", ...
Run the active build.
[ "Run", "the", "active", "build", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Builder.php#L182-L252
dancryer/PHPCI
PHPCI/Builder.php
Builder.findBinary
public function findBinary($binary, $quiet = false) { return $this->commandExecutor->findBinary($binary, $quiet = false); }
php
public function findBinary($binary, $quiet = false) { return $this->commandExecutor->findBinary($binary, $quiet = false); }
[ "public", "function", "findBinary", "(", "$", "binary", ",", "$", "quiet", "=", "false", ")", "{", "return", "$", "this", "->", "commandExecutor", "->", "findBinary", "(", "$", "binary", ",", "$", "quiet", "=", "false", ")", ";", "}" ]
Find a binary required by a plugin. @param string $binary @param bool $quiet @return null|string
[ "Find", "a", "binary", "required", "by", "a", "plugin", ".", "@param", "string", "$binary", "@param", "bool", "$quiet" ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Builder.php#L286-L289
dancryer/PHPCI
PHPCI/Builder.php
Builder.setupBuild
protected function setupBuild() { $this->buildPath = $this->build->getBuildPath(); $this->interpolator->setupInterpolationVars( $this->build, $this->buildPath, PHPCI_URL ); $this->commandExecutor->setBuildPath($this->buildPath); // Creat...
php
protected function setupBuild() { $this->buildPath = $this->build->getBuildPath(); $this->interpolator->setupInterpolationVars( $this->build, $this->buildPath, PHPCI_URL ); $this->commandExecutor->setBuildPath($this->buildPath); // Creat...
[ "protected", "function", "setupBuild", "(", ")", "{", "$", "this", "->", "buildPath", "=", "$", "this", "->", "build", "->", "getBuildPath", "(", ")", ";", "$", "this", "->", "interpolator", "->", "setupInterpolationVars", "(", "$", "this", "->", "build", ...
Set up a working copy of the project for building.
[ "Set", "up", "a", "working", "copy", "of", "the", "project", "for", "building", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Builder.php#L305-L334
dancryer/PHPCI
PHPCI/Builder.php
Builder.log
public function log($message, $level = LogLevel::INFO, $context = array()) { $this->buildLogger->log($message, $level, $context); }
php
public function log($message, $level = LogLevel::INFO, $context = array()) { $this->buildLogger->log($message, $level, $context); }
[ "public", "function", "log", "(", "$", "message", ",", "$", "level", "=", "LogLevel", "::", "INFO", ",", "$", "context", "=", "array", "(", ")", ")", "{", "$", "this", "->", "buildLogger", "->", "log", "(", "$", "message", ",", "$", "level", ",", ...
Write to the build log. @param $message @param string $level @param array $context
[ "Write", "to", "the", "build", "log", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Builder.php#L353-L356
dancryer/PHPCI
PHPCI/Builder.php
Builder.logFailure
public function logFailure($message, \Exception $exception = null) { $this->buildLogger->logFailure($message, $exception); }
php
public function logFailure($message, \Exception $exception = null) { $this->buildLogger->logFailure($message, $exception); }
[ "public", "function", "logFailure", "(", "$", "message", ",", "\\", "Exception", "$", "exception", "=", "null", ")", "{", "$", "this", "->", "buildLogger", "->", "logFailure", "(", "$", "message", ",", "$", "exception", ")", ";", "}" ]
Add a failure-coloured message to the log. @param string $message @param \Exception $exception The exception that caused the error.
[ "Add", "a", "failure", "-", "coloured", "message", "to", "the", "log", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Builder.php#L372-L375
dancryer/PHPCI
PHPCI/Builder.php
Builder.buildPluginFactory
private function buildPluginFactory(Build $build) { $pluginFactory = new PluginFactory(); $self = $this; $pluginFactory->registerResource( function () use ($self) { return $self; }, null, 'PHPCI\Builder' ); $pl...
php
private function buildPluginFactory(Build $build) { $pluginFactory = new PluginFactory(); $self = $this; $pluginFactory->registerResource( function () use ($self) { return $self; }, null, 'PHPCI\Builder' ); $pl...
[ "private", "function", "buildPluginFactory", "(", "Build", "$", "build", ")", "{", "$", "pluginFactory", "=", "new", "PluginFactory", "(", ")", ";", "$", "self", "=", "$", "this", ";", "$", "pluginFactory", "->", "registerResource", "(", "function", "(", "...
Returns a configured instance of the plugin factory. @param Build $build @return PluginFactory
[ "Returns", "a", "configured", "instance", "of", "the", "plugin", "factory", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Builder.php#L382-L422
dancryer/PHPCI
PHPCI/Plugin/PhpUnit.php
PhpUnit.canExecute
public static function canExecute($stage, Builder $builder, Build $build) { if ($stage == 'test' && !is_null(self::findConfigFile($builder->buildPath))) { return true; } return false; }
php
public static function canExecute($stage, Builder $builder, Build $build) { if ($stage == 'test' && !is_null(self::findConfigFile($builder->buildPath))) { return true; } return false; }
[ "public", "static", "function", "canExecute", "(", "$", "stage", ",", "Builder", "$", "builder", ",", "Build", "$", "build", ")", "{", "if", "(", "$", "stage", "==", "'test'", "&&", "!", "is_null", "(", "self", "::", "findConfigFile", "(", "$", "builde...
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/PhpUnit.php#L59-L66
dancryer/PHPCI
PHPCI/Plugin/PhpUnit.php
PhpUnit.findConfigFile
public static function findConfigFile($buildPath) { if (file_exists($buildPath . 'phpunit.xml')) { return 'phpunit.xml'; } if (file_exists($buildPath . 'tests' . DIRECTORY_SEPARATOR . 'phpunit.xml')) { return 'tests' . DIRECTORY_SEPARATOR . 'phpunit.xml'; } ...
php
public static function findConfigFile($buildPath) { if (file_exists($buildPath . 'phpunit.xml')) { return 'phpunit.xml'; } if (file_exists($buildPath . 'tests' . DIRECTORY_SEPARATOR . 'phpunit.xml')) { return 'tests' . DIRECTORY_SEPARATOR . 'phpunit.xml'; } ...
[ "public", "static", "function", "findConfigFile", "(", "$", "buildPath", ")", "{", "if", "(", "file_exists", "(", "$", "buildPath", ".", "'phpunit.xml'", ")", ")", "{", "return", "'phpunit.xml'", ";", "}", "if", "(", "file_exists", "(", "$", "buildPath", "...
Try and find the phpunit XML config file. @param $buildPath @return null|string
[ "Try", "and", "find", "the", "phpunit", "XML", "config", "file", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Plugin/PhpUnit.php#L73-L92
dancryer/PHPCI
PHPCI/Plugin/PhpUnit.php
PhpUnit.execute
public function execute() { if (empty($this->xmlConfigFile) && empty($this->directory)) { $this->phpci->logFailure('Neither configuration file nor test directory found.'); return false; } $success = true; $this->phpci->logExecOutput(false); // Run a...
php
public function execute() { if (empty($this->xmlConfigFile) && empty($this->directory)) { $this->phpci->logFailure('Neither configuration file nor test directory found.'); return false; } $success = true; $this->phpci->logExecOutput(false); // Run a...
[ "public", "function", "execute", "(", ")", "{", "if", "(", "empty", "(", "$", "this", "->", "xmlConfigFile", ")", "&&", "empty", "(", "$", "this", "->", "directory", ")", ")", "{", "$", "this", "->", "phpci", "->", "logFailure", "(", "'Neither configur...
Runs PHP Unit tests in a specified directory, optionally using specified config file(s).
[ "Runs", "PHP", "Unit", "tests", "in", "a", "specified", "directory", "optionally", "using", "specified", "config", "file", "(", "s", ")", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Plugin/PhpUnit.php#L143-L183
dancryer/PHPCI
PHPCI/Plugin/PhpUnit.php
PhpUnit.runConfigFile
protected function runConfigFile($configPath) { if (is_array($configPath)) { return $this->recurseArg($configPath, array($this, "runConfigFile")); } else { if ($this->runFrom) { $curdir = getcwd(); chdir($this->phpci->buildPath . DIRECTORY_SEPA...
php
protected function runConfigFile($configPath) { if (is_array($configPath)) { return $this->recurseArg($configPath, array($this, "runConfigFile")); } else { if ($this->runFrom) { $curdir = getcwd(); chdir($this->phpci->buildPath . DIRECTORY_SEPA...
[ "protected", "function", "runConfigFile", "(", "$", "configPath", ")", "{", "if", "(", "is_array", "(", "$", "configPath", ")", ")", "{", "return", "$", "this", "->", "recurseArg", "(", "$", "configPath", ",", "array", "(", "$", "this", ",", "\"runConfig...
Run the tests defined in a PHPUnit config file. @param $configPath @return bool|mixed
[ "Run", "the", "tests", "defined", "in", "a", "PHPUnit", "config", "file", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Plugin/PhpUnit.php#L190-L211
dancryer/PHPCI
PHPCI/Plugin/PhpUnit.php
PhpUnit.runDir
protected function runDir($directory) { if (is_array($directory)) { return $this->recurseArg($directory, array($this, "runDir")); } else { $curdir = getcwd(); chdir($this->phpci->buildPath); $phpunit = $this->phpci->findBinary('phpunit'); ...
php
protected function runDir($directory) { if (is_array($directory)) { return $this->recurseArg($directory, array($this, "runDir")); } else { $curdir = getcwd(); chdir($this->phpci->buildPath); $phpunit = $this->phpci->findBinary('phpunit'); ...
[ "protected", "function", "runDir", "(", "$", "directory", ")", "{", "if", "(", "is_array", "(", "$", "directory", ")", ")", "{", "return", "$", "this", "->", "recurseArg", "(", "$", "directory", ",", "array", "(", "$", "this", ",", "\"runDir\"", ")", ...
Run the PHPUnit tests in a specific directory or array of directories. @param $directory @return bool|mixed
[ "Run", "the", "PHPUnit", "tests", "in", "a", "specific", "directory", "or", "array", "of", "directories", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Plugin/PhpUnit.php#L218-L233
dancryer/PHPCI
PHPCI/Plugin/PhpTalLint.php
PhpTalLint.execute
public function execute() { $this->phpci->quiet = true; $this->phpci->logExecOutput(false); foreach ($this->directories as $dir) { $this->lintDirectory($dir); } $this->phpci->quiet = false; $this->phpci->logExecOutput(true); $errors = 0; ...
php
public function execute() { $this->phpci->quiet = true; $this->phpci->logExecOutput(false); foreach ($this->directories as $dir) { $this->lintDirectory($dir); } $this->phpci->quiet = false; $this->phpci->logExecOutput(true); $errors = 0; ...
[ "public", "function", "execute", "(", ")", "{", "$", "this", "->", "phpci", "->", "quiet", "=", "true", ";", "$", "this", "->", "phpci", "->", "logExecOutput", "(", "false", ")", ";", "foreach", "(", "$", "this", "->", "directories", "as", "$", "dir"...
Executes phptal lint
[ "Executes", "phptal", "lint" ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Plugin/PhpTalLint.php#L104-L142
dancryer/PHPCI
PHPCI/Plugin/PhpTalLint.php
PhpTalLint.lintItem
protected function lintItem($item, $itemPath) { $success = true; if ($item->isFile() && in_array(strtolower($item->getExtension()), $this->suffixes)) { if (!$this->lintFile($itemPath)) { $success = false; } } elseif ($item->isDir() && $this->recursive...
php
protected function lintItem($item, $itemPath) { $success = true; if ($item->isFile() && in_array(strtolower($item->getExtension()), $this->suffixes)) { if (!$this->lintFile($itemPath)) { $success = false; } } elseif ($item->isDir() && $this->recursive...
[ "protected", "function", "lintItem", "(", "$", "item", ",", "$", "itemPath", ")", "{", "$", "success", "=", "true", ";", "if", "(", "$", "item", "->", "isFile", "(", ")", "&&", "in_array", "(", "strtolower", "(", "$", "item", "->", "getExtension", "(...
Lint an item (file or directory) by calling the appropriate method. @param $item @param $itemPath @return bool
[ "Lint", "an", "item", "(", "file", "or", "directory", ")", "by", "calling", "the", "appropriate", "method", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Plugin/PhpTalLint.php#L150-L163
dancryer/PHPCI
PHPCI/Plugin/PhpTalLint.php
PhpTalLint.lintDirectory
protected function lintDirectory($path) { $success = true; $directory = new \DirectoryIterator($this->phpci->buildPath . $path); foreach ($directory as $item) { if ($item->isDot()) { continue; } $itemPath = $path . $item->getFilename(); ...
php
protected function lintDirectory($path) { $success = true; $directory = new \DirectoryIterator($this->phpci->buildPath . $path); foreach ($directory as $item) { if ($item->isDot()) { continue; } $itemPath = $path . $item->getFilename(); ...
[ "protected", "function", "lintDirectory", "(", "$", "path", ")", "{", "$", "success", "=", "true", ";", "$", "directory", "=", "new", "\\", "DirectoryIterator", "(", "$", "this", "->", "phpci", "->", "buildPath", ".", "$", "path", ")", ";", "foreach", ...
Run phptal lint against a directory of files. @param $path @return bool
[ "Run", "phptal", "lint", "against", "a", "directory", "of", "files", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Plugin/PhpTalLint.php#L170-L192
dancryer/PHPCI
PHPCI/Plugin/PhpTalLint.php
PhpTalLint.lintFile
protected function lintFile($path) { $success = true; list($suffixes, $tales) = $this->getFlags(); $lint = dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR; $lint .= 'vendor' . DIRECTORY_SEPARATOR . 'phptal' . DIRECTORY_SEPARATOR . ...
php
protected function lintFile($path) { $success = true; list($suffixes, $tales) = $this->getFlags(); $lint = dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR; $lint .= 'vendor' . DIRECTORY_SEPARATOR . 'phptal' . DIRECTORY_SEPARATOR . ...
[ "protected", "function", "lintFile", "(", "$", "path", ")", "{", "$", "success", "=", "true", ";", "list", "(", "$", "suffixes", ",", "$", "tales", ")", "=", "$", "this", "->", "getFlags", "(", ")", ";", "$", "lint", "=", "dirname", "(", "__FILE__"...
Run phptal lint against a specific file. @param $path @return bool
[ "Run", "phptal", "lint", "against", "a", "specific", "file", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Plugin/PhpTalLint.php#L199-L245
dancryer/PHPCI
PHPCI/Plugin/PhpTalLint.php
PhpTalLint.getFlags
protected function getFlags() { $tales = ''; if (!empty($this->tales)) { $tales = ' -i ' . $this->phpci->buildPath . $this->tales; } $suffixes = ''; if (count($this->suffixes)) { $suffixes = ' -e ' . implode(',', $this->suffixes); } r...
php
protected function getFlags() { $tales = ''; if (!empty($this->tales)) { $tales = ' -i ' . $this->phpci->buildPath . $this->tales; } $suffixes = ''; if (count($this->suffixes)) { $suffixes = ' -e ' . implode(',', $this->suffixes); } r...
[ "protected", "function", "getFlags", "(", ")", "{", "$", "tales", "=", "''", ";", "if", "(", "!", "empty", "(", "$", "this", "->", "tales", ")", ")", "{", "$", "tales", "=", "' -i '", ".", "$", "this", "->", "phpci", "->", "buildPath", ".", "$", ...
Process options and produce an arguments string for PHPTAL Lint. @return array
[ "Process", "options", "and", "produce", "an", "arguments", "string", "for", "PHPTAL", "Lint", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Plugin/PhpTalLint.php#L251-L264
dancryer/PHPCI
PHPCI/ProcessControl/WindowsProcessControl.php
WindowsProcessControl.isRunning
public function isRunning($pid) { $lastLine = exec(sprintf('tasklist /fi "PID eq %d" /nh /fo csv 2>nul:', $pid)); $record = str_getcsv($lastLine); return isset($record[1]) && intval($record[1]) === $pid; }
php
public function isRunning($pid) { $lastLine = exec(sprintf('tasklist /fi "PID eq %d" /nh /fo csv 2>nul:', $pid)); $record = str_getcsv($lastLine); return isset($record[1]) && intval($record[1]) === $pid; }
[ "public", "function", "isRunning", "(", "$", "pid", ")", "{", "$", "lastLine", "=", "exec", "(", "sprintf", "(", "'tasklist /fi \"PID eq %d\" /nh /fo csv 2>nul:'", ",", "$", "pid", ")", ")", ";", "$", "record", "=", "str_getcsv", "(", "$", "lastLine", ")", ...
Check if the process is running using the "tasklist" command. @param type $pid @return bool
[ "Check", "if", "the", "process", "is", "running", "using", "the", "tasklist", "command", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/ProcessControl/WindowsProcessControl.php#L25-L30
dancryer/PHPCI
PHPCI/Plugin/Env.php
Env.execute
public function execute() { $success = true; foreach ($this->env_vars as $key => $value) { if (is_numeric($key)) { // This allows the developer to specify env vars like " - FOO=bar" or " - FOO: bar" $env_var = is_array($value)? key($value).'='.current($val...
php
public function execute() { $success = true; foreach ($this->env_vars as $key => $value) { if (is_numeric($key)) { // This allows the developer to specify env vars like " - FOO=bar" or " - FOO: bar" $env_var = is_array($value)? key($value).'='.current($val...
[ "public", "function", "execute", "(", ")", "{", "$", "success", "=", "true", ";", "foreach", "(", "$", "this", "->", "env_vars", "as", "$", "key", "=>", "$", "value", ")", "{", "if", "(", "is_numeric", "(", "$", "key", ")", ")", "{", "// This allow...
Adds the specified environment variables to the builder environment
[ "Adds", "the", "specified", "environment", "variables", "to", "the", "builder", "environment" ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Plugin/Env.php#L44-L62
dancryer/PHPCI
PHPCI/Plugin/Util/ComposerPluginInformation.php
ComposerPluginInformation.loadPluginInfo
protected function loadPluginInfo() { if ($this->pluginInfo !== null) { return; } $this->pluginInfo = array(); foreach ($this->composerPackages as $package) { $this->addPluginsFromPackage($package); } }
php
protected function loadPluginInfo() { if ($this->pluginInfo !== null) { return; } $this->pluginInfo = array(); foreach ($this->composerPackages as $package) { $this->addPluginsFromPackage($package); } }
[ "protected", "function", "loadPluginInfo", "(", ")", "{", "if", "(", "$", "this", "->", "pluginInfo", "!==", "null", ")", "{", "return", ";", "}", "$", "this", "->", "pluginInfo", "=", "array", "(", ")", ";", "foreach", "(", "$", "this", "->", "compo...
Load a list of available plugins from the installed composer packages.
[ "Load", "a", "list", "of", "available", "plugins", "from", "the", "installed", "composer", "packages", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Plugin/Util/ComposerPluginInformation.php#L78-L87
dancryer/PHPCI
PHPCI/Plugin/Util/Factory.php
Factory.addConfigFromFile
public function addConfigFromFile($configPath) { // The file is expected to return a function which can // act on the pluginFactory to register any resources needed. if (file_exists($configPath)) { $configFunction = require($configPath); if (is_callable($configFunctio...
php
public function addConfigFromFile($configPath) { // The file is expected to return a function which can // act on the pluginFactory to register any resources needed. if (file_exists($configPath)) { $configFunction = require($configPath); if (is_callable($configFunctio...
[ "public", "function", "addConfigFromFile", "(", "$", "configPath", ")", "{", "// The file is expected to return a function which can", "// act on the pluginFactory to register any resources needed.", "if", "(", "file_exists", "(", "$", "configPath", ")", ")", "{", "$", "confi...
Trys to get a function from the file path specified. If the file returns a function then $this will be passed to it. This enables the config file to call any public methods. @param $configPath @return bool - true if the function exists else false.
[ "Trys", "to", "get", "a", "function", "from", "the", "file", "path", "specified", ".", "If", "the", "file", "returns", "a", "function", "then", "$this", "will", "be", "passed", "to", "it", ".", "This", "enables", "the", "config", "file", "to", "call", ...
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Plugin/Util/Factory.php#L51-L63
dancryer/PHPCI
PHPCI/Plugin/Util/Factory.php
Factory.buildPlugin
public function buildPlugin($className, $options = array()) { $this->currentPluginOptions = $options; $reflectedPlugin = new \ReflectionClass($className); if (!$reflectedPlugin->implementsInterface(self::INTERFACE_PHPCI_PLUGIN)) { throw new \InvalidArgumentException( ...
php
public function buildPlugin($className, $options = array()) { $this->currentPluginOptions = $options; $reflectedPlugin = new \ReflectionClass($className); if (!$reflectedPlugin->implementsInterface(self::INTERFACE_PHPCI_PLUGIN)) { throw new \InvalidArgumentException( ...
[ "public", "function", "buildPlugin", "(", "$", "className", ",", "$", "options", "=", "array", "(", ")", ")", "{", "$", "this", "->", "currentPluginOptions", "=", "$", "options", ";", "$", "reflectedPlugin", "=", "new", "\\", "ReflectionClass", "(", "$", ...
Builds an instance of plugin of class $className. $options will be passed along with any resources registered with the factory. @param $className @param array|null $options @throws \InvalidArgumentException if $className doesn't represent a valid plugin @return \PHPCI\Plugin
[ "Builds", "an", "instance", "of", "plugin", "of", "class", "$className", ".", "$options", "will", "be", "passed", "along", "with", "any", "resources", "registered", "with", "the", "factory", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Plugin/Util/Factory.php#L83-L108
dancryer/PHPCI
PHPCI/Plugin/Util/Factory.php
Factory.getInternalID
private function getInternalID($type = null, $name = null) { $type = $type ? : ""; $name = $name ? : ""; return $type . "-" . $name; }
php
private function getInternalID($type = null, $name = null) { $type = $type ? : ""; $name = $name ? : ""; return $type . "-" . $name; }
[ "private", "function", "getInternalID", "(", "$", "type", "=", "null", ",", "$", "name", "=", "null", ")", "{", "$", "type", "=", "$", "type", "?", ":", "\"\"", ";", "$", "name", "=", "$", "name", "?", ":", "\"\"", ";", "return", "$", "type", "...
Get an internal resource ID. @param null $type @param null $name @return string
[ "Get", "an", "internal", "resource", "ID", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Plugin/Util/Factory.php#L145-L150
dancryer/PHPCI
PHPCI/Model/Build/MercurialBuild.php
MercurialBuild.createWorkingCopy
public function createWorkingCopy(Builder $builder, $buildPath) { $key = trim($this->getProject()->getSshPublicKey()); if (!empty($key) && strpos($this->getProject()->getReference(), 'ssh') > -1) { $success = $this->cloneBySsh($builder, $buildPath); } else { $success...
php
public function createWorkingCopy(Builder $builder, $buildPath) { $key = trim($this->getProject()->getSshPublicKey()); if (!empty($key) && strpos($this->getProject()->getReference(), 'ssh') > -1) { $success = $this->cloneBySsh($builder, $buildPath); } else { $success...
[ "public", "function", "createWorkingCopy", "(", "Builder", "$", "builder", ",", "$", "buildPath", ")", "{", "$", "key", "=", "trim", "(", "$", "this", "->", "getProject", "(", ")", "->", "getSshPublicKey", "(", ")", ")", ";", "if", "(", "!", "empty", ...
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/MercurialBuild.php#L34-L50
dancryer/PHPCI
PHPCI/Model/Build/MercurialBuild.php
MercurialBuild.cloneByHttp
protected function cloneByHttp(Builder $builder, $cloneTo) { return $builder->executeCommand('hg clone %s "%s" -r %s', $this->getCloneUrl(), $cloneTo, $this->getBranch()); }
php
protected function cloneByHttp(Builder $builder, $cloneTo) { return $builder->executeCommand('hg clone %s "%s" -r %s', $this->getCloneUrl(), $cloneTo, $this->getBranch()); }
[ "protected", "function", "cloneByHttp", "(", "Builder", "$", "builder", ",", "$", "cloneTo", ")", "{", "return", "$", "builder", "->", "executeCommand", "(", "'hg clone %s \"%s\" -r %s'", ",", "$", "this", "->", "getCloneUrl", "(", ")", ",", "$", "cloneTo", ...
Use a HTTP-based Mercurial clone.
[ "Use", "a", "HTTP", "-", "based", "Mercurial", "clone", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Model/Build/MercurialBuild.php#L55-L58
dancryer/PHPCI
PHPCI/Model/Build/MercurialBuild.php
MercurialBuild.cloneBySsh
protected function cloneBySsh(Builder $builder, $cloneTo) { $keyFile = $this->writeSshKey(); // Do the git clone: $cmd = 'hg clone --ssh "ssh -i '.$keyFile.'" %s "%s"'; $success = $builder->executeCommand($cmd, $this->getCloneUrl(), $cloneTo); if ($success) { $s...
php
protected function cloneBySsh(Builder $builder, $cloneTo) { $keyFile = $this->writeSshKey(); // Do the git clone: $cmd = 'hg clone --ssh "ssh -i '.$keyFile.'" %s "%s"'; $success = $builder->executeCommand($cmd, $this->getCloneUrl(), $cloneTo); if ($success) { $s...
[ "protected", "function", "cloneBySsh", "(", "Builder", "$", "builder", ",", "$", "cloneTo", ")", "{", "$", "keyFile", "=", "$", "this", "->", "writeSshKey", "(", ")", ";", "// Do the git clone:", "$", "cmd", "=", "'hg clone --ssh \"ssh -i '", ".", "$", "keyF...
Use an SSH-based Mercurial clone.
[ "Use", "an", "SSH", "-", "based", "Mercurial", "clone", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Model/Build/MercurialBuild.php#L63-L78
dancryer/PHPCI
PHPCI/Model/Build/MercurialBuild.php
MercurialBuild.postCloneSetup
protected function postCloneSetup(Builder $builder, $cloneTo) { $success = true; $commit = $this->getCommitId(); // Allow switching to a specific branch: if (!empty($commit) && $commit != 'Manual') { $cmd = 'cd "%s" && hg checkout %s'; $success = $builder->ex...
php
protected function postCloneSetup(Builder $builder, $cloneTo) { $success = true; $commit = $this->getCommitId(); // Allow switching to a specific branch: if (!empty($commit) && $commit != 'Manual') { $cmd = 'cd "%s" && hg checkout %s'; $success = $builder->ex...
[ "protected", "function", "postCloneSetup", "(", "Builder", "$", "builder", ",", "$", "cloneTo", ")", "{", "$", "success", "=", "true", ";", "$", "commit", "=", "$", "this", "->", "getCommitId", "(", ")", ";", "// Allow switching to a specific branch:", "if", ...
Handle post-clone tasks (switching branch, etc.) @param Builder $builder @param $cloneTo @return bool
[ "Handle", "post", "-", "clone", "tasks", "(", "switching", "branch", "etc", ".", ")" ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Model/Build/MercurialBuild.php#L86-L98
dancryer/PHPCI
PHPCI/Plugin/Email.php
Email.execute
public function execute() { $addresses = $this->getEmailAddresses(); // Without some email addresses in the yml file then we // can't do anything. if (count($addresses) == 0) { return false; } $buildStatus = $this->build->isSuccessful() ? "Passing Build...
php
public function execute() { $addresses = $this->getEmailAddresses(); // Without some email addresses in the yml file then we // can't do anything. if (count($addresses) == 0) { return false; } $buildStatus = $this->build->isSuccessful() ? "Passing Build...
[ "public", "function", "execute", "(", ")", "{", "$", "addresses", "=", "$", "this", "->", "getEmailAddresses", "(", ")", ";", "// Without some email addresses in the yml file then we", "// can't do anything.", "if", "(", "count", "(", "$", "addresses", ")", "==", ...
Send a notification mail.
[ "Send", "a", "notification", "mail", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Plugin/Email.php#L63-L106
dancryer/PHPCI
PHPCI/Plugin/Email.php
Email.sendSeparateEmails
public function sendSeparateEmails(array $toAddresses, $subject, $body) { $failures = 0; $ccList = $this->getCcAddresses(); foreach ($toAddresses as $address) { if (!$this->sendEmail($address, $ccList, $subject, $body)) { $failures++; } } ...
php
public function sendSeparateEmails(array $toAddresses, $subject, $body) { $failures = 0; $ccList = $this->getCcAddresses(); foreach ($toAddresses as $address) { if (!$this->sendEmail($address, $ccList, $subject, $body)) { $failures++; } } ...
[ "public", "function", "sendSeparateEmails", "(", "array", "$", "toAddresses", ",", "$", "subject", ",", "$", "body", ")", "{", "$", "failures", "=", "0", ";", "$", "ccList", "=", "$", "this", "->", "getCcAddresses", "(", ")", ";", "foreach", "(", "$", ...
Send an email to a list of specified subjects. @param array $toAddresses List of destination addresses for message. @param string $subject Mail subject @param string $body Mail body @return int number of failed messages
[ "Send", "an", "email", "to", "a", "list", "of", "specified", "subjects", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Plugin/Email.php#L145-L156
dancryer/PHPCI
PHPCI/Plugin/Email.php
Email.getEmailAddresses
protected function getEmailAddresses() { $addresses = array(); $committer = $this->build->getCommitterEmail(); if (isset($this->options['committer']) && !empty($committer)) { $addresses[] = $committer; } if (isset($this->options['addresses'])) { fore...
php
protected function getEmailAddresses() { $addresses = array(); $committer = $this->build->getCommitterEmail(); if (isset($this->options['committer']) && !empty($committer)) { $addresses[] = $committer; } if (isset($this->options['addresses'])) { fore...
[ "protected", "function", "getEmailAddresses", "(", ")", "{", "$", "addresses", "=", "array", "(", ")", ";", "$", "committer", "=", "$", "this", "->", "build", "->", "getCommitterEmail", "(", ")", ";", "if", "(", "isset", "(", "$", "this", "->", "option...
Get the list of email addresses to send to. @return array
[ "Get", "the", "list", "of", "email", "addresses", "to", "send", "to", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Plugin/Email.php#L162-L182
dancryer/PHPCI
PHPCI/Plugin/Email.php
Email.getCcAddresses
protected function getCcAddresses() { $ccAddresses = array(); if (isset($this->options['cc'])) { foreach ($this->options['cc'] as $address) { $ccAddresses[] = $address; } } return $ccAddresses; }
php
protected function getCcAddresses() { $ccAddresses = array(); if (isset($this->options['cc'])) { foreach ($this->options['cc'] as $address) { $ccAddresses[] = $address; } } return $ccAddresses; }
[ "protected", "function", "getCcAddresses", "(", ")", "{", "$", "ccAddresses", "=", "array", "(", ")", ";", "if", "(", "isset", "(", "$", "this", "->", "options", "[", "'cc'", "]", ")", ")", "{", "foreach", "(", "$", "this", "->", "options", "[", "'...
Get the list of email addresses to CC. @return array
[ "Get", "the", "list", "of", "email", "addresses", "to", "CC", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Plugin/Email.php#L189-L200
dancryer/PHPCI
PHPCI/Plugin/Util/Executor.php
Executor.executePlugins
public function executePlugins(&$config, $stage) { $success = true; $pluginsToExecute = array(); // If we have global plugins to execute for this stage, add them to the list to be executed: if (array_key_exists($stage, $config) && is_array($config[$stage])) { $pluginsToE...
php
public function executePlugins(&$config, $stage) { $success = true; $pluginsToExecute = array(); // If we have global plugins to execute for this stage, add them to the list to be executed: if (array_key_exists($stage, $config) && is_array($config[$stage])) { $pluginsToE...
[ "public", "function", "executePlugins", "(", "&", "$", "config", ",", "$", "stage", ")", "{", "$", "success", "=", "true", ";", "$", "pluginsToExecute", "=", "array", "(", ")", ";", "// If we have global plugins to execute for this stage, add them to the list to be ex...
Execute a the appropriate set of plugins for a given build stage. @param array $config PHPCI configuration @param string $stage @return bool
[ "Execute", "a", "the", "appropriate", "set", "of", "plugins", "for", "a", "given", "build", "stage", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Plugin/Util/Executor.php#L50-L69
dancryer/PHPCI
PHPCI/Plugin/Util/Executor.php
Executor.getBranchSpecificPlugins
protected function getBranchSpecificPlugins(&$config, $stage, $pluginsToExecute) { /** @var \PHPCI\Model\Build $build */ $build = $this->pluginFactory->getResourceFor('PHPCI\Model\Build'); $branch = $build->getBranch(); // If we don't have any branch-specific plugins: if (!i...
php
protected function getBranchSpecificPlugins(&$config, $stage, $pluginsToExecute) { /** @var \PHPCI\Model\Build $build */ $build = $this->pluginFactory->getResourceFor('PHPCI\Model\Build'); $branch = $build->getBranch(); // If we don't have any branch-specific plugins: if (!i...
[ "protected", "function", "getBranchSpecificPlugins", "(", "&", "$", "config", ",", "$", "stage", ",", "$", "pluginsToExecute", ")", "{", "/** @var \\PHPCI\\Model\\Build $build */", "$", "build", "=", "$", "this", "->", "pluginFactory", "->", "getResourceFor", "(", ...
Check the config for any plugins specific to the branch we're currently building. @param $config @param $stage @param $pluginsToExecute @return array
[ "Check", "the", "config", "for", "any", "plugins", "specific", "to", "the", "branch", "we", "re", "currently", "building", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Plugin/Util/Executor.php#L78-L122
dancryer/PHPCI
PHPCI/Plugin/Util/Executor.php
Executor.doExecutePlugins
protected function doExecutePlugins(&$plugins, $stage) { $success = true; foreach ($plugins as $plugin => $options) { $this->logger->log(Lang::get('running_plugin', $plugin)); $this->setPluginStatus($stage, $plugin, Build::STATUS_RUNNING); // Try and execute it...
php
protected function doExecutePlugins(&$plugins, $stage) { $success = true; foreach ($plugins as $plugin => $options) { $this->logger->log(Lang::get('running_plugin', $plugin)); $this->setPluginStatus($stage, $plugin, Build::STATUS_RUNNING); // Try and execute it...
[ "protected", "function", "doExecutePlugins", "(", "&", "$", "plugins", ",", "$", "stage", ")", "{", "$", "success", "=", "true", ";", "foreach", "(", "$", "plugins", "as", "$", "plugin", "=>", "$", "options", ")", "{", "$", "this", "->", "logger", "-...
Execute the list of plugins found for a given testing stage. @param $plugins @param $stage @return bool @throws \Exception
[ "Execute", "the", "list", "of", "plugins", "found", "for", "a", "given", "testing", "stage", "." ]
train
https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Plugin/Util/Executor.php#L131-L165