Merge branch 'master' of github.com:Block8/PHPCI into feature/bootstrapv3
|
@ -65,7 +65,7 @@ class Application extends b8\Application
|
|||
$this->response->setContent('');
|
||||
} else {
|
||||
$this->response = new RedirectResponse($this->response);
|
||||
$this->response->setHeader('Location', '/session/login');
|
||||
$this->response->setHeader('Location', PHPCI_URL.'session/login');
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
|
@ -21,7 +21,7 @@ class SessionController extends \PHPCI\Controller
|
|||
{
|
||||
public function init()
|
||||
{
|
||||
$this->response->disableLayout();
|
||||
$this->response->disableLayout();
|
||||
$this->_userStore = b8\Store\Factory::getStore('User');
|
||||
}
|
||||
|
||||
|
@ -29,7 +29,7 @@ class SessionController extends \PHPCI\Controller
|
|||
* Handles user login (form and processing)
|
||||
*/
|
||||
public function login()
|
||||
{
|
||||
{
|
||||
if ($this->request->getMethod() == 'POST') {
|
||||
$user = $this->_userStore->getByEmail($this->getParam('email'));
|
||||
|
||||
|
@ -42,7 +42,7 @@ class SessionController extends \PHPCI\Controller
|
|||
|
||||
$form = new b8\Form();
|
||||
$form->setMethod('POST');
|
||||
$form->setAction('/session/login');
|
||||
$form->setAction(PHPCI_URL.'session/login');
|
||||
|
||||
$email = new b8\Form\Element\Email('email');
|
||||
$email->setLabel('Email Address');
|
||||
|
|
|
@ -129,7 +129,7 @@ class UserController extends \PHPCI\Controller
|
|||
{
|
||||
$form = new Form();
|
||||
$form->setMethod('POST');
|
||||
$form->setAction('/user/' . $type);
|
||||
$form->setAction(PHPCI_URL.'user/' . $type);
|
||||
$form->addField(new Form\Element\Csrf('csrf'));
|
||||
|
||||
$field = new Form\Element\Email('email');
|
||||
|
|
56
PHPCI/Plugin/Grunt.php
Normal file
|
@ -0,0 +1,56 @@
|
|||
<?php
|
||||
/**
|
||||
* PHPCI - Continuous Integration for PHP
|
||||
*
|
||||
* @copyright Copyright 2013, Block 8 Limited.
|
||||
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
|
||||
* @link http://www.phptesting.org/
|
||||
*/
|
||||
|
||||
namespace PHPCI\Plugin;
|
||||
|
||||
/**
|
||||
* Grunt Plugin - Provides access to grunt functionality.
|
||||
* @author Tobias Tom <t.tom@succont.de>
|
||||
* @package PHPCI
|
||||
* @subpackage Plugins
|
||||
*/
|
||||
class Grunt implements \PHPCI\Plugin
|
||||
{
|
||||
protected $directory;
|
||||
protected $task;
|
||||
protected $preferDist;
|
||||
protected $phpci;
|
||||
protected $grunt;
|
||||
protected $gruntfile;
|
||||
|
||||
public function __construct(\PHPCI\Builder $phpci, array $options = array())
|
||||
{
|
||||
$path = $phpci->buildPath;
|
||||
$this->phpci = $phpci;
|
||||
$this->directory = isset($options['directory']) ? $path . '/' . $options['directory'] : $path;
|
||||
$this->task = isset($options['task']) ? $options['task'] : null;
|
||||
$this->grunt = isset($options['grunt']) ? $options['grunt'] : 'grunt';
|
||||
$this->gruntfile = isset($options['gruntfile']) ? $options['gruntfile'] : 'Gruntfile.js';
|
||||
}
|
||||
|
||||
/**
|
||||
* Executes grunt and runs a specified command (e.g. install / update)
|
||||
*/
|
||||
public function execute()
|
||||
{
|
||||
// if npm does not work, we cannot use grunt, so we return false
|
||||
if ( !$this->phpci->executeCommand( 'cd %s && npm install', $this->directory ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// build the grunt command
|
||||
$cmd = 'cd %s && ' . $this->grunt;
|
||||
$cmd .= ' --no-color';
|
||||
$cmd .= ' --gruntfile %s';
|
||||
$cmd .= ' %s'; // the task that will be executed
|
||||
|
||||
// and execute it
|
||||
return $this->phpci->executeCommand($cmd, $this->directory, $this->gruntfile, $this->task);
|
||||
}
|
||||
}
|
|
@ -41,7 +41,8 @@ _**Please be aware that PHPCI is a beta-release project, so whilst it is very st
|
|||
####Installing from Github:
|
||||
* Step 1: `git clone https://github.com/Block8/PHPCI.git`
|
||||
* Step 2: `cd PHPCI`
|
||||
* Step 3: `chmod +x ./console && ./console phpci:install`
|
||||
* Step 3: `composer install`
|
||||
* Step 4: `chmod +x ./console && ./console phpci:install`
|
||||
* When prompted, enter your database host, username, password and the database name that PHPCI should use.
|
||||
* The script will attempt to create the database if it does not exist already.
|
||||
* If you intend to use the MySQL plugin to create / destroy databases, the user you entered above will need CREATE / DELETE permissions on the server.
|
||||
|
@ -51,7 +52,7 @@ _**Please be aware that PHPCI is a beta-release project, so whilst it is very st
|
|||
**Apache Example**:
|
||||
|
||||
RewriteEngine On
|
||||
RewriteBase /path-to-phpci
|
||||
RewriteBase /path-to-phpci/public
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteRule (.*)? index.php [L,E=PATH_INFO:/$1]
|
||||
|
@ -103,6 +104,8 @@ Similar to Travis CI, to support PHPCI in your project, you simply need to add a
|
|||
standard: "PSR2"
|
||||
php_cpd:
|
||||
allow_failures: true
|
||||
grunt:
|
||||
task: "build"
|
||||
|
||||
complete:
|
||||
mysql:
|
||||
|
|
11
console
|
@ -14,14 +14,9 @@ define('ENABLE_SHELL_PLUGIN', false);
|
|||
|
||||
// If this is the first time ./console has been run, we probably don't have Composer or any of our dependencies yet.
|
||||
// So we need to install and run Composer.
|
||||
if (!file_exists(PHPCI_DIR . 'vendor/autoload.php') || !file_exists(PHPCI_DIR . 'composer.phar')) {
|
||||
print 'INSTALLING: Composer' . PHP_EOL;
|
||||
file_put_contents(PHPCI_DIR . 'composerinstaller.php', file_get_contents('https://getcomposer.org/installer'));
|
||||
shell_exec('php ' . escapeshellarg(PHPCI_DIR . 'composerinstaller.php'));
|
||||
unlink(PHPCI_DIR . 'composerinstaller.php');
|
||||
|
||||
print 'RUNNING: Composer' . PHP_EOL;
|
||||
shell_exec('php '.escapeshellarg(PHPCI_DIR.'composer.phar').' install');
|
||||
if (!file_exists(PHPCI_DIR . 'vendor/autoload.php')) {
|
||||
file_put_contents('php://stderr', 'Please install PHPCI with "composer install" before using console');
|
||||
exit( 1 );
|
||||
}
|
||||
|
||||
require('bootstrap.php');
|
||||
|
|
|
@ -57,22 +57,22 @@ td .label { margin-right: 5px; }
|
|||
|
||||
.icon-build-ok
|
||||
{
|
||||
background: url('/assets/img/icon-build-ok.png') no-repeat top left;
|
||||
background: url('../img/icon-build-ok.png') no-repeat top left;
|
||||
}
|
||||
|
||||
.icon-build-failed
|
||||
{
|
||||
background: url('/assets/img/icon-build-failed.png') no-repeat top left;
|
||||
background: url('../img/icon-build-failed.png') no-repeat top left;
|
||||
}
|
||||
|
||||
.icon-build-pending
|
||||
{
|
||||
background: url('/assets/img/icon-build-pending.png') no-repeat top left;
|
||||
background: url('../img/icon-build-pending.png') no-repeat top left;
|
||||
}
|
||||
|
||||
.icon-build-running
|
||||
{
|
||||
background: url('/assets/img/icon-build-running.png') no-repeat top left;
|
||||
background: url('../img/icon-build-running.png') no-repeat top left;
|
||||
}
|
||||
|
||||
h3
|
Before Width: | Height: | Size: 2 KiB After Width: | Height: | Size: 2 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 8.6 KiB After Width: | Height: | Size: 8.6 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 282 B After Width: | Height: | Size: 282 B |
Before Width: | Height: | Size: 290 B After Width: | Height: | Size: 290 B |
Before Width: | Height: | Size: 292 B After Width: | Height: | Size: 292 B |
Before Width: | Height: | Size: 284 B After Width: | Height: | Size: 284 B |
|
@ -12,7 +12,7 @@ session_start();
|
|||
error_reporting(E_ALL);
|
||||
ini_set('display_errors', 'on');
|
||||
|
||||
require_once('bootstrap.php');
|
||||
require_once('../bootstrap.php');
|
||||
|
||||
$fc = new PHPCI\Application($config, new b8\Http\Request());
|
||||
print $fc->handleRequest();
|