Merging latest master

This commit is contained in:
Dan Cryer 2014-12-08 14:18:57 +00:00
commit 28d09275fd
83 changed files with 1283 additions and 69 deletions

View file

@ -43,6 +43,10 @@ class PluginController extends \PHPCI\Controller
protected $canInstall;
protected $composerPath;
/**
* List all enabled plugins, installed and recommend packages.
* @return string
*/
public function index()
{
$this->requireAdmin();
@ -69,6 +73,9 @@ class PluginController extends \PHPCI\Controller
return $this->view->render();
}
/**
* Remove a given package.
*/
public function remove()
{
$this->requireAdmin();
@ -88,6 +95,9 @@ class PluginController extends \PHPCI\Controller
die;
}
/**
* Install a given package.
*/
public function install()
{
$this->requireAdmin();
@ -103,6 +113,10 @@ class PluginController extends \PHPCI\Controller
die;
}
/**
* Get the json-decoded contents of the composer.json file.
* @return mixed
*/
protected function getComposerJson()
{
$json = file_get_contents(APPLICATION_PATH . 'composer.json');
@ -125,6 +139,11 @@ class PluginController extends \PHPCI\Controller
file_put_contents(APPLICATION_PATH . 'composer.json', $json);
}
/**
* Find a system binary.
* @param $binary
* @return null|string
*/
protected function findBinary($binary)
{
if (is_string($binary)) {
@ -153,6 +172,9 @@ class PluginController extends \PHPCI\Controller
return null;
}
/**
* Perform a search on packagist.org.
*/
public function packagistSearch()
{
$searchQuery = $this->getParam('q', '');
@ -163,6 +185,9 @@ class PluginController extends \PHPCI\Controller
die(json_encode($res['body']));
}
/**
* Look up available versions of a given package on packagist.org
*/
public function packagistVersions()
{
$name = $this->getParam('p', '');