Merge branch 'feature-console'
This commit is contained in:
commit
d73e6b0730
82
README.md
82
README.md
|
@ -15,6 +15,19 @@ PHP Censor
|
|||
|
||||
More [screenshots](docs/en/screenshots.md).
|
||||
|
||||
System requirements
|
||||
-------------------
|
||||
|
||||
* Unix-like OS (**Windows isn't supported**)
|
||||
|
||||
* PHP 5.6+ (with OpenSSL support and enabled functions: `exec()`, `shell_exec()` and `proc_open()`)
|
||||
|
||||
* Web-server (Nginx or Apache2)
|
||||
|
||||
* Database (MySQL/MariaDB or PostgreSQL)
|
||||
|
||||
* Beanstalkd queue (Optional)
|
||||
|
||||
Features
|
||||
--------
|
||||
|
||||
|
@ -67,46 +80,77 @@ complete:
|
|||
default_mailto_address: admin@php-censor.local
|
||||
```
|
||||
|
||||
More details about [configuring project](docs/en/config.md).
|
||||
More details about [configuring project](docs/en/configuring_project.md).
|
||||
|
||||
Installing
|
||||
----------
|
||||
|
||||
You will need PHP 5.6+ (with OpenSSL support and enabled functions: `exec()`, `shell_exec()` and `proc_open()`)
|
||||
with web-server (Nginx or Apache2), DB (MySQL/MariaDB or PostgreSQL) database and Composer.
|
||||
1. Go to the directory in which you want to install PHP Censor, for example: `/var/www`:
|
||||
|
||||
* Go to the directory in which you want to install PHP Censor, for example: `/var/www`;
|
||||
```bash
|
||||
cd /var/www
|
||||
```
|
||||
|
||||
* Download PHP Censor from this repository and unzip it (to `/var/www/php-censor.local` for example);
|
||||
2. Create project by Composer:
|
||||
|
||||
* Go to the PHP Censor directory: `cd /var/www/php-censor.local`;
|
||||
```bash
|
||||
composer create-project corpsee/php-censor php-censor.local --keep-vcs
|
||||
```
|
||||
|
||||
* Install dependencies using Composer: `composer install`;
|
||||
Or download [latest archive](https://github.com/corpsee/php-censor/releases/latest) from Github, unzip it and run
|
||||
`composer install`.
|
||||
|
||||
* Create empty database for application;
|
||||
3. Create empty database for application (Mysql/MariaDB or Postgres);
|
||||
|
||||
* Install Beanstalkd queue (`aptitude install beanstalkd`);
|
||||
4. Install Beanstalkd Queue (Optional, if you are going to use queue with Worker):
|
||||
|
||||
* Install PHP Censor itself: `./bin/console php-censor:install`;
|
||||
```bash
|
||||
aptitude install beanstalkd # For deb-based
|
||||
```
|
||||
|
||||
* [Add a virtual host to your web server](docs/en/virtual_host.md), pointing to the `public` directory within your new
|
||||
5. Install PHP Censor itself:
|
||||
|
||||
```bash
|
||||
cd ./php-censor.local
|
||||
|
||||
# Interactive installation
|
||||
./bin/console php-censor:install
|
||||
|
||||
# Non-interactive installation
|
||||
./bin/console php-censor:install --url='http://php-censor.local' --db-type=pgsql --db-host=localhost --db-name=php-censor --db-user=php-censor --db-password=php-censor --db-port=null --admin-name=admin --admin-password=admin --admin-email='admin@php-censor.local' --queue-use=1 --queue-host=localhost --queue-name=php-censor
|
||||
|
||||
# Non-interactive installation with prepared config.yml file
|
||||
./bin/console php-censor:install --config-from-file=yes --admin-name=admin --admin-password=admin --admin-email='admin@php-censor.local'
|
||||
```
|
||||
|
||||
6. [Add a virtual host to your web server](docs/en/virtual_host.md), pointing to the `public` directory within your new
|
||||
PHP Censor directory. You'll need to set up rewrite rules to point all non-existent requests to PHP Censor;
|
||||
|
||||
* [Set up the PHP Censor Worker](docs/en/workers/worker.md), or [a cron-job](docs/en/workers/cron.md) to run PHP
|
||||
Censor builds;
|
||||
|
||||
More details about [installation](docs/en/installing.md).
|
||||
7. [Set up the PHP Censor Worker](docs/en/workers/worker.md) (Need configured Queue) or
|
||||
[a cron-job](docs/en/workers/cron.md) to run PHP Censor builds;
|
||||
|
||||
Updating
|
||||
--------
|
||||
|
||||
* Go to your PHP Censor directory (to `/var/www/php-censor.local` for example);
|
||||
1. Go to your PHP Censor directory (to `/var/www/php-censor.local` for example):
|
||||
|
||||
* Pull the latest code. This would look like this: `git pull`;
|
||||
```bash
|
||||
cd /var/www/php-censor.local
|
||||
```
|
||||
|
||||
* Update the PHP Censor database: `./bin/console php-censor-migrations:migrate`;
|
||||
2. Pull the latest code by Git:
|
||||
|
||||
* Update the Composer dependencies: `composer install`
|
||||
```bash
|
||||
git pull -r
|
||||
```
|
||||
|
||||
3. Update the Composer dependencies: `composer install`
|
||||
|
||||
4. Update the PHP Censor database scheme:
|
||||
|
||||
```bash
|
||||
./bin/console php-censor-migrations:migrate
|
||||
```
|
||||
|
||||
Migrations
|
||||
----------
|
||||
|
|
|
@ -1,44 +0,0 @@
|
|||
b8:
|
||||
database:
|
||||
servers:
|
||||
read:
|
||||
- host: localhost
|
||||
port: 3306
|
||||
write:
|
||||
- host: localhost
|
||||
port: 3306
|
||||
type: mysql
|
||||
name: php-censor-db
|
||||
username: php-censor-user
|
||||
password: php-censor-password
|
||||
php-censor:
|
||||
language: en
|
||||
per_page: 10
|
||||
url: 'http://php-censor.local'
|
||||
email_settings:
|
||||
from_address: 'no-reply@php-censor.local'
|
||||
smtp_address:
|
||||
queue:
|
||||
host: localhost
|
||||
name: php-censor-queue
|
||||
lifetime: 600
|
||||
github:
|
||||
token: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
|
||||
comments:
|
||||
commit: false
|
||||
pull_request: false
|
||||
build:
|
||||
remove_builds: true
|
||||
security:
|
||||
disable_auth: false
|
||||
default_user_id: 1
|
||||
auth_providers:
|
||||
internal:
|
||||
type: internal
|
||||
ldap:
|
||||
type: ldap
|
||||
data:
|
||||
host: 'ldap.php-censor.local'
|
||||
port: 389
|
||||
base_dn: 'dc=php-censor,dc=local'
|
||||
mail_attribute: mail
|
25
bin/console
25
bin/console
|
@ -9,34 +9,11 @@
|
|||
* @link http://www.phptesting.org/
|
||||
*/
|
||||
|
||||
use PHPCensor\Command\RunCommand;
|
||||
use PHPCensor\Command\RebuildCommand;
|
||||
use PHPCensor\Command\InstallCommand;
|
||||
use PHPCensor\Command\PollCommand;
|
||||
use PHPCensor\Command\CreateAdminCommand;
|
||||
use PHPCensor\Command\CreateBuildCommand;
|
||||
use PHPCensor\Command\WorkerCommand;
|
||||
use PHPCensor\Command\RebuildQueueCommand;
|
||||
use PHPCensor\Service\BuildService;
|
||||
use b8\Store\Factory;
|
||||
use PHPCensor\Console\Application;
|
||||
|
||||
define('IS_CONSOLE', true);
|
||||
|
||||
error_reporting(-1);
|
||||
ini_set('display_errors', 1);
|
||||
|
||||
require_once(dirname(__DIR__) . '/bootstrap.php');
|
||||
|
||||
$application = new Application();
|
||||
|
||||
$application->add(new RunCommand($loggerConfig->getFor('RunCommand')));
|
||||
$application->add(new RebuildCommand($loggerConfig->getFor('RunCommand')));
|
||||
$application->add(new InstallCommand);
|
||||
$application->add(new PollCommand($loggerConfig->getFor('PollCommand')));
|
||||
$application->add(new CreateAdminCommand(Factory::getStore('User')));
|
||||
$application->add(new CreateBuildCommand(Factory::getStore('Project'), new BuildService(Factory::getStore('Build'))));
|
||||
$application->add(new WorkerCommand($loggerConfig->getFor('WorkerCommand')));
|
||||
$application->add(new RebuildQueueCommand($loggerConfig->getFor('RebuildQueueCommand')));
|
||||
|
||||
$application->run();
|
||||
(new Application())->run();
|
||||
|
|
|
@ -7,8 +7,6 @@
|
|||
* @link http://www.phptesting.org/
|
||||
*/
|
||||
|
||||
use PHPCensor\Logging\LoggerConfig;
|
||||
|
||||
if (!defined('ROOT_DIR')) {
|
||||
define('ROOT_DIR', __DIR__ . DIRECTORY_SEPARATOR);
|
||||
}
|
||||
|
@ -33,16 +31,8 @@ if (!defined('RUNTIME_DIR')) {
|
|||
define('RUNTIME_DIR', ROOT_DIR . 'runtime' . DIRECTORY_SEPARATOR);
|
||||
}
|
||||
|
||||
if (!defined('IS_WIN')) {
|
||||
define('IS_WIN', ((strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') ? true : false));
|
||||
}
|
||||
|
||||
require_once(ROOT_DIR . 'vendor/autoload.php');
|
||||
|
||||
if (defined('IS_CONSOLE') && IS_CONSOLE) {
|
||||
$loggerConfig = LoggerConfig::newFromFile(APP_DIR . "loggerconfig.php");
|
||||
}
|
||||
|
||||
// Load configuration if present:
|
||||
$conf = [];
|
||||
$conf['b8']['app']['namespace'] = 'PHPCensor';
|
||||
|
@ -60,8 +50,4 @@ if (!defined('APP_URL') && !empty($config)) {
|
|||
define('APP_URL', $config->get('php-censor.url', '') . '/');
|
||||
}
|
||||
|
||||
if (!defined('IS_CONSOLE')) {
|
||||
define('IS_CONSOLE', false);
|
||||
}
|
||||
|
||||
\PHPCensor\Helper\Lang::init($config);
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
{
|
||||
"name": "corpsee/php-censor",
|
||||
"description": "PHP Censor is a fork of PHPCI and is a open source continuous integration tool specifically designed for PHP",
|
||||
"description": "PHP Censor is a open source self-hosted continuous integration server for PHP projects (Fork of PHPCI)",
|
||||
"minimum-stability": "stable",
|
||||
"type": "application",
|
||||
"keywords": ["php", "php-censor", "ci", "continuous integration"],
|
||||
"keywords": ["php", "php-censor", "phpci", "ci-server", "testing", "self-hosted", "open-source", "ci", "continuous integration"],
|
||||
"homepage": "https://github.com/corpsee/php-censor",
|
||||
"license": "BSD-2-Clause",
|
||||
"authors": [
|
||||
|
@ -37,8 +37,12 @@
|
|||
}
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.6.0",
|
||||
"ext-pdo": "*",
|
||||
"php": ">=5.6.0",
|
||||
"ext-openssl": "*",
|
||||
"ext-pdo": "*",
|
||||
"ext-json": "*",
|
||||
"ext-xml": "*",
|
||||
"ext-curl": "*",
|
||||
|
||||
"swiftmailer/swiftmailer": "5.4.*",
|
||||
"symfony/yaml": "2.8.*",
|
||||
|
|
22
composer.lock
generated
22
composer.lock
generated
|
@ -4,7 +4,7 @@
|
|||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "991c7a5bd9a73001129408ff55f5a8f1",
|
||||
"content-hash": "147a1f73282f1c309c8f85a4e9d3bbac",
|
||||
"packages": [
|
||||
{
|
||||
"name": "bower-asset/admin-lte",
|
||||
|
@ -1695,16 +1695,16 @@
|
|||
},
|
||||
{
|
||||
"name": "phpunit/phpunit",
|
||||
"version": "5.7.9",
|
||||
"version": "5.7.10",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/phpunit.git",
|
||||
"reference": "69f832b87c731d5cacad7f91948778fe98335fdd"
|
||||
"reference": "bf0804199f516fe80ffcc48ac6d4741c49baeb6e"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/69f832b87c731d5cacad7f91948778fe98335fdd",
|
||||
"reference": "69f832b87c731d5cacad7f91948778fe98335fdd",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/bf0804199f516fe80ffcc48ac6d4741c49baeb6e",
|
||||
"reference": "bf0804199f516fe80ffcc48ac6d4741c49baeb6e",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -1721,11 +1721,11 @@
|
|||
"phpunit/php-text-template": "~1.2",
|
||||
"phpunit/php-timer": "^1.0.6",
|
||||
"phpunit/phpunit-mock-objects": "^3.2",
|
||||
"sebastian/comparator": "~1.2.2",
|
||||
"sebastian/comparator": "^1.2.4",
|
||||
"sebastian/diff": "~1.2",
|
||||
"sebastian/environment": "^1.3.4 || ^2.0",
|
||||
"sebastian/exporter": "~2.0",
|
||||
"sebastian/global-state": "^1.0 || ^2.0",
|
||||
"sebastian/global-state": "^1.1",
|
||||
"sebastian/object-enumerator": "~2.0",
|
||||
"sebastian/resource-operations": "~1.0",
|
||||
"sebastian/version": "~1.0|~2.0",
|
||||
|
@ -1773,7 +1773,7 @@
|
|||
"testing",
|
||||
"xunit"
|
||||
],
|
||||
"time": "2017-01-28T06:14:33+00:00"
|
||||
"time": "2017-02-04T09:03:53+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpunit/phpunit-mock-objects",
|
||||
|
@ -2767,7 +2767,11 @@
|
|||
"prefer-lowest": false,
|
||||
"platform": {
|
||||
"php": ">=5.6.0",
|
||||
"ext-pdo": "*"
|
||||
"ext-openssl": "*",
|
||||
"ext-pdo": "*",
|
||||
"ext-json": "*",
|
||||
"ext-xml": "*",
|
||||
"ext-curl": "*"
|
||||
},
|
||||
"platform-dev": []
|
||||
}
|
||||
|
|
|
@ -4,13 +4,13 @@ PHP Censor documentation
|
|||
Getting Started
|
||||
---------------
|
||||
|
||||
* [Installing PHP Censor](installing.md)
|
||||
* Installing PHP Censor (See [README](../../README.md))
|
||||
* [Adding a Virtual Host](virtual_host.md)
|
||||
* [Run builds using a worker](workers/worker.md)
|
||||
* [Run builds using cronjob](workers/cron.md)
|
||||
* [Adding PHP Censor Support to Your Projects](config.md)
|
||||
* [Adding PHP Censor Support to Your Projects](configuring_project.md)
|
||||
* [Setting up Logging](logging.md)
|
||||
* [Updating PHP Censor](updating.md)
|
||||
* Updating PHP Censor (See [README](../../README.md))
|
||||
* [Configuring PHP Censor](configuring.md)
|
||||
|
||||
Using PHP Censor
|
||||
|
|
|
@ -1,62 +0,0 @@
|
|||
Adding PHP Censor Support to Your Projects
|
||||
==========================================
|
||||
|
||||
Similar to Travis CI, to support PHP Censor in your project, you simply need to add a `.php-censor.yml` (`phpci.yml`/`.phpci.yml` for backward compatibility with PHPCI) file to the root of
|
||||
your repository. The file should look something like this:
|
||||
|
||||
```yml
|
||||
build_settings:
|
||||
clone_depth: 1 # depth of 1 is a shallow clone, remove this line to clone entire repo
|
||||
ignore:
|
||||
- "vendor"
|
||||
- "tests"
|
||||
mysql:
|
||||
host: "localhost"
|
||||
user: "root"
|
||||
pass: ""
|
||||
|
||||
setup:
|
||||
mysql:
|
||||
- "DROP DATABASE IF EXISTS test;"
|
||||
- "CREATE DATABASE test;"
|
||||
- "GRANT ALL PRIVILEGES ON test.* TO test@'localhost' IDENTIFIED BY 'test';"
|
||||
composer:
|
||||
action: "install"
|
||||
|
||||
test:
|
||||
php_unit:
|
||||
config:
|
||||
- "PHPUnit-all.xml"
|
||||
- "PHPUnit-ubuntu-fix.xml"
|
||||
directory:
|
||||
- "tests/"
|
||||
run_from: "phpunit/"
|
||||
coverage: "tests/logs/coverage"
|
||||
php_mess_detector:
|
||||
allow_failures: true
|
||||
php_code_sniffer:
|
||||
standard: "PSR2"
|
||||
php_cpd:
|
||||
allow_failures: true
|
||||
grunt:
|
||||
task: "build"
|
||||
|
||||
complete:
|
||||
mysql:
|
||||
host: "localhost"
|
||||
user: "root"
|
||||
pass: ""
|
||||
- "DROP DATABASE IF EXISTS test;"
|
||||
```
|
||||
|
||||
As mentioned earlier, PHP Censor is powered by plugins, there are several phases in which plugins can be run:
|
||||
|
||||
* `setup` - This phase is designed to initialise the build procedure.
|
||||
* `test` - The tests that should be run during the build. Plugins run during this phase will contribute to the success or failure of the build.
|
||||
* `complete` - Always called when the `test` phase completes, regardless of success or failure. **Note** that is you do any DB stuff here, you will need to add the DB credentials to this section as well, as it runs in a separate instance.
|
||||
* `success` - Called upon success of the `test` phase.
|
||||
* `failure` - Called upon failure of the `test` phase.
|
||||
* `fixed` - Called upon success of the `test` phase if the previous build of the branch was a success.
|
||||
* `broken` - Called upon failure of the `test` phase if the previous build of the branch was a failure.
|
||||
|
||||
The `ignore` section is merely an array of paths that should be ignored in all tests (where possible.)
|
|
@ -4,17 +4,56 @@ Configuring PHP Censor
|
|||
The PHP Censor configuration on the server is automatically generated into the `config.yml` file during installation.
|
||||
One might need to also edit the file manually.
|
||||
|
||||
For example, one could log into PHP Censor and go into the settings to disable it. But if you have already set up a
|
||||
username/password pair and have forgotten the password, and if the server is on a local network, and it's not sending
|
||||
the `forgot password` email, then editing the config file manually would be handy. To do so, just edit the `php-censor`
|
||||
section in the config file (which is in [yaml format](https://en.wikipedia.org/wiki/YAML)), and add
|
||||
There is `config.yml` example:
|
||||
|
||||
```yml
|
||||
b8:
|
||||
database:
|
||||
servers:
|
||||
read:
|
||||
- host: localhost
|
||||
port: 3306
|
||||
write:
|
||||
- host: localhost
|
||||
port: 3306
|
||||
type: mysql # Database type: "mysql" or "pgsql"
|
||||
name: php-censor-db
|
||||
username: php-censor-user
|
||||
password: php-censor-password
|
||||
php-censor:
|
||||
language: en
|
||||
per_page: 10
|
||||
url: 'http://php-censor.local'
|
||||
email_settings:
|
||||
from_address: 'no-reply@php-censor.local'
|
||||
smtp_address: null
|
||||
smtp_port: null
|
||||
smtp_username: null
|
||||
smtp_password: null
|
||||
smtp_encryption: false
|
||||
queue:
|
||||
use_queue: true
|
||||
host: localhost
|
||||
name: php-censor-queue
|
||||
lifetime: 600
|
||||
github:
|
||||
token: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
|
||||
comments:
|
||||
commit: false # This option allow/deny to post comments to Github commit
|
||||
pull_request: false # This option allow/deny to post comments to Github Pull Request
|
||||
build:
|
||||
remove_builds: true # This option allow/deny build cleaning
|
||||
security:
|
||||
disable_auth: true
|
||||
default_user_id: 1
|
||||
disable_auth: false # This option allows/deny you to disable authentication for PHP Censor
|
||||
default_user_id: 1 # Default user when authentication disabled
|
||||
auth_providers: # Authentication providers
|
||||
internal:
|
||||
type: internal # Default provider (PHP Censor internal authentication)
|
||||
ldap:
|
||||
type: ldap # Your LDAP provider
|
||||
data:
|
||||
host: 'ldap.php-censor.local'
|
||||
port: 389
|
||||
base_dn: 'dc=php-censor,dc=local'
|
||||
mail_attribute: mail
|
||||
```
|
||||
|
||||
where you can get the `default_user_id` by logging into the database and selecting your user ID from the `users` table in
|
||||
the PHP Censor database.
|
||||
|
|
75
docs/en/configuring_project.md
Normal file
75
docs/en/configuring_project.md
Normal file
|
@ -0,0 +1,75 @@
|
|||
Adding PHP Censor Support to Your Projects
|
||||
==========================================
|
||||
|
||||
Similar to Travis CI, to support PHP Censor in your project, you simply need to add a `.php-censor.yml`
|
||||
(`phpci.yml`/`.phpci.yml` for backward compatibility with PHPCI) file to the root of your repository. The file should
|
||||
look something like this:
|
||||
|
||||
```yml
|
||||
build_settings:
|
||||
clone_depth: 1 # depth of 1 is a shallow clone, remove this line to clone entire repo
|
||||
ignore:
|
||||
- "vendor"
|
||||
- "tests"
|
||||
mysql:
|
||||
host: "localhost"
|
||||
user: "root"
|
||||
pass: ""
|
||||
|
||||
setup:
|
||||
mysql:
|
||||
- "DROP DATABASE IF EXISTS test;"
|
||||
- "CREATE DATABASE test;"
|
||||
- "GRANT ALL PRIVILEGES ON test.* TO test@'localhost' IDENTIFIED BY 'test';"
|
||||
composer:
|
||||
action: "install"
|
||||
|
||||
test:
|
||||
php_unit:
|
||||
config:
|
||||
- "PHPUnit-all.xml"
|
||||
- "PHPUnit-ubuntu-fix.xml"
|
||||
directory:
|
||||
- "tests/"
|
||||
run_from: "phpunit/"
|
||||
coverage: "tests/logs/coverage"
|
||||
php_mess_detector:
|
||||
allow_failures: true
|
||||
php_code_sniffer:
|
||||
standard: "PSR2"
|
||||
php_cpd:
|
||||
allow_failures: true
|
||||
grunt:
|
||||
task: "build"
|
||||
|
||||
complete:
|
||||
mysql:
|
||||
host: "localhost"
|
||||
user: "root"
|
||||
pass: ""
|
||||
- "DROP DATABASE IF EXISTS test;"
|
||||
|
||||
branch-dev: # Branch-specific config (for "dev" branch)
|
||||
run-option: replace # "run-option" parameter can be set to 'replace', 'after' or 'before'
|
||||
test:
|
||||
grunt:
|
||||
task: "build-dev"
|
||||
```
|
||||
|
||||
As mentioned earlier, PHP Censor is powered by plugins, there are several phases in which plugins can be run:
|
||||
|
||||
* `setup` - This phase is designed to initialise the build procedure.
|
||||
|
||||
* `test` - The tests that should be run during the build. Plugins run during this phase will contribute to the success or failure of the build.
|
||||
|
||||
* `complete` - Always called when the `test` phase completes, regardless of success or failure. **Note** that is you do any DB stuff here, you will need to add the DB credentials to this section as well, as it runs in a separate instance.
|
||||
|
||||
* `success` - Called upon success of the `test` phase.
|
||||
|
||||
* `failure` - Called upon failure of the `test` phase.
|
||||
|
||||
* `fixed` - Called upon success of the `test` phase if the previous build of the branch was a success.
|
||||
|
||||
* `broken` - Called upon failure of the `test` phase if the previous build of the branch was a failure.
|
||||
|
||||
The `ignore` section is merely an array of paths that should be ignored in all tests (where possible).
|
|
@ -1,25 +0,0 @@
|
|||
Installing PHP Censor
|
||||
=====================
|
||||
|
||||
What you'll need
|
||||
----------------
|
||||
|
||||
* PHP 5.6.0+
|
||||
* A web server (Nginx or Apache)
|
||||
* [Composer](https://getcomposer.org/download/)
|
||||
* [Git](http://git-scm.com/downloads)
|
||||
* A DB server to connect to (MySQL/MariaDB or PostgreSQL).
|
||||
* The following functions need to be enabled: `exec()`, `shell_exec()` and `proc_open()` in php.ini.
|
||||
* PHP must have OpenSSL support enabled.
|
||||
|
||||
Installing PHP Censor Manually
|
||||
------------------------------
|
||||
|
||||
* Go to the directory in which you want to install PHP Censor, for example: `/var/www`
|
||||
* [Download PHP Censor](https://github.com/corpsee/php-censor/releases/latest) and unzip it.
|
||||
* Go to the PHP Censor directory: `cd /var/www/php-censor`
|
||||
* Install dependencies using Composer: `composer install`
|
||||
* Install PHP Censor itself: `./bin/console php-censor:install`
|
||||
* [Add a virtual host to your web server](virtual_host.md), pointing to the `public` directory within your new PHP
|
||||
Censor directory. You'll need to set up rewrite rules to point all non-existent requests to PHP Censor.
|
||||
* [Set up the PHP Censor Worker](workers/worker.md), or [a cron-job](workers/cron.md) to run PHP Censor builds.
|
|
@ -14,12 +14,11 @@ Configuration
|
|||
* **cc** - A list of addresses that will receive a copy of every emails sent.
|
||||
* **template** - The template to use, options are short and long. Default is short on success and long otherwise.
|
||||
|
||||
|
||||
**Note:** _This plugin will only work if you configured email settings during installation or configured them later in Admin Options > Settings > Email Settings_
|
||||
|
||||
### Examples
|
||||
|
||||
See [Adding PHP Censor Support to Your Projects](../config.md) for more information about how to configure plugins.
|
||||
See [Adding PHP Censor Support to Your Projects](../configuring_project.md) for more information about how to configure plugins.
|
||||
|
||||
Send an email to the committer as well as one@exameple.com if a build fails:
|
||||
```yml
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
Updating PHP Censor
|
||||
===================
|
||||
|
||||
Updating PHP Censor to the latest release, or even dev-master updates is something that will need to be done from time to time. Most of this may be self-explanatory, but for clarity and completeness, it should be added to the documentation.
|
||||
|
||||
1. Go to your PHP Censor root folder in a Terminal.
|
||||
2. Pull the latest code. This would look like this: `git pull`
|
||||
3. Update the PHP Censor database: `./bin/console php-censor-migrations:migrate`
|
||||
4. Update the composer and its packages: `composer self-update && composer update`
|
||||
5. Return to the PHP Censor admin screens and check your desired plugins are still installed correctly.
|
||||
7. Run a build to make sure everything is working as expected.
|
|
@ -31,7 +31,7 @@ var codeceptionPlugin = ActiveBuild.UiPlugin.extend({
|
|||
},
|
||||
|
||||
render: function() {
|
||||
return $('<table class="table" id="codeception-data">' +
|
||||
return $('<table class="table table-hover" id="codeception-data">' +
|
||||
'<thead>' +
|
||||
'<tr><th>'+Lang.get('codeception_suite')+'</th>' +
|
||||
'<th>'+Lang.get('codeception_feature')+'</th>' +
|
||||
|
|
|
@ -22,14 +22,14 @@ var phptalPlugin = ActiveBuild.UiPlugin.extend({
|
|||
},
|
||||
|
||||
render: function() {
|
||||
return $('<div class="table-responsive"><table class="table" id="phptal-data">' +
|
||||
return $('<table class="table table-hover" id="phptal-data">' +
|
||||
'<thead>' +
|
||||
'<tr>' +
|
||||
' <th>' + Lang.get('file') + '</th>' +
|
||||
' <th>' + Lang.get('line') + '</th>' +
|
||||
' <th>' + Lang.get('message') + '</th>' +
|
||||
'</tr>' +
|
||||
'</thead><tbody></tbody></table></div>');
|
||||
'</thead><tbody></tbody></table>');
|
||||
},
|
||||
|
||||
onUpdate: function(e) {
|
||||
|
|
|
@ -32,14 +32,14 @@ var phpunitPlugin = ActiveBuild.UiPlugin.extend({
|
|||
|
||||
render: function() {
|
||||
|
||||
return $('<div class="table-responsive"><table class="table" id="phpunit-data">' +
|
||||
return $('<table class="table table-hover" id="phpunit-data">' +
|
||||
'<thead>' +
|
||||
'<tr>' +
|
||||
'<th>'+Lang.get('status')+'</th>' +
|
||||
'<th>'+Lang.get('test_message')+'</th>' +
|
||||
'<th>'+Lang.get('trace')+'</th>' +
|
||||
'</tr>' +
|
||||
'</thead><tbody></tbody></table></div>');
|
||||
'</thead><tbody></tbody></table>');
|
||||
},
|
||||
|
||||
onUpdate: function(e) {
|
||||
|
|
|
@ -21,13 +21,13 @@ var SummaryPlugin = ActiveBuild.UiPlugin.extend({
|
|||
|
||||
render: function() {
|
||||
return $(
|
||||
'<div class="table-responsive"><table class="table" id="plugin-summary">' +
|
||||
'<table class="table table-hover" id="plugin-summary">' +
|
||||
'<thead><tr>' +
|
||||
'<th>'+Lang.get('stage')+'</th>' +
|
||||
'<th>'+Lang.get('plugin')+'</th>' +
|
||||
'<th>'+Lang.get('status')+'</th>' +
|
||||
'<th class="text-right">' + Lang.get('duration') + ' (' + Lang.get('seconds') + ')</th>' +
|
||||
'</tr></thead><tbody></tbody></table></div>'
|
||||
'</tr></thead><tbody></tbody></table>'
|
||||
);
|
||||
},
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ class Database extends \PDO
|
|||
|
||||
$dns = self::$details['type'] . ':host=' . $server['host'];
|
||||
if (isset($server['port'])) {
|
||||
$dns .= ';port=' . $server['port'];
|
||||
$dns .= ';port=' . (integer)$server['port'];
|
||||
}
|
||||
$dns .= ';dbname=' . self::$details['db'];
|
||||
|
||||
|
|
|
@ -113,11 +113,7 @@ class Builder implements LoggerAwareInterface
|
|||
$pluginFactory = $this->buildPluginFactory($build);
|
||||
$this->pluginExecutor = new Plugin\Util\Executor($pluginFactory, $this->buildLogger);
|
||||
|
||||
$executorClass = 'PHPCensor\Helper\UnixCommandExecutor';
|
||||
if (IS_WIN) {
|
||||
$executorClass = 'PHPCensor\Helper\WindowsCommandExecutor';
|
||||
}
|
||||
|
||||
$executorClass = 'PHPCensor\Helper\UnixCommandExecutor';
|
||||
$this->commandExecutor = new $executorClass(
|
||||
$this->buildLogger,
|
||||
ROOT_DIR,
|
||||
|
@ -190,7 +186,7 @@ class Builder implements LoggerAwareInterface
|
|||
|
||||
$previous_build = $this->build->getProject()->getPreviousBuild($this->build->getBranch());
|
||||
|
||||
$previous_state = Build::STATUS_NEW;
|
||||
$previous_state = Build::STATUS_PENDING;
|
||||
|
||||
if ($previous_build) {
|
||||
$previous_state = $previous_build->getStatus();
|
||||
|
@ -223,7 +219,7 @@ class Builder implements LoggerAwareInterface
|
|||
} else {
|
||||
$this->pluginExecutor->executePlugins($this->config, 'failure');
|
||||
|
||||
if ($previous_state == Build::STATUS_SUCCESS || $previous_state == Build::STATUS_NEW) {
|
||||
if ($previous_state == Build::STATUS_SUCCESS || $previous_state == Build::STATUS_PENDING) {
|
||||
$this->pluginExecutor->executePlugins($this->config, 'broken');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,16 +1,8 @@
|
|||
<?php
|
||||
/**
|
||||
* PHPCI - Continuous Integration for PHP
|
||||
*
|
||||
* @copyright Copyright 2014, Block 8 Limited.
|
||||
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
|
||||
* @link https://www.phptesting.org/
|
||||
*/
|
||||
|
||||
namespace PHPCensor\Command;
|
||||
|
||||
use PHPCensor\Service\UserService;
|
||||
use PHPCensor\Helper\Lang;
|
||||
use PHPCensor\Store\UserStore;
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
|
@ -21,9 +13,7 @@ use Symfony\Component\Console\Question\Question;
|
|||
/**
|
||||
* Create admin command - creates an admin user
|
||||
*
|
||||
* @author Wogan May (@woganmay)
|
||||
* @package PHPCI
|
||||
* @subpackage Console
|
||||
* @author Wogan May (@woganmay)
|
||||
*/
|
||||
class CreateAdminCommand extends Command
|
||||
{
|
||||
|
@ -46,7 +36,7 @@ class CreateAdminCommand extends Command
|
|||
{
|
||||
$this
|
||||
->setName('php-censor:create-admin')
|
||||
->setDescription(Lang::get('create_admin_user'));
|
||||
->setDescription('Create an admin user');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -61,30 +51,30 @@ class CreateAdminCommand extends Command
|
|||
/** @var $helper QuestionHelper */
|
||||
$helper = $this->getHelperSet()->get('question');
|
||||
|
||||
$question = new Question(Lang::get('enter_email'));
|
||||
$question = new Question('Admin email: ');
|
||||
$question->setValidator(function ($answer) {
|
||||
if (!filter_var($answer, FILTER_VALIDATE_EMAIL)) {
|
||||
throw new \InvalidArgumentException(Lang::get('must_be_valid_email'));
|
||||
throw new \InvalidArgumentException('Must be a valid email address.');
|
||||
}
|
||||
|
||||
return $answer;
|
||||
});
|
||||
$adminEmail = $helper->ask($input, $output, $question);
|
||||
|
||||
$question = new Question(Lang::get('enter_name'));
|
||||
$question = new Question('Admin name: ');
|
||||
$adminName = $helper->ask($input, $output, $question);
|
||||
|
||||
$question = new Question(Lang::get('enter_password'));
|
||||
$question = new Question('Admin password: ');
|
||||
$question->setHidden(true);
|
||||
$question->setHiddenFallback(false);
|
||||
|
||||
$adminPass = $helper->ask($input, $output, $question);
|
||||
|
||||
try {
|
||||
$userService->createUser($adminName, $adminEmail, $adminPass, true);
|
||||
$output->writeln(Lang::get('user_created'));
|
||||
$userService->createUser($adminName, $adminEmail, 'default', json_encode(['type' => 'internal']), $adminPass, true);
|
||||
$output->writeln('<info>User account created!</info>');
|
||||
} catch (\Exception $e) {
|
||||
$output->writeln(sprintf('<error>%s</error>', Lang::get('failed_to_create')));
|
||||
$output->writeln(sprintf('<error>%s</error>', 'PHP Censor failed to create your admin account.'));
|
||||
$output->writeln(sprintf('<error>%s</error>', $e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,15 +1,7 @@
|
|||
<?php
|
||||
/**
|
||||
* PHPCI - Continuous Integration for PHP
|
||||
*
|
||||
* @copyright Copyright 2014, Block 8 Limited.
|
||||
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
|
||||
* @link https://www.phptesting.org/
|
||||
*/
|
||||
|
||||
namespace PHPCensor\Command;
|
||||
|
||||
use PHPCensor\Helper\Lang;
|
||||
use PHPCensor\Service\BuildService;
|
||||
use PHPCensor\Store\ProjectStore;
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
|
@ -21,9 +13,7 @@ use Symfony\Component\Console\Output\OutputInterface;
|
|||
/**
|
||||
* Create build command - creates a build for a project
|
||||
*
|
||||
* @author Jérémy DECOOL (@jdecool)
|
||||
* @package PHPCI
|
||||
* @subpackage Console
|
||||
* @author Jérémy DECOOL (@jdecool)
|
||||
*/
|
||||
class CreateBuildCommand extends Command
|
||||
{
|
||||
|
@ -39,6 +29,7 @@ class CreateBuildCommand extends Command
|
|||
|
||||
/**
|
||||
* @param ProjectStore $projectStore
|
||||
* @param BuildService $buildService
|
||||
*/
|
||||
public function __construct(ProjectStore $projectStore, BuildService $buildService)
|
||||
{
|
||||
|
@ -55,10 +46,10 @@ class CreateBuildCommand extends Command
|
|||
{
|
||||
$this
|
||||
->setName('php-censor:create-build')
|
||||
->setDescription(Lang::get('create_build_project'))
|
||||
->addArgument('projectId', InputArgument::REQUIRED, Lang::get('project_id_argument'))
|
||||
->addOption('commit', null, InputOption::VALUE_OPTIONAL, Lang::get('commit_id_option'))
|
||||
->addOption('branch', null, InputOption::VALUE_OPTIONAL, Lang::get('branch_name_option'));
|
||||
->setDescription('Create a build for a project')
|
||||
->addArgument('projectId', InputArgument::REQUIRED, 'A project ID')
|
||||
->addOption('commit', null, InputOption::VALUE_OPTIONAL, 'Commit ID to build')
|
||||
->addOption('branch', null, InputOption::VALUE_OPTIONAL, 'Branch to build');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -77,9 +68,9 @@ class CreateBuildCommand extends Command
|
|||
|
||||
try {
|
||||
$this->buildService->createBuild($project, $commitId, $branch);
|
||||
$output->writeln(Lang::get('build_created'));
|
||||
$output->writeln('Build Created');
|
||||
} catch (\Exception $e) {
|
||||
$output->writeln(sprintf('<error>%s</error>', Lang::get('failed')));
|
||||
$output->writeln('<error>Failed</error>');
|
||||
$output->writeln(sprintf('<error>%s</error>', $e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,11 +1,4 @@
|
|||
<?php
|
||||
/**
|
||||
* PHPCI - Continuous Integration for PHP
|
||||
*
|
||||
* @copyright Copyright 2014, Block 8 Limited.
|
||||
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
|
||||
* @link https://www.phptesting.org/
|
||||
*/
|
||||
|
||||
namespace PHPCensor\Command;
|
||||
|
||||
|
@ -14,8 +7,8 @@ use PDO;
|
|||
|
||||
use b8\Config;
|
||||
use b8\Store\Factory;
|
||||
use PHPCensor\Helper\Lang;
|
||||
use PHPCensor\Model\ProjectGroup;
|
||||
use PHPCensor\Store\UserStore;
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Helper\QuestionHelper;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
|
@ -27,84 +20,80 @@ use Symfony\Component\Console\Question\ConfirmationQuestion;
|
|||
use Symfony\Component\Yaml\Dumper;
|
||||
|
||||
/**
|
||||
* Install console command - Installs PHPCI.
|
||||
* Install console command - Installs PHP Censor
|
||||
*
|
||||
* @author Dan Cryer <dan@block8.co.uk>
|
||||
* @package PHPCI
|
||||
* @subpackage Console
|
||||
* @author Dan Cryer <dan@block8.co.uk>
|
||||
*/
|
||||
class InstallCommand extends Command
|
||||
{
|
||||
protected $configFilePath;
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $configPath = APP_DIR . 'config.yml';
|
||||
|
||||
protected function configure()
|
||||
{
|
||||
$defaultPath = APP_DIR . 'config.yml';
|
||||
|
||||
$this
|
||||
->setName('php-censor:install')
|
||||
->addOption('url', null, InputOption::VALUE_OPTIONAL, Lang::get('installation_url'))
|
||||
->addOption('db-type', null, InputOption::VALUE_OPTIONAL, Lang::get('db_host'))
|
||||
->addOption('db-host', null, InputOption::VALUE_OPTIONAL, Lang::get('db_host'))
|
||||
->addOption('db-port', null, InputOption::VALUE_OPTIONAL, Lang::get('db_port'))
|
||||
->addOption('db-name', null, InputOption::VALUE_OPTIONAL, Lang::get('db_name'))
|
||||
->addOption('db-user', null, InputOption::VALUE_OPTIONAL, Lang::get('db_user'))
|
||||
->addOption('db-pass', null, InputOption::VALUE_OPTIONAL, Lang::get('db_pass'))
|
||||
->addOption('admin-name', null, InputOption::VALUE_OPTIONAL, Lang::get('admin_name'))
|
||||
->addOption('admin-pass', null, InputOption::VALUE_OPTIONAL, Lang::get('admin_pass'))
|
||||
->addOption('admin-mail', null, InputOption::VALUE_OPTIONAL, Lang::get('admin_email'))
|
||||
->addOption('config-path', null, InputOption::VALUE_OPTIONAL, Lang::get('config_path'), $defaultPath)
|
||||
->addOption('queue-disabled', null, InputOption::VALUE_NONE, 'Don\'t ask for queue details')
|
||||
->addOption('queue-server', null, InputOption::VALUE_OPTIONAL, 'Beanstalkd queue server hostname')
|
||||
->addOption('queue-name', null, InputOption::VALUE_OPTIONAL, 'Beanstalkd queue name')
|
||||
->setDescription(Lang::get('install_app'));
|
||||
|
||||
->addOption('url', null, InputOption::VALUE_OPTIONAL, 'PHP Censor installation URL')
|
||||
->addOption('db-type', null, InputOption::VALUE_OPTIONAL, 'Database type')
|
||||
->addOption('db-host', null, InputOption::VALUE_OPTIONAL, 'Database host')
|
||||
->addOption('db-port', null, InputOption::VALUE_OPTIONAL, 'Database port')
|
||||
->addOption('db-name', null, InputOption::VALUE_OPTIONAL, 'Database name')
|
||||
->addOption('db-user', null, InputOption::VALUE_OPTIONAL, 'Database user')
|
||||
->addOption('db-password', null, InputOption::VALUE_OPTIONAL, 'Database password')
|
||||
->addOption('admin-name', null, InputOption::VALUE_OPTIONAL, 'Admin name')
|
||||
->addOption('admin-password', null, InputOption::VALUE_OPTIONAL, 'Admin password')
|
||||
->addOption('admin-email', null, InputOption::VALUE_OPTIONAL, 'Admin email')
|
||||
->addOption('queue-use', null, InputOption::VALUE_OPTIONAL, 'Don\'t ask for queue details', true)
|
||||
->addOption('queue-host', null, InputOption::VALUE_OPTIONAL, 'Beanstalkd queue server hostname')
|
||||
->addOption('queue-name', null, InputOption::VALUE_OPTIONAL, 'Beanstalkd queue name')
|
||||
->addOption('config-from-file', null, InputOption::VALUE_OPTIONAL, 'Take config from file and ignore options', false)
|
||||
|
||||
->setDescription('Install PHP Censor');
|
||||
}
|
||||
|
||||
/**
|
||||
* Installs PHPCI - Can be run more than once as long as you ^C instead of entering an email address.
|
||||
* Installs PHP Censor
|
||||
*/
|
||||
protected function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
$this->configFilePath = $input->getOption('config-path');
|
||||
|
||||
if (!$this->verifyNotInstalled($output)) {
|
||||
$configFromFile = (boolean)$input->getOption('config-from-file');
|
||||
|
||||
if (!$configFromFile && !$this->verifyNotInstalled($output)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$output->writeln('');
|
||||
$output->writeln('<info>******************</info>');
|
||||
$output->writeln('<info> '.Lang::get('welcome_to_app').'</info>');
|
||||
$output->writeln('<info>******************</info>');
|
||||
$output->writeln('<info>***************************************</info>');
|
||||
$output->writeln('<info>* Welcome to PHP Censor installation *</info>');
|
||||
$output->writeln('<info>***************************************</info>');
|
||||
$output->writeln('');
|
||||
|
||||
$this->checkRequirements($output);
|
||||
|
||||
$output->writeln(Lang::get('please_answer'));
|
||||
$output->writeln('-------------------------------------');
|
||||
$output->writeln('');
|
||||
if (!$configFromFile) {
|
||||
$output->writeln('');
|
||||
$output->writeln('Please answer the following questions:');
|
||||
$output->writeln('--------------------------------------');
|
||||
$output->writeln('');
|
||||
|
||||
// ----
|
||||
// Get DB connection information and verify that it works:
|
||||
// ----
|
||||
$connectionVerified = false;
|
||||
$connectionVerified = false;
|
||||
while (!$connectionVerified) {
|
||||
$db = $this->getDatabaseInformation($input, $output);
|
||||
$connectionVerified = $this->verifyDatabaseDetails($db, $output);
|
||||
}
|
||||
$output->writeln('');
|
||||
|
||||
while (!$connectionVerified) {
|
||||
$db = $this->getDatabaseInformation($input, $output);
|
||||
$conf = [];
|
||||
$conf['b8']['database'] = $db;
|
||||
$conf['php-censor'] = $this->getConfigInformation($input, $output);
|
||||
|
||||
$connectionVerified = $this->verifyDatabaseDetails($db, $output);
|
||||
$this->writeConfigFile($conf);
|
||||
}
|
||||
|
||||
$output->writeln('');
|
||||
|
||||
$conf = [];
|
||||
$conf['b8']['database'] = $db;
|
||||
|
||||
// ----
|
||||
// Get basic installation details (URL, etc)
|
||||
// ----
|
||||
$conf['php-censor'] = $this->getConfigInformation($input, $output);
|
||||
|
||||
$this->writeConfigFile($conf);
|
||||
$this->reloadConfig();
|
||||
$this->setupDatabase($output);
|
||||
|
||||
$admin = $this->getAdminInformation($input, $output);
|
||||
|
@ -113,58 +102,69 @@ class InstallCommand extends Command
|
|||
$this->createDefaultGroup($output);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param OutputInterface $output
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function verifyNotInstalled(OutputInterface $output)
|
||||
{
|
||||
if (file_exists($this->configPath)) {
|
||||
$content = file_get_contents($this->configPath);
|
||||
|
||||
if (!empty($content)) {
|
||||
$output->writeln('<error>The PHP Censor config file exists and is not empty. PHP Censor is already installed!</error>');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check PHP version, required modules and for disabled functions.
|
||||
*
|
||||
* @param OutputInterface $output
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
protected function checkRequirements(OutputInterface $output)
|
||||
{
|
||||
$output->write('Checking requirements...');
|
||||
$output->writeln('Checking requirements...');
|
||||
$errors = false;
|
||||
|
||||
// Check PHP version:
|
||||
if (!(version_compare(PHP_VERSION, '5.4.0') >= 0)) {
|
||||
if (!(version_compare(PHP_VERSION, '5.6.0') >= 0)) {
|
||||
$output->writeln('');
|
||||
$output->writeln('<error>'.Lang::get('app_php_req').'</error>');
|
||||
$output->writeln('<error>PHP Censor requires at least PHP 5.6.0! Installed PHP ' . PHP_VERSION . '</error>');
|
||||
$errors = true;
|
||||
}
|
||||
|
||||
// Check required extensions are present:
|
||||
$requiredExtensions = ['PDO'];
|
||||
$requiredExtensions = ['PDO', 'xml', 'json', 'curl', 'openssl'];
|
||||
|
||||
foreach ($requiredExtensions as $extension) {
|
||||
if (!extension_loaded($extension)) {
|
||||
$output->writeln('');
|
||||
$output->writeln('<error>'.Lang::get('extension_required', $extension).'</error>');
|
||||
$output->writeln('<error>Extension required: ' . $extension . '</error>');
|
||||
$errors = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Check required functions are callable:
|
||||
$requiredFunctions = ['exec', 'shell_exec'];
|
||||
$requiredFunctions = ['exec', 'shell_exec', 'proc_open', 'password_hash'];
|
||||
|
||||
foreach ($requiredFunctions as $function) {
|
||||
if (!function_exists($function)) {
|
||||
$output->writeln('');
|
||||
$output->writeln('<error>'.Lang::get('function_required', $function).'</error>');
|
||||
$output->writeln('<error>PHP Censor needs to be able to call the ' . $function . '() function. Is it disabled in php.ini?</error>');
|
||||
$errors = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('password_hash')) {
|
||||
$output->writeln('');
|
||||
$output->writeln('<error>'.Lang::get('function_required', $function).'</error>');
|
||||
$errors = true;
|
||||
}
|
||||
|
||||
if ($errors) {
|
||||
throw new Exception(Lang::get('requirements_not_met'));
|
||||
throw new Exception('PHP Censor cannot be installed, as not all requirements are met. Please review the errors above before continuing.');
|
||||
}
|
||||
|
||||
$output->writeln(' <info>'.Lang::get('ok').'</info>');
|
||||
$output->writeln('');
|
||||
$output->writeln('<info>OK</info>');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -181,37 +181,37 @@ class InstallCommand extends Command
|
|||
/** @var $helper QuestionHelper */
|
||||
$helper = $this->getHelperSet()->get('question');
|
||||
|
||||
// Function to validate mail address.
|
||||
// Function to validate email address.
|
||||
$mailValidator = function ($answer) {
|
||||
if (!filter_var($answer, FILTER_VALIDATE_EMAIL)) {
|
||||
throw new \InvalidArgumentException(Lang::get('must_be_valid_email'));
|
||||
throw new \InvalidArgumentException('Must be a valid email address.');
|
||||
}
|
||||
|
||||
return $answer;
|
||||
};
|
||||
|
||||
if ($adminEmail = $input->getOption('admin-mail')) {
|
||||
if ($adminEmail = $input->getOption('admin-email')) {
|
||||
$adminEmail = $mailValidator($adminEmail);
|
||||
} else {
|
||||
$questionEmail = new Question(Lang::get('enter_email'));
|
||||
$questionEmail = new Question('Admin email: ');
|
||||
$adminEmail = $helper->ask($input, $output, $questionEmail);
|
||||
}
|
||||
|
||||
if (!$adminName = $input->getOption('admin-name')) {
|
||||
$questionName = new Question(Lang::get('admin_name'));
|
||||
$questionName = new Question('Admin name: ');
|
||||
$adminName = $helper->ask($input, $output, $questionName);
|
||||
}
|
||||
|
||||
if (!$adminPass = $input->getOption('admin-pass')) {
|
||||
$questionPass = new Question(Lang::get('enter_password'));
|
||||
if (!$adminPass = $input->getOption('admin-password')) {
|
||||
$questionPass = new Question('Admin password: ');
|
||||
$questionPass->setHidden(true);
|
||||
$questionPass->setHiddenFallback(false);
|
||||
$adminPass = $helper->ask($input, $output, $questionPass);
|
||||
}
|
||||
|
||||
$admin['mail'] = $adminEmail;
|
||||
$admin['name'] = $adminName;
|
||||
$admin['pass'] = $adminPass;
|
||||
$admin['email'] = $adminEmail;
|
||||
$admin['name'] = $adminName;
|
||||
$admin['password'] = $adminPass;
|
||||
|
||||
return $admin;
|
||||
}
|
||||
|
@ -219,20 +219,19 @@ class InstallCommand extends Command
|
|||
/**
|
||||
* Load configuration for PHPCI form CLI options or ask info to user.
|
||||
*
|
||||
* @param InputInterface $input
|
||||
* @param InputInterface $input
|
||||
* @param OutputInterface $output
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function getConfigInformation(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
$config = [];
|
||||
|
||||
/** @var $helper QuestionHelper */
|
||||
$helper = $this->getHelperSet()->get('question');
|
||||
|
||||
$urlValidator = function ($answer) {
|
||||
if (!filter_var($answer, FILTER_VALIDATE_URL)) {
|
||||
throw new Exception(Lang::get('must_be_valid_url'));
|
||||
throw new Exception('Must be a valid URL.');
|
||||
}
|
||||
|
||||
return rtrim($answer, '/');
|
||||
|
@ -241,61 +240,103 @@ class InstallCommand extends Command
|
|||
if ($url = $input->getOption('url')) {
|
||||
$url = $urlValidator($url);
|
||||
} else {
|
||||
$question = new Question(Lang::get('enter_app_url'));
|
||||
$question = new Question('Your PHP Censor URL ("http://php-censor.local" for example): ');
|
||||
$question->setValidator($urlValidator);
|
||||
$url = $helper->ask($input, $output, $question);
|
||||
}
|
||||
|
||||
$config['language'] = 'en';
|
||||
$config['per_page'] = 10;
|
||||
$queueConfig = $this->getQueueInformation($input, $output);
|
||||
|
||||
$config['url'] = $url;
|
||||
$config['queue'] = $this->getQueueInformation($input, $output, $helper);
|
||||
|
||||
return $config;
|
||||
return [
|
||||
'language' => 'en',
|
||||
'per_page' => 10,
|
||||
'url' => $url,
|
||||
'queue' => $queueConfig,
|
||||
'email_settings' => [
|
||||
'from_address' => 'no-reply@php-censor.local',
|
||||
'smtp_address' => null,
|
||||
'smtp_port' => null,
|
||||
'smtp_username' => null,
|
||||
'smtp_password' => null,
|
||||
'smtp_encryption' => false,
|
||||
],
|
||||
'github' => [
|
||||
'token' => null,
|
||||
'comments' => [
|
||||
'commit' => false,
|
||||
'pull_request' => false,
|
||||
],
|
||||
],
|
||||
'build' => [
|
||||
'remove_builds' => true,
|
||||
],
|
||||
'security' => [
|
||||
'disable_auth' => false,
|
||||
'default_user_id' => 1,
|
||||
'auth_providers' => [
|
||||
'default' => [
|
||||
'type' => 'internal',
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* If the user wants to use a queue, get the necessary details.
|
||||
*
|
||||
* @param InputInterface $input
|
||||
* @param OutputInterface $output
|
||||
* @param QuestionHelper $helper
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function getQueueInformation(InputInterface $input, OutputInterface $output, QuestionHelper $helper)
|
||||
protected function getQueueInformation(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
if ($input->getOption('queue-disabled')) {
|
||||
return null;
|
||||
$skipQueueConfig = [
|
||||
'use_queue' => false,
|
||||
'host' => null,
|
||||
'name' => null,
|
||||
'lifetime' => 600
|
||||
];
|
||||
|
||||
if (!$input->getOption('queue-use')) {
|
||||
return $skipQueueConfig;
|
||||
}
|
||||
|
||||
$rtn = [];
|
||||
$queueConfig = [
|
||||
'use_queue' => true,
|
||||
];
|
||||
|
||||
$helper = $this->getHelper('question');
|
||||
$question = new ConfirmationQuestion('Use beanstalkd to manage build queue? ', true);
|
||||
$queueConfig['host'] = $input->getOption('queue-host');
|
||||
$queueConfig['name'] = $input->getOption('queue-name');
|
||||
|
||||
if (!$helper->ask($input, $output, $question)) {
|
||||
$output->writeln('<error>Skipping beanstalkd configuration.</error>');
|
||||
return null;
|
||||
if (!$queueConfig['host'] && !$queueConfig['name']) {
|
||||
/** @var $helper QuestionHelper */
|
||||
$helper = $this->getHelper('question');
|
||||
$question = new ConfirmationQuestion('Use beanstalkd to manage build queue? ', false);
|
||||
|
||||
if (!$helper->ask($input, $output, $question)) {
|
||||
$output->writeln('<error>Skipping beanstalkd configuration.</error>');
|
||||
|
||||
return $skipQueueConfig;
|
||||
}
|
||||
|
||||
$questionQueue = new Question('Enter your beanstalkd hostname [localhost]: ', 'localhost');
|
||||
$queueConfig['host'] = $helper->ask($input, $output, $questionQueue);
|
||||
|
||||
$questionName = new Question('Enter the queue (tube) name to use [php-censor-queue]: ', 'php-censor-queue');
|
||||
$queueConfig['name'] = $helper->ask($input, $output, $questionName);
|
||||
}
|
||||
|
||||
if (!$rtn['host'] = $input->getOption('queue-server')) {
|
||||
$questionQueue = new Question('Enter your beanstalkd hostname [localhost]: ', 'localhost');
|
||||
$rtn['host'] = $helper->ask($input, $output, $questionQueue);
|
||||
}
|
||||
|
||||
if (!$rtn['name'] = $input->getOption('queue-name')) {
|
||||
$questionName = new Question('Enter the queue (tube) name to use [php-censor-queue]: ', 'php-censor-queue');
|
||||
$rtn['name'] = $helper->ask($input, $output, $questionName);
|
||||
}
|
||||
|
||||
return $rtn;
|
||||
return $queueConfig;
|
||||
}
|
||||
|
||||
/**
|
||||
* Load configuration for DB form CLI options or ask info to user.
|
||||
* Load configuration for database form CLI options or ask info to user.
|
||||
*
|
||||
* @param InputInterface $input
|
||||
* @param InputInterface $input
|
||||
* @param OutputInterface $output
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function getDatabaseInformation(InputInterface $input, OutputInterface $output)
|
||||
|
@ -306,45 +347,51 @@ class InstallCommand extends Command
|
|||
$helper = $this->getHelperSet()->get('question');
|
||||
|
||||
if (!$dbType = $input->getOption('db-type')) {
|
||||
$questionType = new Question(Lang::get('enter_db_type'), 'mysql');
|
||||
$questionType = new Question('Please enter your database type (mysql or pgsql): ');
|
||||
$dbType = $helper->ask($input, $output, $questionType);
|
||||
}
|
||||
|
||||
if (!$dbHost = $input->getOption('db-host')) {
|
||||
$questionHost = new Question(Lang::get('enter_db_host'), 'localhost');
|
||||
$questionHost = new Question('Please enter your database host (default: localhost): ', 'localhost');
|
||||
$dbHost = $helper->ask($input, $output, $questionHost);
|
||||
}
|
||||
|
||||
if (!$dbPort = $input->getOption('db-port')) {
|
||||
$questionPort = new Question(Lang::get('enter_db_port'), '3306');
|
||||
$questionPort = new Question('Please enter your database port (default: empty): ');
|
||||
$dbPort = $helper->ask($input, $output, $questionPort);
|
||||
}
|
||||
|
||||
if (!$dbName = $input->getOption('db-name')) {
|
||||
$questionDb = new Question(Lang::get('enter_db_name'), 'php-censor-db');
|
||||
$questionDb = new Question('Please enter your database name (default: php-censor-db): ', 'php-censor-db');
|
||||
$dbName = $helper->ask($input, $output, $questionDb);
|
||||
}
|
||||
|
||||
if (!$dbUser = $input->getOption('db-user')) {
|
||||
$questionUser = new Question(Lang::get('enter_db_user'), 'php-censor-user');
|
||||
$questionUser = new Question('Please enter your DB user (default: php-censor-user): ', 'php-censor-user');
|
||||
$dbUser = $helper->ask($input, $output, $questionUser);
|
||||
}
|
||||
|
||||
if (!$dbPass = $input->getOption('db-pass')) {
|
||||
$questionPass = new Question(Lang::get('enter_db_pass'));
|
||||
if (!$dbPass = $input->getOption('db-password')) {
|
||||
$questionPass = new Question('Please enter your database password: ');
|
||||
$questionPass->setHidden(true);
|
||||
$questionPass->setHiddenFallback(false);
|
||||
$dbPass = $helper->ask($input, $output, $questionPass);
|
||||
}
|
||||
|
||||
$db['servers']['read'] = [[
|
||||
'host' => $dbHost,
|
||||
'port' => $dbPort,
|
||||
]];
|
||||
$db['servers']['write'] = [[
|
||||
'host' => $dbHost,
|
||||
'port' => $dbPort,
|
||||
]];
|
||||
$dbServers = [
|
||||
[
|
||||
'host' => $dbHost,
|
||||
]
|
||||
];
|
||||
|
||||
$dbPort = (integer)$dbPort;
|
||||
if ($dbPort) {
|
||||
$dbServers[0]['port'] = $dbPort;
|
||||
}
|
||||
|
||||
$db['servers']['read'] = $dbServers;
|
||||
$db['servers']['write'] = $dbServers;
|
||||
|
||||
$db['type'] = $dbType;
|
||||
$db['name'] = $dbName;
|
||||
$db['username'] = $dbUser;
|
||||
|
@ -354,16 +401,24 @@ class InstallCommand extends Command
|
|||
}
|
||||
|
||||
/**
|
||||
* Try and connect to DB using the details provided.
|
||||
* Try and connect to DB using the details provided
|
||||
*
|
||||
* @param array $db
|
||||
* @param OutputInterface $output
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function verifyDatabaseDetails(array $db, OutputInterface $output)
|
||||
{
|
||||
try {
|
||||
$dns = $db['type'] . ':host=' . $db['servers']['write'][0]['host'];
|
||||
if (isset($db['servers']['write'][0]['port'])) {
|
||||
$dns .= ';port=' . (integer)$db['servers']['write'][0]['port'];
|
||||
}
|
||||
$dns .= ';dbname=' . $db['name'];
|
||||
|
||||
$pdo = new PDO(
|
||||
$db['type'] . ':host=' . $db['servers']['write'][0]['host'] . ';port=' . $db['servers']['write'][0]['host'] . 'dbname=' . $db['name'],
|
||||
$dns,
|
||||
$db['username'],
|
||||
$db['password'],
|
||||
[
|
||||
|
@ -379,7 +434,7 @@ class InstallCommand extends Command
|
|||
return true;
|
||||
|
||||
} catch (Exception $ex) {
|
||||
$output->writeln('<error>'.Lang::get('could_not_connect').'</error>');
|
||||
$output->writeln('<error>PHP Censor could not connect to database with the details provided. Please try again.</error>');
|
||||
$output->writeln('<error>' . $ex->getMessage() . '</error>');
|
||||
}
|
||||
|
||||
|
@ -395,16 +450,18 @@ class InstallCommand extends Command
|
|||
$dumper = new Dumper();
|
||||
$yaml = $dumper->dump($config, 4);
|
||||
|
||||
file_put_contents($this->configFilePath, $yaml);
|
||||
file_put_contents($this->configPath, $yaml);
|
||||
}
|
||||
|
||||
protected function setupDatabase(OutputInterface $output)
|
||||
{
|
||||
$output->write(Lang::get('setting_up_db'));
|
||||
$output->write('Setting up your database...');
|
||||
|
||||
shell_exec(ROOT_DIR . 'bin/console php-censor-migrations:migrate');
|
||||
$outputMigration = shell_exec(ROOT_DIR . 'bin/console php-censor-migrations:migrate');
|
||||
|
||||
$output->writeln('<info>'.Lang::get('ok').'</info>');
|
||||
$output->writeln('');
|
||||
$output->writeln($outputMigration);
|
||||
$output->writeln('<info>OK</info>');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -416,15 +473,14 @@ class InstallCommand extends Command
|
|||
protected function createAdminUser($admin, $output)
|
||||
{
|
||||
try {
|
||||
$this->reloadConfig();
|
||||
|
||||
$userStore = Factory::getStore('User');
|
||||
/** @var UserStore $userStore */
|
||||
$userStore = Factory::getStore('User');
|
||||
$userService = new UserService($userStore);
|
||||
$userService->createUser($admin['name'], $admin['mail'], $admin['pass'], 1);
|
||||
$userService->createUser($admin['name'], $admin['email'], 'default', json_encode(['type' => 'internal']), $admin['password'], true);
|
||||
|
||||
$output->writeln('<info>'.Lang::get('user_created').'</info>');
|
||||
$output->writeln('<info>User account created!</info>');
|
||||
} catch (\Exception $ex) {
|
||||
$output->writeln('<error>'.Lang::get('failed_to_create').'</error>');
|
||||
$output->writeln('<error>PHP Censor failed to create your admin account!</error>');
|
||||
$output->writeln('<error>' . $ex->getMessage() . '</error>');
|
||||
}
|
||||
}
|
||||
|
@ -440,9 +496,9 @@ class InstallCommand extends Command
|
|||
|
||||
Factory::getStore('ProjectGroup')->save($group);
|
||||
|
||||
$output->writeln('<info>'.Lang::get('default_group_created').'</info>');
|
||||
$output->writeln('<info>Default project group created!</info>');
|
||||
} catch (\Exception $ex) {
|
||||
$output->writeln('<error>'.Lang::get('default_group_failed_to_create').'</error>');
|
||||
$output->writeln('<error>PHP Censor failed to create default project group!</error>');
|
||||
$output->writeln('<error>' . $ex->getMessage() . '</error>');
|
||||
}
|
||||
}
|
||||
|
@ -451,27 +507,8 @@ class InstallCommand extends Command
|
|||
{
|
||||
$config = Config::getInstance();
|
||||
|
||||
if (file_exists($this->configFilePath)) {
|
||||
$config->loadYaml($this->configFilePath);
|
||||
if (file_exists($this->configPath)) {
|
||||
$config->loadYaml($this->configPath);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param OutputInterface $output
|
||||
* @return bool
|
||||
*/
|
||||
protected function verifyNotInstalled(OutputInterface $output)
|
||||
{
|
||||
if (file_exists($this->configFilePath)) {
|
||||
$content = file_get_contents($this->configFilePath);
|
||||
|
||||
if (!empty($content)) {
|
||||
$output->writeln('<error>'.Lang::get('config_exists').'</error>');
|
||||
$output->writeln('<error>'.Lang::get('update_instead').'</error>');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,18 +1,10 @@
|
|||
<?php
|
||||
/**
|
||||
* PHPCI - Continuous Integration for PHP
|
||||
*
|
||||
* @copyright Copyright 2014, Block 8 Limited.
|
||||
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
|
||||
* @link https://www.phptesting.org/
|
||||
*/
|
||||
|
||||
namespace PHPCensor\Command;
|
||||
|
||||
use b8\Store\Factory;
|
||||
use b8\HttpClient;
|
||||
use Monolog\Logger;
|
||||
use PHPCensor\Helper\Lang;
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
|
@ -22,9 +14,7 @@ use PHPCensor\Model\Build;
|
|||
/**
|
||||
* Run console command - Poll github for latest commit id
|
||||
*
|
||||
* @author Jimmy Cleuren <jimmy.cleuren@gmail.com>
|
||||
* @package PHPCI
|
||||
* @subpackage Console
|
||||
* @author Jimmy Cleuren <jimmy.cleuren@gmail.com>
|
||||
*/
|
||||
class PollCommand extends Command
|
||||
{
|
||||
|
@ -43,7 +33,7 @@ class PollCommand extends Command
|
|||
{
|
||||
$this
|
||||
->setName('php-censor:poll-github')
|
||||
->setDescription(Lang::get('poll_github'));
|
||||
->setDescription('Poll GitHub to check if we need to start a build.');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -58,16 +48,16 @@ class PollCommand extends Command
|
|||
$token = $this->settings['php-censor']['github']['token'];
|
||||
|
||||
if (!$token) {
|
||||
$this->logger->error(Lang::get('no_token'));
|
||||
$this->logger->error('No GitHub token found');
|
||||
return;
|
||||
}
|
||||
|
||||
$buildStore = Factory::getStore('Build');
|
||||
|
||||
$this->logger->addInfo(Lang::get('finding_projects'));
|
||||
$this->logger->addInfo('Finding projects to poll');
|
||||
$projectStore = Factory::getStore('Project');
|
||||
$result = $projectStore->getWhere();
|
||||
$this->logger->addInfo(Lang::get('found_n_projects', count($result['items'])));
|
||||
$this->logger->addInfo(sprintf('Found %d projects', count($result['items'])));
|
||||
|
||||
foreach ($result['items'] as $project) {
|
||||
$http = new HttpClient('https://api.github.com');
|
||||
|
@ -77,17 +67,15 @@ class PollCommand extends Command
|
|||
$last_committer = $commits['body'][0]['commit']['committer']['email'];
|
||||
$message = $commits['body'][0]['commit']['message'];
|
||||
|
||||
$this->logger->info(Lang::get('last_commit_is', $project->getTitle(), $last_commit));
|
||||
$this->logger->info(sprintf('Last commit to GitHub for %s is %s', $project->getTitle(), $last_commit));
|
||||
|
||||
if (!$project->getArchived() && ($project->getLastCommit() != $last_commit && $last_commit != "")) {
|
||||
$this->logger->info(
|
||||
Lang::get('adding_new_build')
|
||||
);
|
||||
$this->logger->info('Last commit is different to database, adding new build.');
|
||||
|
||||
$build = new Build();
|
||||
$build->setProjectId($project->getId());
|
||||
$build->setCommitId($last_commit);
|
||||
$build->setStatus(Build::STATUS_NEW);
|
||||
$build->setStatus(Build::STATUS_PENDING);
|
||||
$build->setBranch($project->getBranch());
|
||||
$build->setCreated(new \DateTime());
|
||||
$build->setCommitMessage($message);
|
||||
|
@ -102,6 +90,6 @@ class PollCommand extends Command
|
|||
}
|
||||
}
|
||||
|
||||
$this->logger->addInfo(Lang::get('finished_processing_builds'));
|
||||
$this->logger->addInfo('Finished processing builds.');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,11 +1,4 @@
|
|||
<?php
|
||||
/**
|
||||
* PHPCI - Continuous Integration for PHP
|
||||
*
|
||||
* @copyright Copyright 2014, Block 8 Limited.
|
||||
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
|
||||
* @link https://www.phptesting.org/
|
||||
*/
|
||||
|
||||
namespace PHPCensor\Command;
|
||||
|
||||
|
@ -20,9 +13,7 @@ use Symfony\Component\Console\Output\OutputInterface;
|
|||
/**
|
||||
* Re-runs the last run build.
|
||||
*
|
||||
* @author Dan Cryer <dan@block8.co.uk>
|
||||
* @package PHPCI
|
||||
* @subpackage Console
|
||||
* @author Dan Cryer <dan@block8.co.uk>
|
||||
*/
|
||||
class RebuildCommand extends Command
|
||||
{
|
||||
|
|
|
@ -1,29 +1,18 @@
|
|||
<?php
|
||||
/**
|
||||
* PHPCI - Continuous Integration for PHP
|
||||
*
|
||||
* @copyright Copyright 2015, Block 8 Limited.
|
||||
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
|
||||
* @link https://www.phptesting.org/
|
||||
*/
|
||||
|
||||
namespace PHPCensor\Command;
|
||||
|
||||
use b8\Store\Factory;
|
||||
use Monolog\Logger;
|
||||
use PHPCensor\BuildFactory;
|
||||
use PHPCensor\Helper\Lang;
|
||||
use PHPCensor\Logging\OutputLogHandler;
|
||||
use PHPCensor\Service\BuildService;
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
|
||||
|
||||
/**
|
||||
* @author Dan Cryer <dan@block8.co.uk>
|
||||
* @package PHPCI
|
||||
* @subpackage Console
|
||||
* @author Dan Cryer <dan@block8.co.uk>
|
||||
*/
|
||||
class RebuildQueueCommand extends Command
|
||||
{
|
||||
|
@ -69,7 +58,7 @@ class RebuildQueueCommand extends Command
|
|||
$store = Factory::getStore('Build');
|
||||
$result = $store->getByStatus(0);
|
||||
|
||||
$this->logger->addInfo(Lang::get('found_n_builds', count($result['items'])));
|
||||
$this->logger->addInfo(sprintf('Found %d builds', count($result['items'])));
|
||||
|
||||
$buildService = new BuildService($store);
|
||||
|
||||
|
|
|
@ -1,20 +1,13 @@
|
|||
<?php
|
||||
/**
|
||||
* PHPCI - Continuous Integration for PHP
|
||||
*
|
||||
* @copyright Copyright 2014, Block 8 Limited.
|
||||
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
|
||||
* @link https://www.phptesting.org/
|
||||
*/
|
||||
|
||||
namespace PHPCensor\Command;
|
||||
|
||||
use b8\Config;
|
||||
use Monolog\Logger;
|
||||
use PHPCensor\Helper\Lang;
|
||||
use PHPCensor\Logging\BuildDBLogHandler;
|
||||
use PHPCensor\Logging\LoggedBuildContextTidier;
|
||||
use PHPCensor\Logging\OutputLogHandler;
|
||||
use PHPCensor\Store\BuildStore;
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
|
@ -26,9 +19,7 @@ use PHPCensor\Model\Build;
|
|||
/**
|
||||
* Run console command - Runs any pending builds.
|
||||
*
|
||||
* @author Dan Cryer <dan@block8.co.uk>
|
||||
* @package PHPCI
|
||||
* @subpackage Console
|
||||
* @author Dan Cryer <dan@block8.co.uk>
|
||||
*/
|
||||
class RunCommand extends Command
|
||||
{
|
||||
|
@ -61,12 +52,12 @@ class RunCommand extends Command
|
|||
{
|
||||
$this
|
||||
->setName('php-censor:run-builds')
|
||||
->setDescription(Lang::get('run_all_pending'))
|
||||
->addOption('debug', null, null, 'Run PHP Censor in Debug Mode');
|
||||
->setDescription('Run all pending PHP Censor builds')
|
||||
->addOption('debug', null, null, 'Run PHP Censor in debug mode');
|
||||
}
|
||||
|
||||
/**
|
||||
* Pulls all pending builds from the database and runs them.
|
||||
* Pulls all pending builds from the database or queue and runs them.
|
||||
*/
|
||||
protected function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
|
@ -80,7 +71,7 @@ class RunCommand extends Command
|
|||
);
|
||||
}
|
||||
|
||||
// Allow PHPCI to run in "debug mode"
|
||||
// Allow PHP Censor to run in "debug mode"
|
||||
if ($input->hasOption('debug') && $input->getOption('debug')) {
|
||||
$output->writeln('<comment>Debug mode enabled.</comment>');
|
||||
define('DEBUG_MODE', true);
|
||||
|
@ -89,10 +80,13 @@ class RunCommand extends Command
|
|||
$running = $this->validateRunningBuilds();
|
||||
|
||||
$this->logger->pushProcessor(new LoggedBuildContextTidier());
|
||||
$this->logger->addInfo(Lang::get('finding_builds'));
|
||||
$store = Factory::getStore('Build');
|
||||
$result = $store->getByStatus(0, $this->maxBuilds);
|
||||
$this->logger->addInfo(Lang::get('found_n_builds', count($result['items'])));
|
||||
$this->logger->addInfo('Finding builds to process');
|
||||
|
||||
/** @var BuildStore $store */
|
||||
$store = Factory::getStore('Build');
|
||||
$result = $store->getByStatus(Build::STATUS_PENDING, $this->maxBuilds);
|
||||
|
||||
$this->logger->addInfo(sprintf('Found %d builds', count($result['items'])));
|
||||
|
||||
$builds = 0;
|
||||
|
||||
|
@ -102,7 +96,7 @@ class RunCommand extends Command
|
|||
|
||||
// Skip build (for now) if there's already a build running in that project:
|
||||
if (in_array($build->getProjectId(), $running)) {
|
||||
$this->logger->addInfo(Lang::get('skipping_build', $build->getId()));
|
||||
$this->logger->addInfo(sprintf('Skipping Build %d - Project build already in progress.', $build->getId()));
|
||||
$result['items'][] = $build;
|
||||
|
||||
// Re-run build validator:
|
||||
|
@ -133,7 +127,7 @@ class RunCommand extends Command
|
|||
|
||||
}
|
||||
|
||||
$this->logger->addInfo(Lang::get('finished_processing_builds'));
|
||||
$this->logger->addInfo('Finished processing builds.');
|
||||
|
||||
return $builds;
|
||||
}
|
||||
|
@ -147,7 +141,7 @@ class RunCommand extends Command
|
|||
{
|
||||
/** @var \PHPCensor\Store\BuildStore $store */
|
||||
$store = Factory::getStore('Build');
|
||||
$running = $store->getByStatus(1);
|
||||
$running = $store->getByStatus(Build::STATUS_RUNNING);
|
||||
$rtn = [];
|
||||
|
||||
$timeout = Config::getInstance()->get('php-censor.build.failed_after', 1800);
|
||||
|
@ -160,7 +154,7 @@ class RunCommand extends Command
|
|||
$start = $build->getStarted()->getTimestamp();
|
||||
|
||||
if (($now - $start) > $timeout) {
|
||||
$this->logger->addInfo(Lang::get('marked_as_failed', $build->getId()));
|
||||
$this->logger->addInfo(sprintf('Build %d marked as failed due to timeout.', $build->getId()));
|
||||
$build->setStatus(Build::STATUS_FAILED);
|
||||
$build->setFinished(new \DateTime());
|
||||
$store->save($build);
|
||||
|
|
|
@ -1,11 +1,4 @@
|
|||
<?php
|
||||
/**
|
||||
* PHPCI - Continuous Integration for PHP
|
||||
*
|
||||
* @copyright Copyright 2015, Block 8 Limited.
|
||||
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
|
||||
* @link https://www.phptesting.org/
|
||||
*/
|
||||
|
||||
namespace PHPCensor\Command;
|
||||
|
||||
|
@ -17,13 +10,10 @@ use Symfony\Component\Console\Command\Command;
|
|||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
|
||||
|
||||
/**
|
||||
* Worker Command - Starts the BuildWorker, which pulls jobs from beanstalkd
|
||||
*
|
||||
* @author Dan Cryer <dan@block8.co.uk>
|
||||
* @package PHPCI
|
||||
* @subpackage Console
|
||||
* @author Dan Cryer <dan@block8.co.uk>
|
||||
*/
|
||||
class WorkerCommand extends Command
|
||||
{
|
||||
|
|
|
@ -3,6 +3,20 @@
|
|||
namespace PHPCensor\Console;
|
||||
|
||||
use b8\Config;
|
||||
use b8\Store\Factory;
|
||||
use PHPCensor\Command\CreateAdminCommand;
|
||||
use PHPCensor\Command\CreateBuildCommand;
|
||||
use PHPCensor\Command\InstallCommand;
|
||||
use PHPCensor\Command\PollCommand;
|
||||
use PHPCensor\Command\RebuildCommand;
|
||||
use PHPCensor\Command\RebuildQueueCommand;
|
||||
use PHPCensor\Command\RunCommand;
|
||||
use PHPCensor\Command\WorkerCommand;
|
||||
use PHPCensor\Logging\LoggerConfig;
|
||||
use PHPCensor\Service\BuildService;
|
||||
use PHPCensor\Store\BuildStore;
|
||||
use PHPCensor\Store\ProjectStore;
|
||||
use PHPCensor\Store\UserStore;
|
||||
use Symfony\Component\Console\Application as BaseApplication;
|
||||
use Phinx\Console\Command\Create;
|
||||
use Phinx\Console\Command\Migrate;
|
||||
|
@ -10,6 +24,11 @@ use Phinx\Console\Command\Rollback;
|
|||
use Phinx\Console\Command\Status;
|
||||
use Phinx\Config\Config as PhinxConfig;
|
||||
|
||||
/**
|
||||
* Class Application
|
||||
*
|
||||
* @package PHPCensor\Console
|
||||
*/
|
||||
class Application extends BaseApplication
|
||||
{
|
||||
/**
|
||||
|
@ -22,25 +41,30 @@ class Application extends BaseApplication
|
|||
{
|
||||
parent::__construct($name, $version);
|
||||
|
||||
$loggerConfig = LoggerConfig::newFromFile(APP_DIR . 'loggerconfig.php');
|
||||
|
||||
$applicationConfig = Config::getInstance();
|
||||
$databaseSettings = $applicationConfig->get('b8.database', []);
|
||||
|
||||
$phinxSettings = [
|
||||
'paths' => [
|
||||
'migrations' => 'src/PHPCensor/Migrations',
|
||||
],
|
||||
'environments' => [
|
||||
'default_migration_table' => 'migration',
|
||||
'default_database' => 'php-censor',
|
||||
'php-censor' => [
|
||||
'adapter' => $databaseSettings['type'],
|
||||
'host' => $databaseSettings['servers']['write'][0]['host'],
|
||||
'name' => $databaseSettings['name'],
|
||||
'user' => $databaseSettings['username'],
|
||||
'pass' => $databaseSettings['password'],
|
||||
$phinxSettings = [];
|
||||
if ($databaseSettings) {
|
||||
$phinxSettings = [
|
||||
'paths' => [
|
||||
'migrations' => ROOT_DIR . 'src/PHPCensor/Migrations',
|
||||
],
|
||||
],
|
||||
];
|
||||
'environments' => [
|
||||
'default_migration_table' => 'migration',
|
||||
'default_database' => 'php-censor',
|
||||
'php-censor' => [
|
||||
'adapter' => $databaseSettings['type'],
|
||||
'host' => $databaseSettings['servers']['write'][0]['host'],
|
||||
'name' => $databaseSettings['name'],
|
||||
'user' => $databaseSettings['username'],
|
||||
'pass' => $databaseSettings['password'],
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
if (!empty($databaseSettings['port'])) {
|
||||
$phinxSettings['environments']['php-censor']['port'] = (integer)$databaseSettings['port'];
|
||||
|
@ -68,5 +92,23 @@ class Application extends BaseApplication
|
|||
->setConfig($phinxConfig)
|
||||
->setName('php-censor-migrations:status')
|
||||
);
|
||||
|
||||
/** @var UserStore $userStore */
|
||||
$userStore = Factory::getStore('User');
|
||||
|
||||
/** @var ProjectStore $projectStore */
|
||||
$projectStore = Factory::getStore('Project');
|
||||
|
||||
/** @var BuildStore $buildStore */
|
||||
$buildStore = Factory::getStore('Build');
|
||||
|
||||
$this->add(new RunCommand($loggerConfig->getFor('RunCommand')));
|
||||
$this->add(new RebuildCommand($loggerConfig->getFor('RunCommand')));
|
||||
$this->add(new InstallCommand());
|
||||
$this->add(new PollCommand($loggerConfig->getFor('PollCommand')));
|
||||
$this->add(new CreateAdminCommand($userStore));
|
||||
$this->add(new CreateBuildCommand($projectStore, new BuildService($buildStore)));
|
||||
$this->add(new WorkerCommand($loggerConfig->getFor('WorkerCommand')));
|
||||
$this->add(new RebuildQueueCommand($loggerConfig->getFor('RebuildQueueCommand')));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -272,7 +272,7 @@ class BuildController extends Controller
|
|||
public function ajaxQueue()
|
||||
{
|
||||
$rtn = [
|
||||
'pending' => $this->formatBuilds($this->buildStore->getByStatus(Build::STATUS_NEW)),
|
||||
'pending' => $this->formatBuilds($this->buildStore->getByStatus(Build::STATUS_PENDING)),
|
||||
'running' => $this->formatBuilds($this->buildStore->getByStatus(Build::STATUS_RUNNING)),
|
||||
];
|
||||
|
||||
|
|
|
@ -175,12 +175,12 @@ class UserController extends Controller
|
|||
}
|
||||
|
||||
|
||||
$name = $this->getParam('name', null);
|
||||
$email = $this->getParam('email', null);
|
||||
$name = $this->getParam('name', null);
|
||||
$email = $this->getParam('email', null);
|
||||
$password = $this->getParam('password', null);
|
||||
$isAdmin = (int)$this->getParam('is_admin', 0);
|
||||
$isAdmin = (int)$this->getParam('is_admin', 0);
|
||||
|
||||
$this->userService->createUser($name, $email, $password, $isAdmin);
|
||||
$this->userService->createUser($name, $email, 'default', json_encode(['type' => 'internal']), $password, $isAdmin);
|
||||
|
||||
$response = new b8\Http\Response\RedirectResponse();
|
||||
$response->setHeader('Location', APP_URL . 'user');
|
||||
|
|
|
@ -59,7 +59,7 @@ class Lang
|
|||
return call_user_func_array('sprintf', $vars);
|
||||
}
|
||||
|
||||
return '%%MISSING STRING: ' . $string . '%%';
|
||||
return $string;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -22,16 +22,7 @@ class SshKey
|
|||
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'
|
||||
// sub-folder, which should also exist, but actually be writable.
|
||||
if (IS_WIN && $tempPath == getenv("SystemRoot") . '/') {
|
||||
$tempPath = getenv("SystemRoot") . '/TEMP/';
|
||||
}
|
||||
|
||||
$keyFile = $tempPath . md5(microtime(true));
|
||||
$keyFile = $tempPath . md5(microtime(true));
|
||||
|
||||
if (!is_dir($tempPath)) {
|
||||
mkdir($tempPath);
|
||||
|
|
|
@ -1,30 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* PHPCI - Continuous Integration for PHP
|
||||
*
|
||||
* @copyright Copyright 2014, Block 8 Limited.
|
||||
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
|
||||
* @link https://www.phptesting.org/
|
||||
*/
|
||||
|
||||
namespace PHPCensor\Helper;
|
||||
|
||||
/**
|
||||
* Windows-specific extension of the CommandExecutor class.
|
||||
* @package PHPCensor\Helper
|
||||
*/
|
||||
class WindowsCommandExecutor extends BaseCommandExecutor
|
||||
{
|
||||
/**
|
||||
* Use 'where' on Windows to find a binary, rather than 'which'
|
||||
* @param string $binary
|
||||
* @return null|string
|
||||
*/
|
||||
protected function findGlobalBinary($binary)
|
||||
{
|
||||
$command = sprintf('where %s', $binary);
|
||||
$result = shell_exec($command);
|
||||
|
||||
return trim($result);
|
||||
}
|
||||
}
|
|
@ -198,7 +198,6 @@ Services</a> sektionen under dit Bitbucket-repository.',
|
|||
'result' => 'Resultat',
|
||||
'ok' => 'OK',
|
||||
'took_n_seconds' => 'Tog %d sekunder',
|
||||
'build_created' => 'Build Oprettet',
|
||||
'build_started' => 'Build Startet',
|
||||
'build_finished' => 'Build Afsluttet',
|
||||
'test_message' => 'Message',
|
||||
|
@ -284,74 +283,12 @@ du kører composer update.',
|
|||
'search_packagist_for_more' => 'Søg på Packagist efter flere pakker',
|
||||
'search' => 'Søg »',
|
||||
|
||||
// Installer
|
||||
'installation_url' => 'PHP Censor Installations-URL',
|
||||
'db_host' => 'Database-hostnavn',
|
||||
'db_name' => 'Database-navn',
|
||||
'db_user' => 'Database-brugernavn',
|
||||
'db_pass' => 'Database-adgangskode',
|
||||
'admin_name' => 'Administrator-navn',
|
||||
'admin_pass' => 'Administrator-adgangskode',
|
||||
'admin_email' => 'Administrators email-adresse',
|
||||
'config_path' => 'Konfigurations-fil',
|
||||
'install_app' => 'Installér PHP Censor',
|
||||
'welcome_to_app' => 'Velkommen til PHP Censor',
|
||||
'please_answer' => 'Besvar venligst følgende spørgsmål:',
|
||||
'app_php_req' => 'PHP Censor kræver minimum PHP version 5.4.0 for at fungere.',
|
||||
'extension_required' => 'Extension påkrævet: %s',
|
||||
'function_required' => 'PHP Censor behøver adgang til funktion %s() i PHP. Er den deaktiveret i php.ini?',
|
||||
'requirements_not_met' => 'PHP Censor kan ikke installeres da nogle krav ikke opfyldtes.
|
||||
Kontrollér venligst nedenstående fejl før du fortsætter.',
|
||||
'must_be_valid_email' => 'Skal være en gyldig email-adresse.',
|
||||
'must_be_valid_url' => 'Skal være en gyldig URL.',
|
||||
'enter_name' => 'Administrator-navn: ',
|
||||
'enter_email' => 'Administrators email-adresse: ',
|
||||
'enter_password' => 'Administrator-adgangskode: ',
|
||||
'enter_app_url' => 'Din PHP Censor URL (eksempelvis "http://php-censor.local"): ',
|
||||
|
||||
'enter_db_host' => 'Indtast dit DB-hostnavn [localhost]: ',
|
||||
'enter_db_name' => 'Indtast dit DB database-navn [php-censor-db]: ',
|
||||
'enter_db_user' => 'Indtast dit DB-brugernavn [php-censor-user]: ',
|
||||
'enter_db_pass' => 'Indtast dit DB-password: ',
|
||||
'could_not_connect' => 'PHP Censor kunne ikke forbinde til DB med de angivning oplysninger. Forsøg igen.',
|
||||
'setting_up_db' => 'Indlæser database...',
|
||||
'user_created' => 'Brugerkonto oprettet!',
|
||||
'failed_to_create' => 'PHP Censor kunne ikke oprette din administrator-konto.',
|
||||
'config_exists' => 'PHP Censor konfigurationsfilen findes og er ikke tom.',
|
||||
'update_instead' => 'Hvis du forsøgte at opdatere PHP Censor, forsøg da venligst med php-censor:update istedet.',
|
||||
|
||||
// Update
|
||||
'update_app' => 'Opdatér databasen med ændrede modeller',
|
||||
'updating_app' => 'Opdaterer PHP Censor-database:',
|
||||
'not_installed' => 'PHP Censor lader til ikke at være installeret.',
|
||||
'install_instead' => 'Installér venligst PHP Censor via php-censor:install istedet.',
|
||||
|
||||
// Poll Command
|
||||
'poll_github' => 'Check via GitHub om et build skal startes.',
|
||||
'no_token' => 'GitHub-token findes ikke',
|
||||
'finding_projects' => 'Finder projekter der kan forespørges',
|
||||
'found_n_projects' => '%d projekter fundet',
|
||||
'last_commit_is' => 'Sidste commit til GitHub for %s er %s',
|
||||
'adding_new_build' => 'Sidste commit er forskellig fra databasen, tilføjer nyt build.',
|
||||
'finished_processing_builds' => 'Kørsel af builds afsluttet.',
|
||||
|
||||
// Create Admin
|
||||
'create_admin_user' => 'Tilføj en administrator',
|
||||
'incorrect_format' => 'Forkert format',
|
||||
|
||||
// Create Build Command
|
||||
'create_build_project' => 'Create a build for a project',
|
||||
'project_id_argument' => 'A project ID',
|
||||
'commit_id_option' => 'Commit ID to build',
|
||||
'branch_name_option' => 'Branch to build',
|
||||
|
||||
// Run Command
|
||||
'run_all_pending' => 'Kør alle PHP Censor builds i køen.',
|
||||
'finding_builds' => 'Finder builds der skal køres',
|
||||
'found_n_builds' => '%d builds fundet',
|
||||
'skipping_build' => 'Springer over Build %d - projektet kører et build lige nu.',
|
||||
'marked_as_failed' => 'Build %d blev markeret som fejlet pga. timeout.',
|
||||
|
||||
// Builder
|
||||
'missing_app_yml' => 'Dette projekt har ingen .php-censor.yml (.phpci.yml|phpci.yml) fil, eller filen er tom.',
|
||||
'build_success' => 'BUILD SUCCES',
|
||||
|
|
|
@ -208,7 +208,6 @@ generiert. Um es zu verwenden, fügen Sie einfach den folgenden Public Key im Ab
|
|||
'result' => 'Resultat',
|
||||
'ok' => 'OK',
|
||||
'took_n_seconds' => 'Benötigte %d Sekunden',
|
||||
'build_created' => 'Build erstellt',
|
||||
'build_started' => 'Build gestartet',
|
||||
'build_finished' => 'Build abgeschlossen',
|
||||
'test_message' => 'Nachricht',
|
||||
|
@ -307,74 +306,12 @@ generiert. Um es zu verwenden, fügen Sie einfach den folgenden Public Key im Ab
|
|||
'stage_broken' => 'Defekt',
|
||||
'stage_fixed' => 'Behoben',
|
||||
|
||||
// Installer
|
||||
'installation_url' => 'PHP Censor Installations-URL',
|
||||
'db_host' => 'Datenbankserver',
|
||||
'db_name' => 'Datenbankname',
|
||||
'db_user' => 'Datenbankbenutzer',
|
||||
'db_pass' => 'Datenbankpasswort',
|
||||
'admin_name' => 'Administratorname',
|
||||
'admin_pass' => 'Administratorpasswort',
|
||||
'admin_email' => 'Emailadresse des Administrators',
|
||||
'config_path' => 'Dateipfad für Konfiguration',
|
||||
'install_app' => 'PHP Censor installieren',
|
||||
'welcome_to_app' => 'Willkommen bei PHP Censor',
|
||||
'please_answer' => 'Bitte beantworten Sie die folgenden Fragen:',
|
||||
'app_php_req' => 'PHP Censor benötigt mindestens PHP 5.4.0 um zu funktionieren.',
|
||||
'extension_required' => 'Benötigte Extensions: %s',
|
||||
'function_required' => 'PHP Censor muss die Funktion %s() aufrufen können. Ist sie in php.ini deaktiviert?',
|
||||
'requirements_not_met' => 'PHP Censor konnte nicht installiert werden, weil nicht alle Bedingungen erfüllt sind.
|
||||
Bitte überprüfen Sie die Fehler, bevor Sie fortfahren,',
|
||||
'must_be_valid_email' => 'Muss eine gültige Emailadresse sein.',
|
||||
'must_be_valid_url' => 'Muss eine valide URL sein.',
|
||||
'enter_name' => 'Name des Administrators: ',
|
||||
'enter_email' => 'Emailadresse des Administrators: ',
|
||||
'enter_password' => 'Passwort des Administrators: ',
|
||||
'enter_app_url' => 'Ihre PHP Censor-URL (z.B. "http://php-censor.local"): ',
|
||||
|
||||
'enter_db_host' => 'Bitte geben Sie Ihren DB-Host ein [localhost]: ',
|
||||
'enter_db_name' => 'Bitte geben Sie Ihren DB-Namen ein [php-censor-db]: ',
|
||||
'enter_db_user' => 'Bitte geben Sie Ihren DB-Benutzernamen ein [php-censor-user]: ',
|
||||
'enter_db_pass' => 'Bitte geben Sie Ihr DB-Passwort ein: ',
|
||||
'could_not_connect' => 'PHP Censor konnte wegen folgender Details nicht mit DB verbinden. Bitte versuchen Sie es erneut.',
|
||||
'setting_up_db' => 'Ihre Datenbank wird aufgesetzt... ',
|
||||
'user_created' => 'Benutzerkonto wurde erstellt!',
|
||||
'failed_to_create' => 'PHP Censor konnte Ihr Administratorenkonto nicht erstellen.',
|
||||
'config_exists' => 'Die PHP Censor-Konfigurationsdatei existiert und ist nicht leer..',
|
||||
'update_instead' => 'Falls Sie versucht haben PHP Censor zu aktualisieren, benutzen Sie bitte stattdessen php-censor:update.',
|
||||
|
||||
// Update
|
||||
'update_app' => 'Datenbank wird aktualisiert, um den Änderungen der Models zu entsprechen.',
|
||||
'updating_app' => 'Aktualisiere PHP Censor-Datenbank:',
|
||||
'not_installed' => 'PHP Censor scheint nicht installiert zu sein.',
|
||||
'install_instead' => 'Bitte installieren Sie PHP Censor stattdessen via php-censor:install.',
|
||||
|
||||
// Poll Command
|
||||
'poll_github' => 'GitHub abfragen, um herauszufinden, ob ein Build gestartet werden muss.',
|
||||
'no_token' => 'Kein GitHub-Token gefunden',
|
||||
'finding_projects' => 'Suche Projekte, um diese abzufragen',
|
||||
'found_n_projects' => '%d Projekte gefunden',
|
||||
'last_commit_is' => 'Der letzte Commit zu GitHub für %s ist %s',
|
||||
'adding_new_build' => 'Letzter Commit unterscheidet sich von der Datenbank, füge neuen Build hinzu.',
|
||||
'finished_processing_builds' => 'Bearbeiten der Builds abgeschlossen.',
|
||||
|
||||
// Create Admin
|
||||
'create_admin_user' => 'Administratorenbenutzer erstellen',
|
||||
'incorrect_format' => 'Falsches Format',
|
||||
|
||||
// Create Build Command
|
||||
'create_build_project' => 'Create a build for a project',
|
||||
'project_id_argument' => 'A project ID',
|
||||
'commit_id_option' => 'Commit ID to build',
|
||||
'branch_name_option' => 'Branch to build',
|
||||
|
||||
// Run Command
|
||||
'run_all_pending' => 'Führe alle ausstehenden PHP Censor Builds aus.',
|
||||
'finding_builds' => 'Suche verarbeitbare Builds',
|
||||
'found_n_builds' => '%d Builds gefunden',
|
||||
'skipping_build' => 'Überspringe Build %d - Es wird bereits ein Build auf diesem Projekt ausgeführt.',
|
||||
'marked_as_failed' => 'Build %d wegen Zeitüberschreitung als fehlgeschlagen markiert.',
|
||||
|
||||
// Builder
|
||||
'missing_app_yml' => 'Dieses Projekt beinhaltet keine .php-censor.yml (.phpci.yml|phpci.yml)-Datei, oder sie ist leer.',
|
||||
'build_success' => 'BUILD ERFOLGREICH',
|
||||
|
|
|
@ -199,7 +199,6 @@ Services</a> του Bitbucket αποθετηρίου σας.',
|
|||
'result' => 'Αποτέλεσμα',
|
||||
'ok' => 'ΟΚ',
|
||||
'took_n_seconds' => 'Χρειάστηκαν %d δευτερόλεπτα',
|
||||
'build_created' => 'Η κατασκευή δημιουργήθηκε',
|
||||
'build_started' => 'Η κατασκευή άρχισε',
|
||||
'build_finished' => 'Η κατασκευή ολοκληρώθηκε',
|
||||
'test_message' => 'Message',
|
||||
|
@ -286,74 +285,12 @@ Services</a> του Bitbucket αποθετηρίου σας.',
|
|||
'search_packagist_for_more' => 'Αναζήτηση στο Packagist για περισσότερα πακέτα',
|
||||
'search' => 'Αναζήτηση »',
|
||||
|
||||
// Installer
|
||||
'installation_url' => 'Σύνδεσμος URL εγκατάστασης του PHP Censor',
|
||||
'db_host' => 'Φιλοξενία βάσης δεδομένων',
|
||||
'db_name' => 'Όνομα βάσης δεδομένων',
|
||||
'db_user' => 'Όνομα χρήστη βάσης δεδομένων',
|
||||
'db_pass' => 'Κωδικός πρόσβασης βάσης δεδομένων',
|
||||
'admin_name' => 'Όνομα διαχειριστή',
|
||||
'admin_pass' => 'Κωδικός πρόσβασης διαχειριστή',
|
||||
'admin_email' => 'Διεύθυνση email διαχειριστή',
|
||||
'config_path' => 'Διαδρομή αρχείου ρυθμίσεων',
|
||||
'install_app' => 'Εγκατάσταση PHP Censor',
|
||||
'welcome_to_app' => 'Καλώς ήρθατε στο PHP Censor',
|
||||
'please_answer' => 'Παρακαλώ απαντήστε στις ακόλουθες ερωτήσεις:',
|
||||
'app_php_req' => 'Το PHP Censor απαιτεί τουλάχιστον την έκδοση PHP 5.4.0 για να λειτουργήσει',
|
||||
'extension_required' => 'Απαιτούμενη επέκταση: %s ',
|
||||
'function_required' => 'Το PHP Censor πρέπει να είναι σε θέση να καλέσει την %s() συνάρτηση. Είναι απενεργοποιημένη στο php.ini;',
|
||||
'requirements_not_met' => 'Το PHP Censor δεν μπορεί να εγκατασταθεί, καθώς όλες οι απαιτήσεις δεν ικανοποιούνται.
|
||||
Παρακαλούμε διαβάστε τα παραπάνω λάθη πριν συνεχίσετε.',
|
||||
'must_be_valid_email' => 'Πρέπει να είναι μια έγκυρη διεύθυνση ηλεκτρονικού ταχυδρομείου.',
|
||||
'must_be_valid_url' => 'Πρέπει να είναι μια έγκυρη διεύθυνση URL.',
|
||||
'enter_name' => 'Όνομα διαχειριστή: ',
|
||||
'enter_email' => 'Ηλ. Διεύθυνση διαχειριστή: ',
|
||||
'enter_password' => 'Κωδικός πρόσβασης διαχειριστή: ',
|
||||
'enter_app_url' => 'Ο URL σύνδεσμος σας για το PHP Censor ("http://php-censor.local" για παράδειγμα): ',
|
||||
|
||||
'enter_db_host' => 'Παρακαλώ εισάγετε τον DB οικοδεσπότη σας [localhost]: ',
|
||||
'enter_db_name' => 'Παρακαλώ εισάγετε το όνομα της DB βάσης δεδομένων σας [php-censor-db]: ',
|
||||
'enter_db_user' => 'Παρακαλώ εισάγετε το όνομα χρήστη της DB σας [php-censor-user]: ',
|
||||
'enter_db_pass' => 'Παρακαλώ εισάγετε τον κωδικό χρήστη της DB σας: ',
|
||||
'could_not_connect' => 'Το PHP Censor δεν μπόρεσε να συνδεθεί με την DB με τα στοχεία που δώσατε. Παρακαλώ δοκιμάστε ξανά.',
|
||||
'setting_up_db' => 'Γίνεται ρύθμιση της βάσης δεδομένων σας ...',
|
||||
'user_created' => 'Λογαριασμός χρήστη δημιουργήθηκε!',
|
||||
'failed_to_create' => 'Το PHP Censor απέτυχε να δημιουργήσει το λογαριασμό διαχειριστή σας.',
|
||||
'config_exists' => 'Το αρχείο ρυθμίσεων PHP Censor υπάρχει και δεν είναι άδειο.',
|
||||
'update_instead' => 'Εάν προσπαθούσατε να ενημερώσετε PHP Censor, παρακαλούμε χρησιμοποιήστε καλύτερα το php-censor:update αντ \'αυτού.',
|
||||
|
||||
// Update
|
||||
'update_app' => 'Ενημέρωστε την βάση δεδομένων ώστε να αντικατοπτρίζει τροποποιημένα μοντέλα.',
|
||||
'updating_app' => 'Γίνεται ενημέρωση της βάσης δεδομένων PHP Censor:',
|
||||
'not_installed' => 'Το PHP Censor δεν φένεται να είναι εγκατεστημένο',
|
||||
'install_instead' => 'Παρακαλούμε εγκαταστήστε το PHP Censor καλύτερα με το php-censor:install αντ \'αυτού.',
|
||||
|
||||
// Poll Command
|
||||
'poll_github' => 'Δημοσκόπηση στο GitHub για να ελέγξετε αν θα πρέπει να ξεκινήσει μια κατασκευή.',
|
||||
'no_token' => 'Δεν βρέθηκε GitHub token',
|
||||
'finding_projects' => 'Αναζήτηση έργων για δημοσκόπηση',
|
||||
'found_n_projects' => 'Βρέθηκαν %d έργα',
|
||||
'last_commit_is' => 'H τελευταία συνεισφορά στο GitHub για %s είναι %s',
|
||||
'adding_new_build' => 'Τελευταία συνεισφορά είναι διαφορετική από τη βάση δεδομένων, γίνεται προσθήκη νέας κατασκευής.',
|
||||
'finished_processing_builds' => 'Ολοκληρώθηκε η επεξεργασία κατασκευής.',
|
||||
|
||||
// Create Admin
|
||||
'create_admin_user' => 'Δημιουργήστε ένα χρήστη διαχειριστή',
|
||||
'incorrect_format' => 'Λανθασμένη μορφοποίηση',
|
||||
|
||||
// Create Build Command
|
||||
'create_build_project' => 'Create a build for a project',
|
||||
'project_id_argument' => 'A project ID',
|
||||
'commit_id_option' => 'Commit ID to build',
|
||||
'branch_name_option' => 'Branch to build',
|
||||
|
||||
// Run Command
|
||||
'run_all_pending' => 'Εκτελέστε όλες τις εκκρεμείς PHP Censor κατασκευές.',
|
||||
'finding_builds' => 'Αναζήτηση κατασκευών για επεξεργασία',
|
||||
'found_n_builds' => 'Βρέθηκαν %d κατασκευές',
|
||||
'skipping_build' => 'Παράκαμψη κατασκευής %d - Η διαδικασία κατασκευής του έργου βρίσκεται ήδη σε εξέλιξη.',
|
||||
'marked_as_failed' => 'Η κατασκεύη %d επισημάνθηκε ως αποτυχημένη λόγω χρονικού ορίου',
|
||||
|
||||
// Builder
|
||||
'missing_app_yml' => 'Το έργο δεν περιέχει το αρχείο .php-censor.yml (.phpci.yml|phpci.yml) ή είναι άδειο.',
|
||||
'build_success' => 'ΚΑΤΑΣΚΕΥΗ ΕΠΙΤΥΧΗΣ',
|
||||
|
|
|
@ -227,7 +227,6 @@ PHP Censor',
|
|||
'result' => 'Result',
|
||||
'ok' => 'OK',
|
||||
'took_n_seconds' => 'Took %d seconds',
|
||||
'build_created' => 'Build Created',
|
||||
'build_started' => 'Build Started',
|
||||
'build_finished' => 'Build Finished',
|
||||
'test_message' => 'Message',
|
||||
|
@ -337,78 +336,17 @@ PHP Censor',
|
|||
'started' => 'Started',
|
||||
'finished' => 'Finished',
|
||||
|
||||
// Installer
|
||||
'installation_url' => 'PHP Censor Installation URL',
|
||||
'db_host' => 'Database Host',
|
||||
'db_name' => 'Database Name',
|
||||
'db_user' => 'Database Username',
|
||||
'db_pass' => 'Database Password',
|
||||
'admin_name' => 'Admin Name',
|
||||
'admin_pass' => 'Admin Password',
|
||||
'admin_email' => 'Admin Email Address',
|
||||
'config_path' => 'Config File Path',
|
||||
'install_app' => 'Install PHP Censor',
|
||||
'welcome_to_app' => 'Welcome to PHP Censor',
|
||||
'please_answer' => 'Please answer the following questions:',
|
||||
'app_php_req' => 'PHP Censor requires at least PHP 5.4.0 to function.',
|
||||
'extension_required' => 'Extension required: %s',
|
||||
'function_required' => 'PHP Censor needs to be able to call the %s() function. Is it disabled in php.ini?',
|
||||
'requirements_not_met' => 'PHP Censor cannot be installed, as not all requirements are met.
|
||||
Please review the errors above before continuing.',
|
||||
'must_be_valid_email' => 'Must be a valid email address.',
|
||||
'must_be_valid_url' => 'Must be a valid URL.',
|
||||
'enter_name' => 'Admin Name: ',
|
||||
'enter_email' => 'Admin Email: ',
|
||||
'enter_password' => 'Admin Password: ',
|
||||
'enter_app_url' => 'Your PHP Censor URL ("http://php-censor.local" for example): ',
|
||||
|
||||
'enter_db_host' => 'Please enter your DB host [localhost]: ',
|
||||
'enter_db_port' => 'Please enter your DB port [3306]: ',
|
||||
'enter_db_name' => 'Please enter your DB database name [php-censor-db]: ',
|
||||
'enter_db_user' => 'Please enter your DB username [php-censor-user]: ',
|
||||
'enter_db_pass' => 'Please enter your DB password: ',
|
||||
'could_not_connect' => 'PHP Censor could not connect to DB with the details provided. Please try again.',
|
||||
'setting_up_db' => 'Setting up your database... ',
|
||||
'user_created' => 'User account created!',
|
||||
'failed_to_create' => 'PHP Censor failed to create your admin account.',
|
||||
'config_exists' => 'The PHP Censor config file exists and is not empty.',
|
||||
'update_instead' => 'If you were trying to update PHP Censor, please use php-censor:update instead.',
|
||||
|
||||
// Update
|
||||
'update_app' => 'Update the database to reflect modified models.',
|
||||
'updating_app' => 'Updating PHP Censor database: ',
|
||||
'not_installed' => 'PHP Censor does not appear to be installed.',
|
||||
'install_instead' => 'Please install PHP Censor via php-censor:install instead.',
|
||||
|
||||
// Poll Command
|
||||
'poll_github' => 'Poll GitHub to check if we need to start a build.',
|
||||
'no_token' => 'No GitHub token found',
|
||||
'finding_projects' => 'Finding projects to poll',
|
||||
'found_n_projects' => 'Found %d projects',
|
||||
'last_commit_is' => 'Last commit to GitHub for %s is %s',
|
||||
'adding_new_build' => 'Last commit is different to database, adding new build.',
|
||||
'finished_processing_builds' => 'Finished processing builds.',
|
||||
|
||||
// Create Admin
|
||||
'create_admin_user' => 'Create an admin user',
|
||||
'incorrect_format' => 'Incorrect format',
|
||||
|
||||
// Create Build Command
|
||||
'create_build_project' => 'Create a build for a project',
|
||||
'project_id_argument' => 'A project ID',
|
||||
'commit_id_option' => 'Commit ID to build',
|
||||
'branch_name_option' => 'Branch to build',
|
||||
'add_to_queue_failed' => 'Build created successfully, but failed to add to build queue. This usually happens
|
||||
when PHP Censor is set to use a beanstalkd server that does not exist,
|
||||
or your beanstalkd server has stopped.',
|
||||
|
||||
// Run Command
|
||||
'run_all_pending' => 'Run all pending PHP Censor builds.',
|
||||
'finding_builds' => 'Finding builds to process',
|
||||
'found_n_builds' => 'Found %d builds',
|
||||
'skipping_build' => 'Skipping Build %d - Project build already in progress.',
|
||||
'marked_as_failed' => 'Build %d marked as failed due to timeout.',
|
||||
|
||||
// Builder
|
||||
'missing_app_yml' => 'This project does not contain a .php-censor.yml (.phpci.yml|phpci.yml) file, or it is empty.',
|
||||
'build_success' => 'BUILD SUCCESS',
|
||||
|
|
|
@ -203,7 +203,6 @@ PHP Censor',
|
|||
'result' => 'Resultado',
|
||||
'ok' => 'OK',
|
||||
'took_n_seconds' => 'Tomó %d segundos',
|
||||
'build_created' => 'Build Creado',
|
||||
'build_started' => 'Build Comenzado',
|
||||
'build_finished' => 'Build Terminado',
|
||||
|
||||
|
@ -281,68 +280,12 @@ PHP Censor',
|
|||
'search_packagist_for_more' => 'Buscar más paquetes en Packagist',
|
||||
'search' => 'Buscar »',
|
||||
|
||||
// Installer
|
||||
'installation_url' => 'URL de la instalación PHP Censor',
|
||||
'db_host' => 'Host',
|
||||
'db_name' => 'Nombre de la base de datos',
|
||||
'db_user' => 'Usuario de la base de datos',
|
||||
'db_pass' => 'Clave de la base de datos',
|
||||
'admin_name' => 'Nombre del Admin',
|
||||
'admin_pass' => 'Clave del Admin',
|
||||
'admin_email' => 'Email de Admin',
|
||||
'config_path' => 'Ruta al archivo config',
|
||||
'install_app' => 'Instalar PHP Censor',
|
||||
'welcome_to_app' => 'Bienvenido a PHP Censor',
|
||||
'please_answer' => 'Por favor, responde las siguientes preguntas:',
|
||||
'app_php_req' => 'PHP Censor requiere al menos PHP 5.4.0 para funcionar.',
|
||||
'extension_required' => 'Extensión requerida: %s',
|
||||
'function_required' => 'PHP Censor debe poder invocar la función %s(). Está deshabilitada en php.ini?',
|
||||
'requirements_not_met' => 'PHP Censor no pudo ser instalado, ya que no se cumplen todos los requerimientos.
|
||||
Por favor, corrige los errores antes de continuar.',
|
||||
'must_be_valid_email' => 'Debe ser una dirección de correos válida.',
|
||||
'must_be_valid_url' => 'Debe ser una URL válida.',
|
||||
'enter_name' => 'Nombre del Admin:',
|
||||
'enter_email' => 'Email del Admin:',
|
||||
'enter_password' => 'Contraseña de Admin:',
|
||||
'enter_app_url' => 'La URL de PHP Censor ("Por ejemplo: http://php-censor.local"): ',
|
||||
|
||||
'enter_db_host' => 'Por favor, ingresa el servidor DB [localhost]: ',
|
||||
'enter_db_name' => 'Por favor, ingresa el nombre de la base de datos DB [php-censor-db]: ',
|
||||
'enter_db_user' => 'Por favor, ingresa el usuario DB [php-censor-user]: ',
|
||||
'enter_db_pass' => 'Por favor, ingresa la contraseña DB: ',
|
||||
'could_not_connect' => 'PHP Censor no pudo conectarse a DB con los datos dados. Por favor, intenta nuevamente.',
|
||||
'setting_up_db' => 'Configurando base de datos... ',
|
||||
'user_created' => '¡Cuenta de usuario creada!',
|
||||
'failed_to_create' => 'PHP Censor no pudo crear la cuenta de admin.',
|
||||
'config_exists' => 'El archivo config de PHP Censor ya existe y no es vacío.',
|
||||
'update_instead' => 'Si está intentando actualizar PHP Censor, por favor, utiliza php-censor:update.',
|
||||
|
||||
// Update
|
||||
'update_app' => 'Actuliza la base de datos para reflejar los modelos actualizados.',
|
||||
'updating_app' => 'Actualizando base de datos PHP Censor: ',
|
||||
'not_installed' => 'PHP Censor no está instalado.',
|
||||
'install_instead' => 'Por favor, instala PHP Censor via php-censor:install.',
|
||||
|
||||
// Poll Command
|
||||
'poll_github' => 'Chequear en GitHub si se necesita comenzar un Build.',
|
||||
'no_token' => 'No se encontró ningún token GitHub',
|
||||
'finding_projects' => 'Buscando proyectos para chequear',
|
||||
'found_n_projects' => 'Se encontraron %d proyectos',
|
||||
'last_commit_is' => 'El último commit en GitHub para %s es %s',
|
||||
'adding_new_build' => 'Último commit es diferente a la base de datos, agregando nuevo build.',
|
||||
'finished_processing_builds' => 'Fin de procesamiento de builds.',
|
||||
|
||||
// Create Admin
|
||||
'create_admin_user' => 'Crear un usuario Admin',
|
||||
'incorrect_format' => 'Formato incorrecto',
|
||||
|
||||
// Run Command
|
||||
'run_all_pending' => 'Ejecutar todos los builds PHP Censor pendientes.',
|
||||
'finding_builds' => 'Buscando builds a procesar',
|
||||
'found_n_builds' => 'Se encontraron %d builds',
|
||||
'skipping_build' => 'Saltando Build %d - Build del proyecto ya en ejecución.',
|
||||
'marked_as_failed' => 'Build %d falló debido a timeout.',
|
||||
|
||||
// Builder
|
||||
'missing_app_yml' => 'Este proyecto no contiene el archivo .php-censor.yml (.phpci.yml|phpci.yml) o está vacío.',
|
||||
'build_success' => 'BUILD EXITOSO',
|
||||
|
|
|
@ -203,7 +203,6 @@ PHP Censor',
|
|||
'result' => 'Resultat',
|
||||
'ok' => 'OK',
|
||||
'took_n_seconds' => 'Exécuté en %d secondes',
|
||||
'build_created' => 'Build créé',
|
||||
'build_started' => 'Build démarré',
|
||||
'build_finished' => 'Build terminé',
|
||||
'test_message' => 'Message',
|
||||
|
@ -301,74 +300,12 @@ PHP Censor',
|
|||
'stage_success' => 'Succes',
|
||||
'stage_failure' => 'Échec',
|
||||
|
||||
// Installer
|
||||
'installation_url' => 'URL d\'installation de PHP Censor',
|
||||
'db_host' => 'Hôte de la BDD',
|
||||
'db_name' => 'Nom de la BDD',
|
||||
'db_user' => 'Nom d\'utilisateur de la BDD',
|
||||
'db_pass' => 'Mot de passe de la BDD',
|
||||
'admin_name' => 'Nom de l\'admin',
|
||||
'admin_pass' => 'Mot de passe admin',
|
||||
'admin_email' => 'Adresse email de l\'admin',
|
||||
'config_path' => 'Chemin vers le fichier de configuration',
|
||||
'install_app' => 'Installer PHP Censor',
|
||||
'welcome_to_app' => 'Bienvenue sur PHP Censor',
|
||||
'please_answer' => 'Merci de répondre aux questions suivantes :',
|
||||
'app_php_req' => 'PHP Censor requiert au moins PHP 5.4.0 pour fonctionner.',
|
||||
'extension_required' => 'Extensions requises : %s',
|
||||
'function_required' => 'PHP Censor doit être capable d\'appeler la fonction %s(). Est-ce qu\'elle est désactivée dans votre php.ini?',
|
||||
'requirements_not_met' => 'PHP Censor ne peut pas être installé parce que toutes les conditions requises ne sont pas respectées.
|
||||
Merci de corriger les erreurs ci-dessus avant de continuer.',
|
||||
'must_be_valid_email' => 'Doit être une adresse email valide.',
|
||||
'must_be_valid_url' => 'Doit être une URL valide.',
|
||||
'enter_name' => 'Nom de l\'admin: ',
|
||||
'enter_email' => 'Email de l\'admin: ',
|
||||
'enter_password' => 'Mot de passe de l\'admin: ',
|
||||
'enter_app_url' => 'Votre URL vers PHP Censor (par exemple "http://php-censor.local"): ',
|
||||
|
||||
'enter_db_host' => 'Merci d\'entrer le nom d\'hôte DB [localhost]: ',
|
||||
'enter_db_name' => 'Merci d\'entrer le nom de la base DB [php-censor-db]: ',
|
||||
'enter_db_user' => 'Merci d\'entrer le nom d\'utilisateur DB [php-censor-user]: ',
|
||||
'enter_db_pass' => 'Merci d\'entrer le mot de passe DB: ',
|
||||
'could_not_connect' => 'PHP Censor ne peut pas se connecter à DB à partir des informations fournies. Veuillez réessayer..',
|
||||
'setting_up_db' => 'Paramétrage de la base de données... ',
|
||||
'user_created' => 'Le compte utilisateur a été créé !',
|
||||
'failed_to_create' => 'PHP Censor n\'a pas réussi à créer votre compte admin.',
|
||||
'config_exists' => 'Le fichier de configuration PHP Censor existe et n\'est pas vide.',
|
||||
'update_instead' => 'Si vous essayez de mettre à jour PHP Censor, merci d\'utiliser la commande php-censor:update.',
|
||||
|
||||
// Update
|
||||
'update_app' => 'Mise à jour de la base de données pour refléter les modifications apportées aux modèles.',
|
||||
'updating_app' => 'Mise à jour de la base de données PHP Censor : ',
|
||||
'not_installed' => 'PHP Censor n\'a pas l\'air d\'être installé.',
|
||||
'install_instead' => 'Merci d\'installer PHP Censor grâce à la commande php-censor:install.',
|
||||
|
||||
// Poll Command
|
||||
'poll_github' => 'Demander à GitHub de vérifier si nous devons démarrer un build.',
|
||||
'no_token' => 'Aucun token GitHub n\'a été trouvé',
|
||||
'finding_projects' => 'Recherche des projets à sonder',
|
||||
'found_n_projects' => '%d projets trouvés',
|
||||
'last_commit_is' => 'Le dernier commit sur GitHub pour %s est %s',
|
||||
'adding_new_build' => 'Le dernier commit est différent de celui présent en base de données, ajout d\'un nouveau build.',
|
||||
'finished_processing_builds' => 'Traitement des builds terminé.',
|
||||
|
||||
// Create Admin
|
||||
'create_admin_user' => 'Créer un utilisateur admin',
|
||||
'incorrect_format' => 'Format incorrect',
|
||||
|
||||
// Create Build Command
|
||||
'create_build_project' => 'Créer un build projet',
|
||||
'project_id_argument' => 'ID du projet',
|
||||
'commit_id_option' => 'ID du commit',
|
||||
'branch_name_option' => 'Branche',
|
||||
|
||||
// Run Command
|
||||
'run_all_pending' => 'Démarrage de tout les builds PHP Censor en attente.',
|
||||
'finding_builds' => 'Découverte des builds à traiter',
|
||||
'found_n_builds' => '%d builds trouvés',
|
||||
'skipping_build' => 'Saut du build %d - Un build sur le projet est déjà en cours.',
|
||||
'marked_as_failed' => 'Le build %d a été marqué échoué à cause d\'un timeout.',
|
||||
|
||||
// Builder
|
||||
'missing_app_yml' => 'Ce projet ne contient pas de fichier .php-censor.yml (.phpci.yml|phpci.yml), ou il est vide.',
|
||||
'build_success' => 'BUILD RÉUSSI',
|
||||
|
|
|
@ -200,7 +200,6 @@ PHP Censor',
|
|||
'result' => 'Risultati',
|
||||
'ok' => 'OK',
|
||||
'took_n_seconds' => 'Sono stati impiegati %d seconds',
|
||||
'build_created' => 'Build Creata',
|
||||
'build_started' => 'Build Avviata',
|
||||
'build_finished' => 'Build Terminata',
|
||||
'test_message' => 'Message',
|
||||
|
@ -286,75 +285,12 @@ PHP Censor',
|
|||
'search_packagist_for_more' => 'Cerca altri pacchetti su Packagist',
|
||||
'search' => 'Cerca »',
|
||||
|
||||
// Installer
|
||||
'installation_url' => 'URL di installazione di PHP Censor',
|
||||
'db_host' => 'Host del Database',
|
||||
'db_name' => 'Nome del Database',
|
||||
'db_user' => 'Username del Database',
|
||||
'db_pass' => 'Password del Database',
|
||||
'admin_name' => 'Nome dell\'amministratore',
|
||||
'admin_pass' => 'Password dell\'amministratore',
|
||||
'admin_email' => 'Email dell\'amministratore',
|
||||
'config_path' => 'Percorso del file di configurazione',
|
||||
'install_app' => 'Installa PHP Censor',
|
||||
'welcome_to_app' => 'Benvenuto in PHP Censor',
|
||||
'please_answer' => 'Per favore rispondi alle seguenti domande:',
|
||||
'app_php_req' => 'PHP Censor richiede come minimo PHP 5.4.0 per funzionare.',
|
||||
'extension_required' => 'Le estensioni richieste sono: %s',
|
||||
'function_required' => 'PHP Censor richiede di poter chiamare la funzione %s(). Questa funzionalità è disabibiltata nel
|
||||
php.ini?',
|
||||
'requirements_not_met' => 'PHP Censor non può essere installato, non tutti i requisiti sono soddisfatti.
|
||||
Per favore controlla gli errori riportati prima di proseguire.',
|
||||
'must_be_valid_email' => 'Deve essere un indirizzo email valido.',
|
||||
'must_be_valid_url' => 'Deve essere un URL valido.',
|
||||
'enter_name' => 'Nome dell\'amministratore: ',
|
||||
'enter_email' => 'Email dell\'amministratore: ',
|
||||
'enter_password' => 'Password dell\'amministratore: ',
|
||||
'enter_app_url' => 'L\'URL di PHP Censor ("http://php-censor.locale" ad esempio): ',
|
||||
|
||||
'enter_db_host' => 'Per favore inserisci l\'host DB [localhost]: ',
|
||||
'enter_db_name' => 'Per favore inserisci il nome DB [php-censor-db]: ',
|
||||
'enter_db_user' => 'Per favore inserisci l\'username DB [php-censor-user]: ',
|
||||
'enter_db_pass' => 'Per favore inserisci la password DB: ',
|
||||
'could_not_connect' => 'PHP Censor non può connettersi a DB con le informazioni fornite. Per favore prova ancora.',
|
||||
'setting_up_db' => 'Configurzione del tuo database... ',
|
||||
'user_created' => 'Account utente creato!',
|
||||
'failed_to_create' => 'PHP Censor non è riuscito a creare il tuo account amministrativo.',
|
||||
'config_exists' => 'Il file di configurazione di PHP Censor esiste e non è vuoto.',
|
||||
'update_instead' => 'Se stai cercando di aggiornare PHP Censor, per favore usa php-censor:update.',
|
||||
|
||||
// Update
|
||||
'update_app' => 'Aggiorna il database per riflettere le modifiche ai model.',
|
||||
'updating_app' => 'Aggiornamenti del database di PHP Censor: ',
|
||||
'not_installed' => 'PHP Censor sembra non essere installato.',
|
||||
'install_instead' => 'Per favore installa PHP Censor tramite php-censor:install.',
|
||||
|
||||
// Poll Command
|
||||
'poll_github' => 'Richiesta a GitHub per verificare se è necessario avviare una build.',
|
||||
'no_token' => 'Nessuno token per GitHub trovato',
|
||||
'finding_projects' => 'Ricerca dei progetti da aggiornare',
|
||||
'found_n_projects' => 'Trovati %d progetti',
|
||||
'last_commit_is' => 'Ultimo commit su GitHub per %s è %s',
|
||||
'adding_new_build' => 'L\'ultimo commit è diverso da quello registrato, new build aggiunta.',
|
||||
'finished_processing_builds' => 'Terminato di processare le build.',
|
||||
|
||||
// Create Admin
|
||||
'create_admin_user' => 'Crea un nuovo utente amministrarore',
|
||||
'incorrect_format' => 'Formato errato',
|
||||
|
||||
// Create Build Command
|
||||
'create_build_project' => 'Create a build for a project',
|
||||
'project_id_argument' => 'A project ID',
|
||||
'commit_id_option' => 'Commit ID to build',
|
||||
'branch_name_option' => 'Branch to build',
|
||||
|
||||
// Run Command
|
||||
'run_all_pending' => 'Esegui tutte le build in attesa su PHP Censor.',
|
||||
'finding_builds' => 'Ricerca delel build da processare',
|
||||
'found_n_builds' => 'Trovate %d build',
|
||||
'skipping_build' => 'Saltata la build %d - La build del progetto è già in corso.',
|
||||
'marked_as_failed' => 'Build %d è stata contrassegnata come fallita per un timeout.',
|
||||
|
||||
// Builder
|
||||
'missing_app_yml' => 'Questo progetto non contiene il file .php-censor.yml (.phpci.yml|phpci.yml), o il file è vuoto.',
|
||||
'build_success' => 'BUILD PASSATA',
|
||||
|
|
|
@ -199,7 +199,6 @@ Services</a> sectie van je Bitbucket repository toegevoegd worden.',
|
|||
'result' => 'Resultaat',
|
||||
'ok' => 'OK',
|
||||
'took_n_seconds' => 'Duurde %d seconden',
|
||||
'build_created' => 'Build aangemaakt',
|
||||
'build_started' => 'Build gestart',
|
||||
'build_finished' => 'Build beëindigd',
|
||||
'test_message' => 'Message',
|
||||
|
@ -286,74 +285,12 @@ keer je composer update uitvoert.',
|
|||
'search_packagist_for_more' => 'Doorzoek Packagist naar meer packages',
|
||||
'search' => 'Zoek »',
|
||||
|
||||
// Installer
|
||||
'installation_url' => 'PHP Censor installatie URL',
|
||||
'db_host' => 'Database host',
|
||||
'db_name' => 'Database naam',
|
||||
'db_user' => 'Database gebruikersnaam',
|
||||
'db_pass' => 'Database wachtwoord',
|
||||
'admin_name' => 'Administrator naam',
|
||||
'admin_pass' => 'Administrator wachtwoord',
|
||||
'admin_email' => 'Administrator e-mailadres',
|
||||
'config_path' => 'Pad naar configuratiebestand',
|
||||
'install_app' => 'Installeer PHP Censor',
|
||||
'welcome_to_app' => 'Welkom bij PHP Censor',
|
||||
'please_answer' => 'Gelieve onderstaande vragen te beantwoorden:',
|
||||
'app_php_req' => 'PHP Censor heeft ten minste PHP 5.4.0 nodig om te werken.',
|
||||
'extension_required' => 'Extensie benodigd: %s',
|
||||
'function_required' => 'PHP Censor moet functie %s() kunnen aanroepen. Is deze uitgeschakeld in php.ini?',
|
||||
'requirements_not_met' => 'PHP Censor kan niet worden geïnstalleerd omdat niet aan alle vereisten is voldaan.
|
||||
Gelieve de fouten na te kijken vooraleer verder te gaan.',
|
||||
'must_be_valid_email' => 'Moet een geldig e-mailadres zijn.',
|
||||
'must_be_valid_url' => 'Moet een geldige URL zijn.',
|
||||
'enter_name' => 'Administrator naam: ',
|
||||
'enter_email' => 'Administrator e-mailadres: ',
|
||||
'enter_password' => 'Administrator wachtwoord: ',
|
||||
'enter_app_url' => 'Je PHP Censor URL (bijvoorbeeld "http://php-censor.local"): ',
|
||||
|
||||
'enter_db_host' => 'Vul je DB host in [localhost]: ',
|
||||
'enter_db_name' => 'Vul je DB databasenaam in [php-censor-db]: ',
|
||||
'enter_db_user' => 'Vul je DB gebruikersnaam in [php-censor-user]: ',
|
||||
'enter_db_pass' => 'Vul je DB watchtwoord in: ',
|
||||
'could_not_connect' => 'PHP Censor kon met deze gegevens geen verbinding maken met DB. Gelieve opnieuw te proberen.',
|
||||
'setting_up_db' => 'Database wordt aangemaakt...',
|
||||
'user_created' => 'Gebruikersprofiel aangemaakt!',
|
||||
'failed_to_create' => 'PHP Censor kon je administratorprofiel niet aanmaken.',
|
||||
'config_exists' => 'Het PHP Censor configuratiebestand bestaat en is niet leeg.',
|
||||
'update_instead' => 'Liever php-censor:update te gebruiken indien je PHP Censor probeerde te updaten, ',
|
||||
|
||||
// Update
|
||||
'update_app' => 'Update de database naar het beeld van gewijzigde modellen.',
|
||||
'updating_app' => 'PHP Censor database wordt geüpdatet:',
|
||||
'not_installed' => 'PHP Censor lijkt niet geïnstalleerd te zijn.',
|
||||
'install_instead' => 'Gelieve PHP Censor via php-censor:install te installeren.',
|
||||
|
||||
// Poll Command
|
||||
'poll_github' => 'Poll GitHub om te controleren of we een build moeten starten.',
|
||||
'no_token' => 'Geen GitHub token gevonden',
|
||||
'finding_projects' => 'Vind projecten om te pollen',
|
||||
'found_n_projects' => '%d projecten gevonden',
|
||||
'last_commit_is' => 'Laatste commit naar GitHub voor %s is %s',
|
||||
'adding_new_build' => 'Laatste commit verschilt van database, nieuwe build wordt toegevoegd',
|
||||
'finished_processing_builds' => 'Verwerking builds voltooid.',
|
||||
|
||||
// Create Admin
|
||||
'create_admin_user' => 'Administrator-gebruiker aanmaken',
|
||||
'incorrect_format' => 'Incorrect formaat',
|
||||
|
||||
// Create Build Command
|
||||
'create_build_project' => 'Create a build for a project',
|
||||
'project_id_argument' => 'A project ID',
|
||||
'commit_id_option' => 'Commit ID to build',
|
||||
'branch_name_option' => 'Branch to build',
|
||||
|
||||
// Run Command
|
||||
'run_all_pending' => 'Voer alle wachtende PHP Censor builds uit.',
|
||||
'finding_builds' => 'Zoekt builds om te verwerken',
|
||||
'found_n_builds' => '%d builds gevonden',
|
||||
'skipping_build' => 'Build %d overslaan - Project build reeds aan de gang.',
|
||||
'marked_as_failed' => 'Build %d gemarkeerd als falende door timeout.',
|
||||
|
||||
// Builder
|
||||
'missing_app_yml' => 'Dit project bevat geen .php-censor.yml (.phpci.yml|phpci.yml) bestand, of het is leeg.',
|
||||
'build_success' => 'BUILD SUCCES',
|
||||
|
|
|
@ -202,7 +202,6 @@ Services</a> repozytoria Bitbucket.',
|
|||
'result' => 'Wynik',
|
||||
'ok' => 'OK',
|
||||
'took_n_seconds' => 'Zajęło %d sekund',
|
||||
'build_created' => 'Budowanie Stworzone',
|
||||
'build_started' => 'Budowanie Rozpoczęte',
|
||||
'build_finished' => 'Budowanie Zakończone',
|
||||
'test_message' => 'Wiadomość',
|
||||
|
@ -287,74 +286,12 @@ wywołaniu polecenia composer update.',
|
|||
'search_packagist_for_more' => 'Przeszukaj Packagist po więcej pakietów',
|
||||
'search' => 'Szukaj »',
|
||||
|
||||
// Installer
|
||||
'installation_url' => 'URL instalacyjny PHP Censor',
|
||||
'db_host' => 'Host Bazy Danych',
|
||||
'db_name' => 'Nazwa Bazy Danych',
|
||||
'db_user' => 'Nazwa Użytkownika Bazy Danych',
|
||||
'db_pass' => 'Hasło Bazy Danych',
|
||||
'admin_name' => 'Imię Admina',
|
||||
'admin_pass' => 'Hasło Admina',
|
||||
'admin_email' => 'Adres Email Admina',
|
||||
'config_path' => 'Ścieżka Pliku Config',
|
||||
'install_app' => 'Zainstaluj PHP Censor',
|
||||
'welcome_to_app' => 'Witaj w PHP Censor',
|
||||
'please_answer' => 'Odpowiedz na poniższe pytania:',
|
||||
'app_php_req' => 'PHP Censor wymaga przynajmniej PHP 5.4.0 do prawidłowego funkcjonowania.',
|
||||
'extension_required' => 'Wymagane rozszerzenie: %s',
|
||||
'function_required' => 'PHP Censor musi mieć możliwość wywołania funkcji %s(). Czy ona jest wyłączona w php.ini?',
|
||||
'requirements_not_met' => 'Nie można zainstalować PHP Censor, ponieważ nie wszystkie wymagania zostały spełnione.
|
||||
Przejrzyj powyższą listę błędów przed kontynuowaniem.',
|
||||
'must_be_valid_email' => 'Poprawny adres email jest wymagany.',
|
||||
'must_be_valid_url' => 'Poprawny URL jest wymagany.',
|
||||
'enter_name' => 'Imię Admina: ',
|
||||
'enter_email' => 'Email Admina: ',
|
||||
'enter_password' => 'Hasło Admina: ',
|
||||
'enter_app_url' => 'URL PHP Censor (na przykład "http://php-censor.local"): ',
|
||||
|
||||
'enter_db_host' => 'Wpisz hosta DB [host lokalny]: ',
|
||||
'enter_db_name' => 'Wpisz nazwę bazy danych DB [php-censor-db]: ',
|
||||
'enter_db_user' => 'Wpisz nazwę użytkownika DB [php-censor-user]: ',
|
||||
'enter_db_pass' => 'Wpisz hasło DB: ',
|
||||
'could_not_connect' => 'Z podanymi ustawieniami PHP Censor nie udało się połączyć z DB. Spróbuj ponownie.',
|
||||
'setting_up_db' => 'Ustawianie Twojej bazy danych...',
|
||||
'user_created' => 'Utworzono konto użytkownika!',
|
||||
'failed_to_create' => 'PHP Censor nie udało się założyc Twojego konta administratora.',
|
||||
'config_exists' => 'Plik konfiguracji PHP Censor istnieje i nie jest pusty.',
|
||||
'update_instead' => 'Jeśli próbowałeś zaktualizować PHP Censor, użyj php-censor:update.',
|
||||
|
||||
// Update
|
||||
'update_app' => 'Zaktualizuj bazę danych zgodnie ze zmodyfikowanymi modelami.',
|
||||
'updating_app' => 'Aktualizacja bazy danych PHP Censor:',
|
||||
'not_installed' => 'Wygląda na to, że PHP Censor nie jest zainstalowane.',
|
||||
'install_instead' => 'Proszę zainstalować PHP Censor poprzez php-censor:install',
|
||||
|
||||
// Poll Command
|
||||
'poll_github' => 'Odpytuj GitHub, aby sprawdzić czy należy uruchomić budowę.',
|
||||
'no_token' => 'Nie znaleziono tokena GitHub',
|
||||
'finding_projects' => 'Szukanie projektów do odpytywania',
|
||||
'found_n_projects' => 'Znaleziono %d projektów',
|
||||
'last_commit_is' => 'Ostatni commit do GitHuba dla %s to %s',
|
||||
'adding_new_build' => 'Ostatni commit jest inny w bazie danych, dodaję nową budowę.',
|
||||
'finished_processing_builds' => 'Ukończono przetwarzanie budów.',
|
||||
|
||||
// Create Admin
|
||||
'create_admin_user' => 'Utwórz admina',
|
||||
'incorrect_format' => 'Niepoprawny format',
|
||||
|
||||
// Create Build Command
|
||||
'create_build_project' => 'Utwórz budowanie dla projektu',
|
||||
'project_id_argument' => 'ID projektu',
|
||||
'commit_id_option' => 'ID Commita do budowania',
|
||||
'branch_name_option' => 'Gałąź do budowania',
|
||||
|
||||
// Run Command
|
||||
'run_all_pending' => 'Uruchom wszystkie oczekujące budowy w PHP Censor',
|
||||
'finding_builds' => 'Szukam budów do przetwarzania.',
|
||||
'found_n_builds' => 'Znaleziono %d budowań',
|
||||
'skipping_build' => 'Budowanie %d jest pomijane - Budowanie projektu jest już w toku',
|
||||
'marked_as_failed' => 'Budowanie %d nie powiodło się z powodu przekroczenia limitu czasu.',
|
||||
|
||||
// Builder
|
||||
'missing_app_yml' => 'Projekt nie zawiera pliku .php-censor.yml (.phpci.yml|phpci.yml) lub projekt jest pusty.',
|
||||
'build_success' => 'BUDOWANIE ZAKOŃCZONE SUKCESEM',
|
||||
|
|
|
@ -208,7 +208,6 @@ PHP Censor',
|
|||
'result' => 'Result',
|
||||
'ok' => 'OK',
|
||||
'took_n_seconds' => 'Took %d seconds',
|
||||
'build_created' => 'Build Created',
|
||||
'build_started' => 'Build Started',
|
||||
'build_finished' => 'Build Finished',
|
||||
'test_message' => 'Message',
|
||||
|
@ -308,77 +307,12 @@ PHP Censor',
|
|||
'stage_broken' => 'Broken',
|
||||
'stage_fixed' => 'Fixed',
|
||||
|
||||
// Installer
|
||||
'installation_url' => 'PHP Censor Installation URL',
|
||||
'db_host' => 'Database Host',
|
||||
'db_name' => 'Database Name',
|
||||
'db_user' => 'Database Username',
|
||||
'db_pass' => 'Database Password',
|
||||
'admin_name' => 'Admin Name',
|
||||
'admin_pass' => 'Admin Password',
|
||||
'admin_email' => 'Admin Email Address',
|
||||
'config_path' => 'Config File Path',
|
||||
'install_app' => 'Install PHP Censor',
|
||||
'welcome_to_app' => 'Welcome to PHP Censor',
|
||||
'please_answer' => 'Please answer the following questions:',
|
||||
'app_php_req' => 'PHP Censor requires at least PHP 5.3.8 to function.',
|
||||
'extension_required' => 'Extension required: %s',
|
||||
'function_required' => 'PHP Censor needs to be able to call the %s() function. Is it disabled in php.ini?',
|
||||
'requirements_not_met' => 'PHP Censor cannot be installed, as not all requirements are met.
|
||||
Please review the errors above before continuing.',
|
||||
'must_be_valid_email' => 'Must be a valid email address.',
|
||||
'must_be_valid_url' => 'Must be a valid URL.',
|
||||
'enter_name' => 'Admin Name: ',
|
||||
'enter_email' => 'Admin Email: ',
|
||||
'enter_password' => 'Admin Password: ',
|
||||
'enter_app_url' => 'Your PHP Censor URL ("http://php-censor.local" for example): ',
|
||||
|
||||
'enter_db_host' => 'Please enter your DB host [localhost]: ',
|
||||
'enter_db_name' => 'Please enter your DB database name [php-censor-db]: ',
|
||||
'enter_db_user' => 'Please enter your DB username [php-censor-user]: ',
|
||||
'enter_db_pass' => 'Please enter your DB password: ',
|
||||
'could_not_connect' => 'PHP Censor could not connect to DB with the details provided. Please try again.',
|
||||
'setting_up_db' => 'Setting up your database... ',
|
||||
'user_created' => 'User account created!',
|
||||
'failed_to_create' => 'PHP Censor failed to create your admin account.',
|
||||
'config_exists' => 'The PHP Censor config file exists and is not empty.',
|
||||
'update_instead' => 'If you were trying to update PHP Censor, please use php-censor:update instead.',
|
||||
|
||||
// Update
|
||||
'update_app' => 'Update the database to reflect modified models.',
|
||||
'updating_app' => 'Updating PHP Censor database: ',
|
||||
'not_installed' => 'PHP Censor does not appear to be installed.',
|
||||
'install_instead' => 'Please install PHP Censor via php-censor:install instead.',
|
||||
|
||||
// Poll Command
|
||||
'poll_github' => 'Poll GitHub to check if we need to start a build.',
|
||||
'no_token' => 'No GitHub token found',
|
||||
'finding_projects' => 'Finding projects to poll',
|
||||
'found_n_projects' => 'Found %d projects',
|
||||
'last_commit_is' => 'Last commit to GitHub for %s is %s',
|
||||
'adding_new_build' => 'Last commit is different to database, adding new build.',
|
||||
'finished_processing_builds' => 'Finished processing builds.',
|
||||
|
||||
// Create Admin
|
||||
'create_admin_user' => 'Create an admin user',
|
||||
'incorrect_format' => 'Incorrect format',
|
||||
|
||||
// Create Build Command
|
||||
'create_build_project' => 'Create a build for a project',
|
||||
'project_id_argument' => 'A project ID',
|
||||
'commit_id_option' => 'Commit ID to build',
|
||||
'branch_name_option' => 'Branch to build',
|
||||
'add_to_queue_failed' => 'Build created successfully, but failed to add to build queue. This usually happens
|
||||
when PHP Censor is set to use a beanstalkd server that does not exist,
|
||||
or your beanstalkd server has stopped.',
|
||||
|
||||
// Run Command
|
||||
'run_all_pending' => 'Run all pending PHP Censor builds.',
|
||||
'finding_builds' => 'Finding builds to process',
|
||||
'found_n_builds' => 'Found %d builds',
|
||||
'skipping_build' => 'Skipping Build %d - Project build already in progress.',
|
||||
'marked_as_failed' => 'Build %d marked as failed due to timeout.',
|
||||
|
||||
// Builder
|
||||
'missing_app_yml' => 'This project does not contain a .php-censor.yml (.phpci.yml|phpci.yml) file, or it is empty.',
|
||||
'build_success' => 'BUILD SUCCESS',
|
||||
|
|
|
@ -218,7 +218,6 @@ PHP Censor',
|
|||
'result' => 'Результат',
|
||||
'ok' => 'OK',
|
||||
'took_n_seconds' => 'Заняло секунд: %d',
|
||||
'build_created' => 'Сборка создана',
|
||||
'build_started' => 'Сборка запущена',
|
||||
'build_finished' => 'Сборка окончена',
|
||||
'test_message' => 'Сообщение',
|
||||
|
@ -326,75 +325,12 @@ PHP Censor',
|
|||
'started' => 'Началась',
|
||||
'finished' => 'Закончилась',
|
||||
|
||||
// Installer
|
||||
'installation_url' => 'URL-адрес PHP Censor для установки',
|
||||
'db_host' => 'Хост базы данных',
|
||||
'db_name' => 'Имя базы данных',
|
||||
'db_user' => 'Пользователь базы данных',
|
||||
'db_pass' => 'Пароль базы данных',
|
||||
'admin_name' => 'Имя администратора',
|
||||
'admin_pass' => 'Пароль администратора',
|
||||
'admin_email' => 'Email администратора',
|
||||
'config_path' => 'Путь до файла конфигурации',
|
||||
'install_app' => 'Установить PHP Censor',
|
||||
'welcome_to_app' => 'Добро пожаловать в PHP Censor',
|
||||
'please_answer' => 'Пожалуйста, ответьте на несколько вопросов:',
|
||||
'app_php_req' => 'PHP Censor необходима для работы версия PHP не ниже 5.4.0.',
|
||||
'extension_required' => 'Требуется расширение PHP: %s',
|
||||
'function_required' => 'PHP Censor необходима возможность вызывать %s() функцию. Она выключена в php.ini?',
|
||||
'requirements_not_met' => 'PHP Censor не может быть установлен, пока не все требования выполнены.
|
||||
Пожалуйста, просмотрите возникшие ошибки перед тем, как продолжить.',
|
||||
'must_be_valid_email' => 'Должен быть корректным email-адресом.',
|
||||
'must_be_valid_url' => 'Должен быть корректным URL-адресом.',
|
||||
'enter_name' => 'Имя администратора: ',
|
||||
'enter_email' => 'Email администратора: ',
|
||||
'enter_password' => 'Пароль администратора: ',
|
||||
'enter_app_url' => 'URL-адрес вашего PHP Censor (например: "http://php-censor.local"): ',
|
||||
|
||||
'enter_db_host' => 'Пожалуйста, введите хост DB [localhost]: ',
|
||||
'enter_db_port' => 'Пожалуйста, введите порт DB [3306]: ',
|
||||
'enter_db_name' => 'Пожалуйста, введите имя базы данных DB [php-censor-db]: ',
|
||||
'enter_db_user' => 'Пожалуйста, введите пользователя DB [php-censor-user]: ',
|
||||
'enter_db_pass' => 'Пожалуйста, введите пароль DB: ',
|
||||
'could_not_connect' => 'PHP Censor не может подключится к DB с переданными параметрами. Пожалуйста, попробуйте еще раз.',
|
||||
'setting_up_db' => 'Установка базы данных... ',
|
||||
'user_created' => 'Аккаунт пользователя создан!',
|
||||
'failed_to_create' => 'PHP Censor не удалось создать аккаунт администратора.',
|
||||
'config_exists' => 'Файл конфигурации PHP Censor уже существует, и он не пустой.',
|
||||
'update_instead' => 'Если вы собираетесь обновить PHP Censor, пожалуйста, используйте команду php-censor:update.',
|
||||
|
||||
// Update
|
||||
'update_app' => 'Обновите базу данных с учетом обновленных моделей.',
|
||||
'updating_app' => 'Обновление базы данных PHP Censor: ',
|
||||
'not_installed' => 'PHP Censor не может быть установлен.',
|
||||
'install_instead' => 'Пожалуйста, установите PHP Censor с помощью команды php-censor:install.',
|
||||
|
||||
// Poll Command
|
||||
'poll_github' => 'Опрос GitHub для проверки запуска сборки.',
|
||||
'no_token' => 'GitHub токен не найден',
|
||||
'finding_projects' => 'Поиск проектов для опроса',
|
||||
'found_n_projects' => 'Найдено проектов: %d',
|
||||
'last_commit_is' => 'Последний коммит на GitHub для %s - %s',
|
||||
'adding_new_build' => 'Последний коммит имеет различия с базой данных, создана сборка.',
|
||||
'finished_processing_builds' => 'Процесс сборки завершен.',
|
||||
|
||||
// Create Admin
|
||||
'create_admin_user' => 'Добавить аккаунт администратора',
|
||||
'incorrect_format' => 'Неверный формат',
|
||||
|
||||
// Create Build Command
|
||||
'create_build_project' => 'Создать сборку проекта',
|
||||
'project_id_argument' => 'ID проекта',
|
||||
'commit_id_option' => 'ID коммита для сборки',
|
||||
'branch_name_option' => 'Ветка для сборки',
|
||||
|
||||
// Run Command
|
||||
'run_all_pending' => 'Запустить все ожидающие PHP Censor сборки.',
|
||||
'finding_builds' => 'Поиск сборок для запуска',
|
||||
'found_n_builds' => 'Найдено сборок: %d',
|
||||
'skipping_build' => 'Сборка %d пропущена - Сборка проекта уже идет.',
|
||||
'marked_as_failed' => 'Сборка %d отмечена как неудавшаяся из-за превышения лимита времени.',
|
||||
|
||||
// Builder
|
||||
'missing_app_yml' => 'Этот проект не содержит файла .php-censor.yml (.phpci.yml|phpci.yml), или файл пустой.',
|
||||
'build_success' => 'СБОРКА УСПЕШНА',
|
||||
|
|
|
@ -199,7 +199,6 @@ PHP Censor',
|
|||
'result' => 'Результат',
|
||||
'ok' => 'OK',
|
||||
'took_n_seconds' => 'Зайняло %d секунд',
|
||||
'build_created' => 'Збірка створена',
|
||||
'build_started' => 'Збірка розпочата',
|
||||
'build_finished' => 'Збірка завершена',
|
||||
'test_message' => 'Message',
|
||||
|
@ -286,74 +285,12 @@ PHP Censor',
|
|||
'search_packagist_for_more' => 'Знайти більше пакетів на Packagist',
|
||||
'search' => 'Знайти »',
|
||||
|
||||
// Installer
|
||||
'installation_url' => 'URL встановлення PHP Censor',
|
||||
'db_host' => 'Хост бази даних',
|
||||
'db_name' => 'Назва бази даних',
|
||||
'db_user' => 'Ім’я користувача бази даних',
|
||||
'db_pass' => 'Пароль бази даних',
|
||||
'admin_name' => 'Ім’я адміністратора',
|
||||
'admin_pass' => 'Пароль адміністратора',
|
||||
'admin_email' => 'Email адреса адміністратора',
|
||||
'config_path' => 'Шлях до файла конфігурації',
|
||||
'install_app' => 'Встановити PHP Censor',
|
||||
'welcome_to_app' => 'Ласкаво просимо до PHP Censor',
|
||||
'please_answer' => 'Будь ласка, дайте відповідь на наступні питання:',
|
||||
'app_php_req' => 'PHP Censor вимагає для роботи, принаймні, версію PHP 5.4.0.',
|
||||
'extension_required' => 'Необхідне розширення: %s',
|
||||
'function_required' => 'PHP Censor необхідна можливість викликати функцію %s(). Вона відключена у php.ini?',
|
||||
'requirements_not_met' => 'Неможливо встановити PHP Censor, оскільки не всі вимоги виконані.
|
||||
Будь ласка, продивіться наявні помилки перед тим, як продовжити.',
|
||||
'must_be_valid_email' => 'Повинно бути коректною email адресою.',
|
||||
'must_be_valid_url' => 'Повинно бути коректним URL.',
|
||||
'enter_name' => 'Ім’я адміністратора: ',
|
||||
'enter_email' => 'Email адміністратора: ',
|
||||
'enter_password' => 'Пароль адміністратора: ',
|
||||
'enter_app_url' => 'URL адреса вашого PHP Censor (наприклад, "http://php-censor.local"): ',
|
||||
|
||||
'enter_db_host' => 'Будь ласка, введіть хост DB [localhost]: ',
|
||||
'enter_db_name' => 'Будь ласка, введить ім’я бази даних DB [php-censor-db]: ',
|
||||
'enter_db_user' => 'Будь ласка, введить ім’я користувача DB [php-censor-user]: ',
|
||||
'enter_db_pass' => 'Будь ласка, введить ваш пароль DB: ',
|
||||
'could_not_connect' => 'PHP Censor не може підключитися до DB із наданими параметрами. Будь ласка, спробуйте ще раз.',
|
||||
'setting_up_db' => 'Налаштування вашої бази даних...',
|
||||
'user_created' => 'Аккаунт користувача створено!',
|
||||
'failed_to_create' => 'PHP Censor не вдалося створити ваш аккаунт адміністратора.',
|
||||
'config_exists' => 'Файл конфігурації PHP Censor вже існує та не є порожнім.',
|
||||
'update_instead' => 'Якщо ви збираєтесь оновити PHP Censor, будь ласка, використовуйте команду php-censor:update.',
|
||||
|
||||
// Update
|
||||
'update_app' => 'Оновити базу даних для відображення змінених моделей.',
|
||||
'updating_app' => 'Оновлення бази даних PHP Censor:',
|
||||
'not_installed' => 'Неможливо встановити PHP Censor.',
|
||||
'install_instead' => 'Будь ласка, встановіть PHP Censor через команду php-censor:install.',
|
||||
|
||||
// Poll Command
|
||||
'poll_github' => 'Зробити запит до GitHub для перевірки запуску збірки.',
|
||||
'no_token' => 'GitHub токен не знайдено',
|
||||
'finding_projects' => 'Пошук проектів для запиту',
|
||||
'found_n_projects' => 'Знайдено %d проектів',
|
||||
'last_commit_is' => 'Останній коміт на GitHub для %s - %s',
|
||||
'adding_new_build' => 'Останній коміт має відмінності із базою даних, створена нова збірка.',
|
||||
'finished_processing_builds' => 'Завершено обробку збірок.',
|
||||
|
||||
// Create Admin
|
||||
'create_admin_user' => 'Створити аккаунт адміністратора',
|
||||
'incorrect_format' => 'Невірний формат',
|
||||
|
||||
// Create Build Command
|
||||
'create_build_project' => 'Create a build for a project',
|
||||
'project_id_argument' => 'A project ID',
|
||||
'commit_id_option' => 'Commit ID to build',
|
||||
'branch_name_option' => 'Branch to build',
|
||||
|
||||
// Run Command
|
||||
'run_all_pending' => 'Запустити всі PHP Censor збірки, які очікують.',
|
||||
'finding_builds' => 'Пошук збірок для обробки',
|
||||
'found_n_builds' => 'Знайдено %d збірок',
|
||||
'skipping_build' => 'Збірка %d пропущена - Збірка проекта вже у процесі.',
|
||||
'marked_as_failed' => 'Збірка %d відмічена як невдала через перевищення ліміту часу.',
|
||||
|
||||
// Builder
|
||||
'missing_app_yml' => 'Цей проект не містить файл .php-censor.yml (.phpci.yml|phpci.yml) або він є порожнім.',
|
||||
'build_success' => 'ЗБІРКА УСПІШНА',
|
||||
|
|
|
@ -206,7 +206,6 @@ PHP Censor',
|
|||
'result' => 'Result',
|
||||
'ok' => 'OK',
|
||||
'took_n_seconds' => 'Took %d seconds',
|
||||
'build_created' => 'Build Created',
|
||||
'build_started' => 'Build Started',
|
||||
'build_finished' => 'Build Finished',
|
||||
'test_message' => 'Message',
|
||||
|
@ -301,77 +300,12 @@ PHP Censor',
|
|||
'stage_broken' => 'Broken',
|
||||
'stage_fixed' => 'Fixed',
|
||||
|
||||
// Installer
|
||||
'installation_url' => 'PHP Censor Installation URL',
|
||||
'db_host' => 'Database Host',
|
||||
'db_name' => 'Database Name',
|
||||
'db_user' => 'Database Username',
|
||||
'db_pass' => 'Database Password',
|
||||
'admin_name' => 'Admin Name',
|
||||
'admin_pass' => 'Admin Password',
|
||||
'admin_email' => 'Admin Email Address',
|
||||
'config_path' => 'Config File Path',
|
||||
'install_app' => 'Install PHP Censor',
|
||||
'welcome_to_app' => 'Welcome to PHP Censor',
|
||||
'please_answer' => 'Please answer the following questions:',
|
||||
'app_php_req' => 'PHP Censor requires at least PHP 5.3.8 to function.',
|
||||
'extension_required' => 'Extension required: %s',
|
||||
'function_required' => 'PHP Censor needs to be able to call the %s() function. Is it disabled in php.ini?',
|
||||
'requirements_not_met' => 'PHP Censor cannot be installed, as not all requirements are met.
|
||||
Please review the errors above before continuing.',
|
||||
'must_be_valid_email' => 'Must be a valid email address.',
|
||||
'must_be_valid_url' => 'Must be a valid URL.',
|
||||
'enter_name' => 'Admin Name: ',
|
||||
'enter_email' => 'Admin Email: ',
|
||||
'enter_password' => 'Admin Password: ',
|
||||
'enter_app_url' => 'Your PHP Censor URL ("http://php-censor.local" for example): ',
|
||||
|
||||
'enter_db_host' => 'Please enter your DB host [localhost]: ',
|
||||
'enter_db_name' => 'Please enter your DB database name [php-censor-db]: ',
|
||||
'enter_db_user' => 'Please enter your DB username [php-censor-user]: ',
|
||||
'enter_db_pass' => 'Please enter your DB password: ',
|
||||
'could_not_connect' => 'PHP Censor could not connect to DB with the details provided. Please try again.',
|
||||
'setting_up_db' => 'Setting up your database... ',
|
||||
'user_created' => 'User account created!',
|
||||
'failed_to_create' => 'PHP Censor failed to create your admin account.',
|
||||
'config_exists' => 'The PHP Censor config file exists and is not empty.',
|
||||
'update_instead' => 'If you were trying to update PHP Censor, please use php-censor:update instead.',
|
||||
|
||||
// Update
|
||||
'update_app' => 'Update the database to reflect modified models.',
|
||||
'updating_app' => 'Updating PHP Censor database: ',
|
||||
'not_installed' => 'PHP Censor does not appear to be installed.',
|
||||
'install_instead' => 'Please install PHP Censor via php-censor:install instead.',
|
||||
|
||||
// Poll Command
|
||||
'poll_github' => 'Poll GitHub to check if we need to start a build.',
|
||||
'no_token' => 'No GitHub token found',
|
||||
'finding_projects' => 'Finding projects to poll',
|
||||
'found_n_projects' => 'Found %d projects',
|
||||
'last_commit_is' => 'Last commit to GitHub for %s is %s',
|
||||
'adding_new_build' => 'Last commit is different to database, adding new build.',
|
||||
'finished_processing_builds' => 'Finished processing builds.',
|
||||
|
||||
// Create Admin
|
||||
'create_admin_user' => 'Create an admin user',
|
||||
'incorrect_format' => 'Incorrect format',
|
||||
|
||||
// Create Build Command
|
||||
'create_build_project' => 'Create a build for a project',
|
||||
'project_id_argument' => 'A project ID',
|
||||
'commit_id_option' => 'Commit ID to build',
|
||||
'branch_name_option' => 'Branch to build',
|
||||
'add_to_queue_failed' => 'Build created successfully, but failed to add to build queue. This usually happens
|
||||
when PHP Censor is set to use a beanstalkd server that does not exist,
|
||||
or your beanstalkd server has stopped.',
|
||||
|
||||
// Run Command
|
||||
'run_all_pending' => 'Run all pending PHP Censor builds.',
|
||||
'finding_builds' => 'Finding builds to process',
|
||||
'found_n_builds' => 'Found %d builds',
|
||||
'skipping_build' => 'Skipping Build %d - Project build already in progress.',
|
||||
'marked_as_failed' => 'Build %d marked as failed due to timeout.',
|
||||
|
||||
// Builder
|
||||
'missing_app_yml' => 'This project does not contain a .php-censor.yml (.phpci.yml|phpci.yml) file, or it is empty.',
|
||||
'build_success' => 'BUILD SUCCESS',
|
||||
|
|
|
@ -21,7 +21,7 @@ use Symfony\Component\Yaml\Parser as YamlParser;
|
|||
*/
|
||||
class Build extends BuildBase
|
||||
{
|
||||
const STATUS_NEW = 0;
|
||||
const STATUS_PENDING = 0;
|
||||
const STATUS_RUNNING = 1;
|
||||
const STATUS_SUCCESS = 2;
|
||||
const STATUS_FAILED = 3;
|
||||
|
@ -272,9 +272,9 @@ class Build extends BuildBase
|
|||
|
||||
if (is_link($buildPath)) {
|
||||
// Remove the symlink without using recursive.
|
||||
exec(sprintf(IS_WIN ? 'rmdir /S /Q "%s"' : 'rm "%s"', $buildPath));
|
||||
exec(sprintf('rm "%s"', $buildPath));
|
||||
} else {
|
||||
exec(sprintf(IS_WIN ? 'rmdir /S /Q "%s"' : 'rm -Rf "%s"', $buildPath));
|
||||
exec(sprintf('rm -Rf "%s"', $buildPath));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -47,9 +47,6 @@ class LocalBuild extends Build
|
|||
return $this->handleSymlink($builder, $reference, $buildPath);
|
||||
} else {
|
||||
$cmd = 'cp -Rf "%s" "%s/"';
|
||||
if (IS_WIN) {
|
||||
$cmd = 'xcopy /E /Y "%s" "%s/*"';
|
||||
}
|
||||
$builder->executeCommand($cmd, $reference, $buildPath);
|
||||
}
|
||||
|
||||
|
|
|
@ -77,11 +77,8 @@ class RemoteGitBuild extends Build
|
|||
*/
|
||||
protected function cloneBySsh(Builder $builder, $cloneTo)
|
||||
{
|
||||
$keyFile = $this->writeSshKey($cloneTo);
|
||||
|
||||
if (!IS_WIN) {
|
||||
$gitSshWrapper = $this->writeSshWrapper($cloneTo, $keyFile);
|
||||
}
|
||||
$keyFile = $this->writeSshKey($cloneTo);
|
||||
$gitSshWrapper = $this->writeSshWrapper($cloneTo, $keyFile);
|
||||
|
||||
// Do the git clone:
|
||||
$cmd = 'git clone --recursive ';
|
||||
|
@ -93,10 +90,7 @@ class RemoteGitBuild extends Build
|
|||
}
|
||||
|
||||
$cmd .= ' -b %s %s "%s"';
|
||||
|
||||
if (!IS_WIN) {
|
||||
$cmd = 'export GIT_SSH="'.$gitSshWrapper.'" && ' . $cmd;
|
||||
}
|
||||
$cmd = 'export GIT_SSH="'.$gitSshWrapper.'" && ' . $cmd;
|
||||
|
||||
$success = $builder->executeCommand($cmd, $this->getBranch(), $this->getCloneUrl(), $cloneTo);
|
||||
|
||||
|
@ -106,9 +100,7 @@ class RemoteGitBuild extends Build
|
|||
|
||||
// Remove the key file and git wrapper:
|
||||
unlink($keyFile);
|
||||
if (!IS_WIN) {
|
||||
unlink($gitSshWrapper);
|
||||
}
|
||||
unlink($gitSshWrapper);
|
||||
|
||||
return $success;
|
||||
}
|
||||
|
@ -122,9 +114,8 @@ class RemoteGitBuild extends Build
|
|||
protected function postCloneSetup(Builder $builder, $cloneTo)
|
||||
{
|
||||
$success = true;
|
||||
$commit = $this->getCommitId();
|
||||
|
||||
$chdir = IS_WIN ? 'cd /d "%s"' : 'cd "%s"';
|
||||
$commit = $this->getCommitId();
|
||||
$chdir = 'cd "%s"';
|
||||
|
||||
if (!empty($commit) && $commit != 'Manual') {
|
||||
$cmd = $chdir . ' && git checkout %s --quiet';
|
||||
|
|
|
@ -119,19 +119,15 @@ class SubversionBuild extends Build
|
|||
{
|
||||
$cmd = $this->svnCommand . ' %s "%s"';
|
||||
|
||||
if (!IS_WIN) {
|
||||
$keyFile = $this->writeSshKey($cloneTo);
|
||||
$sshWrapper = $this->writeSshWrapper($cloneTo, $keyFile);
|
||||
$cmd = 'export SVN_SSH="' . $sshWrapper . '" && ' . $cmd;
|
||||
}
|
||||
$keyFile = $this->writeSshKey($cloneTo);
|
||||
$sshWrapper = $this->writeSshWrapper($cloneTo, $keyFile);
|
||||
$cmd = 'export SVN_SSH="' . $sshWrapper . '" && ' . $cmd;
|
||||
|
||||
$success = $builder->executeCommand($cmd, $this->getCloneUrl(), $cloneTo);
|
||||
|
||||
if (!IS_WIN) {
|
||||
// Remove the key file and svn wrapper:
|
||||
unlink($keyFile);
|
||||
unlink($sshWrapper);
|
||||
}
|
||||
// Remove the key file and svn wrapper:
|
||||
unlink($keyFile);
|
||||
unlink($sshWrapper);
|
||||
|
||||
return $success;
|
||||
}
|
||||
|
|
|
@ -49,9 +49,7 @@ class CleanBuild extends Plugin
|
|||
public function execute()
|
||||
{
|
||||
$cmd = 'rm -Rf "%s"';
|
||||
if (IS_WIN) {
|
||||
$cmd = 'rmdir /S /Q "%s"';
|
||||
}
|
||||
|
||||
$this->builder->executeCommand($cmd, $this->builder->buildPath . 'composer.phar');
|
||||
$this->builder->executeCommand($cmd, $this->builder->buildPath . 'composer.lock');
|
||||
|
||||
|
|
|
@ -129,10 +129,6 @@ class Codeception extends Plugin implements ZeroConfigPluginInterface
|
|||
|
||||
$cmd = 'cd "%s" && ' . $codeception . ' run -c "%s" --xml ' . $this->args;
|
||||
|
||||
if (IS_WIN) {
|
||||
$cmd = 'cd /d "%s" && ' . $codeception . ' run -c "%s" --xml ' . $this->args;
|
||||
}
|
||||
|
||||
$configPath = $this->builder->buildPath . $configPath;
|
||||
$success = $this->builder->executeCommand($cmd, $this->builder->buildPath, $configPath);
|
||||
|
||||
|
|
|
@ -104,14 +104,7 @@ class Composer extends Plugin implements ZeroConfigPluginInterface
|
|||
public function execute()
|
||||
{
|
||||
$composerLocation = $this->builder->findBinary(['composer', 'composer.phar']);
|
||||
|
||||
$cmd = '';
|
||||
|
||||
if (IS_WIN) {
|
||||
$cmd = 'php ';
|
||||
}
|
||||
|
||||
$cmd .= $composerLocation . ' --no-ansi --no-interaction ';
|
||||
$cmd = $composerLocation . ' --no-ansi --no-interaction ';
|
||||
|
||||
if ($this->preferDist) {
|
||||
$this->builder->log('Using --prefer-dist flag');
|
||||
|
|
|
@ -62,9 +62,6 @@ class CopyBuild extends Plugin
|
|||
$this->wipeExistingDirectory();
|
||||
|
||||
$cmd = 'mkdir -p "%s" && cp -R "%s" "%s"';
|
||||
if (IS_WIN) {
|
||||
$cmd = 'mkdir -p "%s" && xcopy /E "%s" "%s"';
|
||||
}
|
||||
|
||||
$success = $this->builder->executeCommand($cmd, $this->directory, $build, $this->directory);
|
||||
|
||||
|
@ -97,9 +94,6 @@ class CopyBuild extends Plugin
|
|||
if ($this->ignore) {
|
||||
foreach ($this->builder->ignore as $file) {
|
||||
$cmd = 'rm -Rf "%s/%s"';
|
||||
if (IS_WIN) {
|
||||
$cmd = 'rmdir /S /Q "%s\%s"';
|
||||
}
|
||||
$this->builder->executeCommand($cmd, $this->directory, $file);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -74,18 +74,12 @@ class Grunt extends Plugin
|
|||
{
|
||||
// if npm does not work, we cannot use grunt, so we return false
|
||||
$cmd = 'cd %s && npm install';
|
||||
if (IS_WIN) {
|
||||
$cmd = 'cd /d %s && npm install';
|
||||
}
|
||||
if (!$this->builder->executeCommand($cmd, $this->directory)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// build the grunt command
|
||||
$cmd = 'cd %s && ' . $this->grunt;
|
||||
if (IS_WIN) {
|
||||
$cmd = 'cd /d %s && ' . $this->grunt;
|
||||
}
|
||||
$cmd .= ' --no-color';
|
||||
$cmd .= ' --gruntfile %s';
|
||||
$cmd .= ' %s'; // the task that will be executed
|
||||
|
|
|
@ -74,18 +74,12 @@ class Gulp extends Plugin
|
|||
{
|
||||
// if npm does not work, we cannot use gulp, so we return false
|
||||
$cmd = 'cd %s && npm install';
|
||||
if (IS_WIN) {
|
||||
$cmd = 'cd /d %s && npm install';
|
||||
}
|
||||
if (!$this->builder->executeCommand($cmd, $this->directory)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// build the gulp command
|
||||
$cmd = 'cd %s && ' . $this->gulp;
|
||||
if (IS_WIN) {
|
||||
$cmd = 'cd /d %s && ' . $this->gulp;
|
||||
}
|
||||
$cmd .= ' --no-color';
|
||||
$cmd .= ' --gulpfile %s';
|
||||
$cmd .= ' %s'; // the task that will be executed
|
||||
|
|
|
@ -93,7 +93,6 @@ class Executor
|
|||
$plugins = $branchConfig[$stage];
|
||||
|
||||
$runOption = 'after';
|
||||
|
||||
if (!empty($branchConfig['run-option'])) {
|
||||
$runOption = $branchConfig['run-option'];
|
||||
}
|
||||
|
|
|
@ -55,11 +55,10 @@ class Wipe extends Plugin
|
|||
}
|
||||
if (is_dir($this->directory)) {
|
||||
$cmd = 'rm -Rf "%s"';
|
||||
if (IS_WIN) {
|
||||
$cmd = 'rmdir /S /Q "%s"';
|
||||
}
|
||||
|
||||
return $this->builder->executeCommand($cmd, $this->directory);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,18 +42,14 @@ class Factory
|
|||
* Check PosixProcessControl, WindowsProcessControl and UnixProcessControl, in that order.
|
||||
*
|
||||
* @return ProcessControlInterface
|
||||
*
|
||||
* @internal
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function createProcessControl()
|
||||
{
|
||||
switch (true) {
|
||||
case PosixProcessControl::isAvailable():
|
||||
return new PosixProcessControl();
|
||||
|
||||
case WindowsProcessControl::isAvailable():
|
||||
return new WindowsProcessControl();
|
||||
|
||||
case UnixProcessControl::isAvailable():
|
||||
return new UnixProcessControl();
|
||||
}
|
||||
|
|
|
@ -1,56 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* PHPCI - Continuous Integration for PHP
|
||||
*
|
||||
* @copyright Copyright 2015, Block 8 Limited.
|
||||
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
|
||||
* @link https://www.phptesting.org/
|
||||
*/
|
||||
|
||||
namespace PHPCensor\ProcessControl;
|
||||
|
||||
/**
|
||||
* Control processes using the "tasklist" and "taskkill" commands.
|
||||
*
|
||||
* @author Adirelle <adirelle@gmail.com>
|
||||
*/
|
||||
class WindowsProcessControl implements ProcessControlInterface
|
||||
{
|
||||
/**
|
||||
* Check if the process is running using the "tasklist" command.
|
||||
*
|
||||
* @param integer $pid
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function kill($pid, $forcefully = false)
|
||||
{
|
||||
$result = 1;
|
||||
|
||||
exec(sprintf("taskkill /t /pid %d %s 2>nul:", $pid, $forcefully ? '/f' : ''));
|
||||
|
||||
return !$result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check whether the commands "tasklist" and "taskkill" are available.
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
public static function isAvailable()
|
||||
{
|
||||
return DIRECTORY_SEPARATOR === '\\' && exec("where tasklist") && exec("where taskkill");
|
||||
}
|
||||
}
|
|
@ -14,6 +14,7 @@ use b8\Store\Factory;
|
|||
use PHPCensor\Model\User;
|
||||
use PHPCensor\Security\Authentication\LoginPasswordProviderInterface;
|
||||
use PHPCensor\Service\UserService;
|
||||
use PHPCensor\Store\UserStore;
|
||||
|
||||
/**
|
||||
* Ldap user provider.
|
||||
|
@ -68,11 +69,13 @@ class Ldap extends AbstractProvider implements LoginPasswordProviderInterface
|
|||
|
||||
public function provisionUser($identifier)
|
||||
{
|
||||
$userService = new UserService(Factory::getStore('User'));
|
||||
/** @var UserStore $user */
|
||||
$user = Factory::getStore('User');
|
||||
$userService = new UserService($user);
|
||||
|
||||
$parts = explode("@", $identifier);
|
||||
$username = $parts[0];
|
||||
|
||||
return $userService->createUserWithProvider($username, $identifier, $this->key, null);
|
||||
return $userService->createUser($username, $identifier, $this->key, json_encode($this->config), '', false);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -105,7 +105,7 @@ class BuildStatusService
|
|||
{
|
||||
if (in_array($this->build->getStatus(), $this->finishedStatusIds)) {
|
||||
return 'Sleeping';
|
||||
} elseif ($this->build->getStatus() == Build::STATUS_NEW) {
|
||||
} elseif ($this->build->getStatus() == Build::STATUS_PENDING) {
|
||||
return 'Pending';
|
||||
} elseif ($this->build->getStatus() == Build::STATUS_RUNNING) {
|
||||
return 'Building';
|
||||
|
|
|
@ -35,46 +35,21 @@ class UserService
|
|||
/**
|
||||
* Create a new user within PHPCI.
|
||||
*
|
||||
* @param string $name
|
||||
* @param string $emailAddress
|
||||
* @param string $password
|
||||
* @param bool $isAdmin
|
||||
* @param string $language
|
||||
* @param integer $perPage
|
||||
* @param string $name
|
||||
* @param string $email
|
||||
* @param string $providerKey
|
||||
* @param string $providerData
|
||||
* @param string $password
|
||||
* @param bool $isAdmin
|
||||
*
|
||||
* @return User
|
||||
*/
|
||||
public function createUser($name, $emailAddress, $password, $isAdmin = false, $language = null, $perPage = null)
|
||||
public function createUser($name, $email, $providerKey, $providerData, $password, $isAdmin = false)
|
||||
{
|
||||
$user = new User();
|
||||
$user->setName($name);
|
||||
$user->setEmail($emailAddress);
|
||||
$user->setEmail($email);
|
||||
$user->setHash(password_hash($password, PASSWORD_DEFAULT));
|
||||
$user->setIsAdmin(($isAdmin ? 1 : 0));
|
||||
$user->setLanguage($language);
|
||||
$user->setPerPage($perPage);
|
||||
|
||||
return $this->store->save($user);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new user within PHPCI (with provider).
|
||||
*
|
||||
* @param $name
|
||||
* @param $emailAddress
|
||||
* @param $providerKey
|
||||
* @param $providerData
|
||||
* @param bool $isAdmin
|
||||
*
|
||||
* @return \PHPCI\Model\User
|
||||
*/
|
||||
|
||||
public function createUserWithProvider($name, $emailAddress, $providerKey, $providerData, $isAdmin = false)
|
||||
{
|
||||
$user = new User();
|
||||
$user->setName($name);
|
||||
$user->setEmail($emailAddress);
|
||||
$user->setHash("");
|
||||
$user->setProviderKey($providerKey);
|
||||
$user->setProviderData($providerData);
|
||||
$user->setIsAdmin(($isAdmin ? 1 : 0));
|
||||
|
|
|
@ -85,7 +85,14 @@ class BuildStoreBase extends Store
|
|||
|
||||
/**
|
||||
* Get multiple Build by Status.
|
||||
*
|
||||
* @param $value
|
||||
* @param int $limit
|
||||
* @param string $useConnection
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @throws HttpException
|
||||
*/
|
||||
public function getByStatus($value, $limit = 1000, $useConnection = 'read')
|
||||
{
|
||||
|
@ -93,7 +100,6 @@ class BuildStoreBase extends Store
|
|||
throw new HttpException('Value passed to ' . __FUNCTION__ . ' cannot be null.');
|
||||
}
|
||||
|
||||
|
||||
$query = 'SELECT * FROM {{build}} WHERE {{status}} = :status LIMIT :limit';
|
||||
$stmt = Database::getConnection($useConnection)->prepareCommon($query);
|
||||
$stmt->bindValue(':status', $value);
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<h4>
|
||||
<?php print $build->getProject()->getTitle(); ?>
|
||||
|
||||
<?php if ($build->getStatus() == \PHPCensor\Model\Build::STATUS_NEW): ?>
|
||||
<?php if ($build->getStatus() == \PHPCensor\Model\Build::STATUS_PENDING): ?>
|
||||
<small class="pull-right"><?php Lang::out('created_x', $build->getCreated()->format('H:i')); ?></small>
|
||||
<?php elseif ($build->getStatus() == \PHPCensor\Model\Build::STATUS_RUNNING): ?>
|
||||
<small class="pull-right"><?php Lang::out('started_x', $build->getStarted()->format('H:i')); ?></small>
|
||||
|
|
|
@ -140,7 +140,7 @@
|
|||
</div>
|
||||
|
||||
<div class="tab-pane" id="errors">
|
||||
<table class="errors-table table">
|
||||
<table class="errors-table table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php Lang::out('severity'); ?></th>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
</div>
|
||||
|
||||
<div class="box">
|
||||
<table class="table">
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php Lang::out('group_title'); ?></th>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<?php
|
||||
foreach ($builds as $build):
|
||||
switch ($build->getStatus()) {
|
||||
case \PHPCensor\Model\Build::STATUS_NEW:
|
||||
case \PHPCensor\Model\Build::STATUS_PENDING:
|
||||
$updated = $build->getCreated();
|
||||
$label = Lang::get('pending');
|
||||
$color = 'blue';
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
<?php
|
||||
foreach ($builds as $build):
|
||||
switch ($build->getStatus()) {
|
||||
case \PHPCensor\Model\Build::STATUS_NEW:
|
||||
case \PHPCensor\Model\Build::STATUS_PENDING:
|
||||
$updated = $build->getCreated();
|
||||
$label = Lang::get('pending');
|
||||
$color = 'blue';
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
<div class="box-header">
|
||||
<h3 class="box-title"><?php Lang::out('builds'); ?> (<?php print $total; ?>)</h3>
|
||||
</div>
|
||||
<table class="table">
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php Lang::out('id'); ?></th>
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<div class="col-xs-12">
|
||||
<div class="box">
|
||||
|
||||
<table class="table">
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php Lang::out('email_address'); ?></th>
|
||||
|
|
|
@ -59,8 +59,8 @@ class BuildWorker
|
|||
*/
|
||||
public function __construct($host, $queue)
|
||||
{
|
||||
$this->host = $host;
|
||||
$this->queue = $queue;
|
||||
$this->host = $host;
|
||||
$this->queue = $queue;
|
||||
$this->pheanstalk = new Pheanstalk($this->host);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,13 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* PHPCI - Continuous Integration for PHP
|
||||
*
|
||||
* @copyright Copyright 2015, Block 8 Limited.
|
||||
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
|
||||
* @link https://www.phptesting.org/
|
||||
*/
|
||||
|
||||
namespace Tests\PHPCensor\Plugin\Command;
|
||||
|
||||
use Symfony\Component\Console\Application;
|
||||
|
@ -17,6 +9,7 @@ use Symfony\Component\Console\Helper\HelperSet;
|
|||
class InstallCommandTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
public $config;
|
||||
|
||||
public $admin;
|
||||
|
||||
/**
|
||||
|
@ -101,13 +94,13 @@ class InstallCommandTest extends \PHPUnit_Framework_TestCase
|
|||
'--db-port' => '3306',
|
||||
'--db-name' => 'php-censor-db',
|
||||
'--db-user' => 'php-censor-user',
|
||||
'--db-pass' => 'php-censor-password',
|
||||
'--db-password' => 'php-censor-password',
|
||||
'--db-type' => 'mysql',
|
||||
'--admin-mail' => 'admin@php-censor.local',
|
||||
'--admin-email' => 'admin@php-censor.local',
|
||||
'--admin-name' => 'admin',
|
||||
'--admin-pass' => 'admin-password',
|
||||
'--admin-password' => 'admin-password',
|
||||
'--url' => 'http://php-censor.local',
|
||||
'--queue-disabled' => null,
|
||||
'--queue-use' => false,
|
||||
];
|
||||
|
||||
if (!is_null($exclude)) {
|
||||
|
@ -125,7 +118,7 @@ class InstallCommandTest extends \PHPUnit_Framework_TestCase
|
|||
|
||||
// Get tester and execute with extracted parameters.
|
||||
$commandTester = $this->getCommandTester($dialog);
|
||||
$parameters = $this->getConfig($param);
|
||||
$parameters = $this->getConfig($param);
|
||||
$commandTester->execute($parameters);
|
||||
}
|
||||
|
||||
|
@ -137,7 +130,20 @@ class InstallCommandTest extends \PHPUnit_Framework_TestCase
|
|||
$this->executeWithoutParam(null, $dialog);
|
||||
}
|
||||
|
||||
public function testDatabaseHostnameConfig()
|
||||
public function testDatabaseTypeConfig()
|
||||
{
|
||||
$dialog = $this->getHelperMock();
|
||||
|
||||
// We specified an input value for hostname.
|
||||
$dialog->expects($this->once())->method('ask')->willReturn('testedvalue');
|
||||
|
||||
$this->executeWithoutParam('--db-type', $dialog);
|
||||
|
||||
// Check that specified arguments are correctly loaded.
|
||||
$this->assertEquals('testedvalue', $this->config['b8']['database']['type']);
|
||||
}
|
||||
|
||||
public function testDatabaseHostConfig()
|
||||
{
|
||||
$dialog = $this->getHelperMock();
|
||||
|
||||
|
@ -151,6 +157,34 @@ class InstallCommandTest extends \PHPUnit_Framework_TestCase
|
|||
$this->assertEquals('testedvalue', $this->config['b8']['database']['servers']['write'][0]['host']);
|
||||
}
|
||||
|
||||
public function testDatabaseStringPortConfig()
|
||||
{
|
||||
$dialog = $this->getHelperMock();
|
||||
|
||||
// We specified an input value for hostname.
|
||||
$dialog->expects($this->once())->method('ask')->willReturn('testedvalue');
|
||||
|
||||
$this->executeWithoutParam('--db-port', $dialog);
|
||||
|
||||
// Check that specified arguments are correctly loaded.
|
||||
$this->assertArrayNotHasKey('port', $this->config['b8']['database']['servers']['read'][0]);
|
||||
$this->assertArrayNotHasKey('port', $this->config['b8']['database']['servers']['write'][0]);
|
||||
}
|
||||
|
||||
public function testDatabasePortConfig()
|
||||
{
|
||||
$dialog = $this->getHelperMock();
|
||||
|
||||
// We specified an input value for hostname.
|
||||
$dialog->expects($this->once())->method('ask')->willReturn('333');
|
||||
|
||||
$this->executeWithoutParam('--db-port', $dialog);
|
||||
|
||||
// Check that specified arguments are correctly loaded.
|
||||
$this->assertEquals(333, $this->config['b8']['database']['servers']['read'][0]['port']);
|
||||
$this->assertEquals(333, $this->config['b8']['database']['servers']['write'][0]['port']);
|
||||
}
|
||||
|
||||
public function testDatabaseNameConfig()
|
||||
{
|
||||
$dialog = $this->getHelperMock();
|
||||
|
@ -183,7 +217,7 @@ class InstallCommandTest extends \PHPUnit_Framework_TestCase
|
|||
|
||||
$dialog->expects($this->once())->method('ask')->willReturn('testedvalue');
|
||||
|
||||
$this->executeWithoutParam('--db-pass', $dialog);
|
||||
$this->executeWithoutParam('--db-password', $dialog);
|
||||
|
||||
// Check that specified arguments are correctly loaded.
|
||||
$this->assertEquals('testedvalue', $this->config['b8']['database']['password']);
|
||||
|
@ -209,10 +243,10 @@ class InstallCommandTest extends \PHPUnit_Framework_TestCase
|
|||
// We specified an input value for hostname.
|
||||
$dialog->expects($this->once())->method('ask')->willReturn('admin@php-censor.local');
|
||||
|
||||
$this->executeWithoutParam('--admin-mail', $dialog);
|
||||
$this->executeWithoutParam('--admin-email', $dialog);
|
||||
|
||||
// Check that specified arguments are correctly loaded.
|
||||
$this->assertEquals('admin@php-censor.local', $this->admin['mail']);
|
||||
$this->assertEquals('admin@php-censor.local', $this->admin['email']);
|
||||
}
|
||||
|
||||
public function testAdminNameConfig()
|
||||
|
@ -235,9 +269,9 @@ class InstallCommandTest extends \PHPUnit_Framework_TestCase
|
|||
// We specified an input value for hostname.
|
||||
$dialog->expects($this->once())->method('ask')->willReturn('testedvalue');
|
||||
|
||||
$this->executeWithoutParam('--admin-pass', $dialog);
|
||||
$this->executeWithoutParam('--admin-password', $dialog);
|
||||
|
||||
// Check that specified arguments are correctly loaded.
|
||||
$this->assertEquals('testedvalue', $this->admin['pass']);
|
||||
$this->assertEquals('testedvalue', $this->admin['password']);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,17 +21,11 @@ class CommandExecutorTest extends \PHPUnit_Framework_TestCase
|
|||
|
||||
protected function setUp()
|
||||
{
|
||||
if (IS_WIN) {
|
||||
$this->markTestSkipped("Cannot test UnixCommandExecutor on ".PHP_OS);
|
||||
return;
|
||||
}
|
||||
parent::setUp();
|
||||
|
||||
$mockBuildLogger = $this->prophesize('PHPCensor\Logging\BuildLogger');
|
||||
|
||||
$class = IS_WIN
|
||||
? 'PHPCensor\Helper\WindowsCommandExecutor'
|
||||
: 'PHPCensor\Helper\UnixCommandExecutor';
|
||||
$class = 'PHPCensor\Helper\UnixCommandExecutor';
|
||||
$this->testedExecutor = new $class($mockBuildLogger->reveal(), __DIR__);
|
||||
}
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ class BuildTest extends \PHPUnit_Framework_TestCase
|
|||
public function testExecute_TestIsSuccessful()
|
||||
{
|
||||
$build = new Build();
|
||||
$build->setStatus(Build::STATUS_NEW);
|
||||
$build->setStatus(Build::STATUS_PENDING);
|
||||
$this->assertFalse($build->isSuccessful());
|
||||
|
||||
$build->setStatus(Build::STATUS_RUNNING);
|
||||
|
|
|
@ -1,22 +0,0 @@
|
|||
<?php
|
||||
namespace Tests\PHPCensor\ProcessControl;
|
||||
|
||||
use PHPCensor\ProcessControl\WindowsProcessControl;
|
||||
|
||||
class WindowsProcessControlTest extends ProcessControlTest
|
||||
{
|
||||
protected function setUp()
|
||||
{
|
||||
$this->object = new WindowsProcessControl();
|
||||
}
|
||||
|
||||
public function getTestCommand()
|
||||
{
|
||||
return "pause";
|
||||
}
|
||||
|
||||
public function testIsAvailable()
|
||||
{
|
||||
$this->assertEquals(DIRECTORY_SEPARATOR === '\\', WindowsProcessControl::isAvailable());
|
||||
}
|
||||
}
|
|
@ -14,17 +14,11 @@ use PHPCensor\Security\Authentication\Service;
|
|||
|
||||
class ServiceTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @covers Service::getInstance
|
||||
*/
|
||||
public function testGetInstance()
|
||||
{
|
||||
$this->assertInstanceOf('\PHPCensor\Security\Authentication\Service', Service::getInstance());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Service::buildProvider
|
||||
*/
|
||||
public function testBuildBuiltinProvider()
|
||||
{
|
||||
$provider = Service::buildProvider('test', ['type' => 'internal']);
|
||||
|
@ -32,9 +26,6 @@ class ServiceTest extends \PHPUnit_Framework_TestCase
|
|||
$this->assertInstanceOf('\PHPCensor\Security\Authentication\UserProvider\Internal', $provider);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Service::buildProvider
|
||||
*/
|
||||
public function testBuildAnyProvider()
|
||||
{
|
||||
$config = ['type' => '\Tests\PHPCensor\Security\Authentication\DummyProvider'];
|
||||
|
@ -45,9 +36,6 @@ class ServiceTest extends \PHPUnit_Framework_TestCase
|
|||
$this->assertEquals($config, $provider->config);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Service::getProviders
|
||||
*/
|
||||
public function testGetProviders()
|
||||
{
|
||||
$a = $this->prophesize('\PHPCensor\Security\Authentication\UserProviderInterface')->reveal();
|
||||
|
@ -59,9 +47,6 @@ class ServiceTest extends \PHPUnit_Framework_TestCase
|
|||
$this->assertEquals($providers, $service->getProviders());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Service::getLoginPasswordProviders
|
||||
*/
|
||||
public function testGetLoginPasswordProviders()
|
||||
{
|
||||
$a = $this->prophesize('\PHPCensor\Security\Authentication\UserProviderInterface')->reveal();
|
||||
|
|
|
@ -27,9 +27,6 @@ class InternalTest extends \PHPUnit_Framework_TestCase
|
|||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Internal::verifyPassword
|
||||
*/
|
||||
public function testVerifyPassword()
|
||||
{
|
||||
$user = new User();
|
||||
|
@ -39,9 +36,6 @@ class InternalTest extends \PHPUnit_Framework_TestCase
|
|||
$this->assertTrue($this->provider->verifyPassword($user, $password));
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Internal::verifyPassword
|
||||
*/
|
||||
public function testVerifyInvaldPassword()
|
||||
{
|
||||
$user = new User();
|
||||
|
@ -51,17 +45,11 @@ class InternalTest extends \PHPUnit_Framework_TestCase
|
|||
$this->assertFalse($this->provider->verifyPassword($user, 'bar'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Internal::checkRequirements
|
||||
*/
|
||||
public function testCheckRequirements()
|
||||
{
|
||||
$this->provider->checkRequirements();
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Internal::provisionUser
|
||||
*/
|
||||
public function testProvisionUser()
|
||||
{
|
||||
$this->assertNull($this->provider->provisionUser('john@doe.com'));
|
||||
|
|
|
@ -50,7 +50,7 @@ class BuildServiceTest extends \PHPUnit_Framework_TestCase
|
|||
$returnValue = $this->testedService->createBuild($project);
|
||||
|
||||
$this->assertEquals(101, $returnValue->getProjectId());
|
||||
$this->assertEquals(Build::STATUS_NEW, $returnValue->getStatus());
|
||||
$this->assertEquals(Build::STATUS_PENDING, $returnValue->getStatus());
|
||||
$this->assertNull($returnValue->getStarted());
|
||||
$this->assertNull($returnValue->getFinished());
|
||||
$this->assertNull($returnValue->getLog());
|
||||
|
@ -108,7 +108,7 @@ class BuildServiceTest extends \PHPUnit_Framework_TestCase
|
|||
$this->assertEquals($build->getProjectId(), $returnValue->getProjectId());
|
||||
$this->assertEquals($build->getCommitId(), $returnValue->getCommitId());
|
||||
$this->assertNotEquals($build->getStatus(), $returnValue->getStatus());
|
||||
$this->assertEquals(Build::STATUS_NEW, $returnValue->getStatus());
|
||||
$this->assertEquals(Build::STATUS_PENDING, $returnValue->getStatus());
|
||||
$this->assertNull($returnValue->getLog());
|
||||
$this->assertEquals($build->getBranch(), $returnValue->getBranch());
|
||||
$this->assertNotEquals($build->getCreated(), $returnValue->getCreated());
|
||||
|
|
|
@ -80,7 +80,7 @@ class BuildStatusServiceTest extends \PHPUnit_Framework_TestCase
|
|||
'previousBuild' => null,
|
||||
],
|
||||
'5' => [
|
||||
'status' => Build::STATUS_NEW,
|
||||
'status' => Build::STATUS_PENDING,
|
||||
'id' => 1000,
|
||||
'finishDateTime' => '2014-12-25 21:12:21',
|
||||
'previousBuild' => 3,
|
||||
|
|
|
@ -42,7 +42,14 @@ class UserServiceTest extends \PHPUnit_Framework_TestCase
|
|||
|
||||
public function testExecute_CreateNonAdminUser()
|
||||
{
|
||||
$user = $this->testedService->createUser('Test', 'test@example.com', 'testing', 0);
|
||||
$user = $this->testedService->createUser(
|
||||
'Test',
|
||||
'test@example.com',
|
||||
'default',
|
||||
json_encode(['type' => 'internal']),
|
||||
'testing',
|
||||
false
|
||||
);
|
||||
|
||||
$this->assertEquals('Test', $user->getName());
|
||||
$this->assertEquals('test@example.com', $user->getEmail());
|
||||
|
@ -52,7 +59,15 @@ class UserServiceTest extends \PHPUnit_Framework_TestCase
|
|||
|
||||
public function testExecute_CreateAdminUser()
|
||||
{
|
||||
$user = $this->testedService->createUser('Test', 'test@example.com', 'testing', 1);
|
||||
$user = $this->testedService->createUser(
|
||||
'Test',
|
||||
'test@example.com',
|
||||
'default',
|
||||
json_encode(['type' => 'internal']),
|
||||
'testing',
|
||||
true
|
||||
);
|
||||
|
||||
$this->assertEquals(1, $user->getIsAdmin());
|
||||
}
|
||||
|
||||
|
|
|
@ -7,8 +7,6 @@
|
|||
* @link http://www.phptesting.org/
|
||||
*/
|
||||
|
||||
use PHPCensor\Logging\LoggerConfig;
|
||||
|
||||
if (!defined('ROOT_DIR')) {
|
||||
define('ROOT_DIR', dirname(__DIR__) . DIRECTORY_SEPARATOR);
|
||||
}
|
||||
|
@ -33,16 +31,8 @@ if (!defined('RUNTIME_DIR')) {
|
|||
define('RUNTIME_DIR', ROOT_DIR . 'runtime' . DIRECTORY_SEPARATOR);
|
||||
}
|
||||
|
||||
if (!defined('IS_WIN')) {
|
||||
define('IS_WIN', ((strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') ? true : false));
|
||||
}
|
||||
|
||||
require_once(ROOT_DIR . 'vendor/autoload.php');
|
||||
|
||||
if (defined('IS_CONSOLE') && IS_CONSOLE) {
|
||||
$loggerConfig = LoggerConfig::newFromFile(APP_DIR . "loggerconfig.php");
|
||||
}
|
||||
|
||||
// Load configuration if present:
|
||||
$conf = [];
|
||||
$conf['b8']['app']['namespace'] = 'PHPCensor';
|
||||
|
@ -60,8 +50,4 @@ if (!defined('APP_URL') && !empty($config)) {
|
|||
define('APP_URL', $config->get('php-censor.url', '') . '/');
|
||||
}
|
||||
|
||||
if (!defined('IS_CONSOLE')) {
|
||||
define('IS_CONSOLE', false);
|
||||
}
|
||||
|
||||
\PHPCensor\Helper\Lang::init($config, 'en');
|
||||
|
|
Loading…
Reference in a new issue