Fixed configs

This commit is contained in:
Dmitry Khomutov 2016-05-19 21:25:43 +06:00
parent 1596e274a9
commit 0a70c89e75
3 changed files with 86 additions and 64 deletions

16
.gitignore vendored
View file

@ -1,20 +1,8 @@
/.idea
/vendor/
/vendor
/composer.phar
/.DS_Store
/.settings
/.project
/.buildpath
/app/config.yml
/runtime/builds
/runtime/daemon
/public/.htaccess
/cache
/app/loggerconfig.php
/app/pluginconfig.php
/src/PHPCI/Model/Migration.php
/src/PHPCI/Model/Base/MigrationBase.php
/src/PHPCI/Store/MigrationStore.php
/src/PHPCI/Store/Base/MigrationStoreBase.php
/local_vars.php
/app/config.yml
/tests/PHPCI/config.yml

View file

@ -1,38 +1,42 @@
build_settings:
verbose: false
ignore:
- "vendor"
- "Tests"
- "PHPCI/Command" # PHPMD complains about un-used parameters, but they are required.
- "public/install.php" # PHPCS really doesn't like PHP mixed with HTML (and so it shouldn't)
- "PHPCI/Migrations" # Ignore the migrations directory, as both PHPMD and PHPCS can't cope with them.
- "PHPCI/Model/Base" # These files are auto-generated, and sometimes hit PHPMD complexity thresholds.
- "PHPCI/Languages" # PHPCS fails on character counts for non-Latin languages
- "public/assets" # If there are any PHP files in here, we didn't write them.
- vendor
- tests
setup:
composer:
action: "install"
action: install
test:
php_parallel_lint:
ignore:
# Only ignore vendor
- vendor/
php_mess_detector:
allowed_warnings: 0
rules:
- phpmd.xml
php_code_sniffer:
standard: phpcs.xml
allowed_warnings: 0
allowed_errors: 0
php_loc:
php_unit:
php_docblock_checker:
allowed_warnings: 0
config:
- phpunit.xml
coverage: coverage
broken:
php_mess_detector:
allow_failures: true
php_code_sniffer:
standard: PSR2
encoding: UTF-8
allow_failures: true
php_cpd:
allow_failures: true
php_loc:
allow_failures: true
php_parallel_lint:
allow_failures: true
php_docblock_checker:
allow_failures: true
failure:
email:
#committer: true
#cc: ["php-ci@googlegroups.com"]
committer: true
complete:
email:
default_mailto_address: poisoncorpsee@gmail.com

View file

@ -1,43 +1,73 @@
<?php
/**
* PHPCI - Continuous Integration for PHP
*
* @copyright Copyright 2013, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link http://www.phptesting.org/
*/
* PHPCI - Continuous Integration for PHP
*
* @copyright Copyright 2013, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link http://www.phptesting.org/
*/
// Let PHP take a guess as to the default timezone, if the user hasn't set one:
date_default_timezone_set(@date_default_timezone_get());
use PHPCI\Logging\LoggerConfig;
// Load Composer autoloader:
require_once(dirname(__DIR__) . '/vendor/autoload.php');
if (!defined('ROOT_DIR')) {
define('ROOT_DIR', dirname(__DIR__) . DIRECTORY_SEPARATOR);
}
// If the PHPCI config file is not where we expect it, try looking in
// env for an alternative config path.
$configFile = dirname(__DIR__) . '/app/PHPCI/config.yml';
if (!defined('PHPCI_DIR')) {
define('PHPCI_DIR', ROOT_DIR . 'src' . DIRECTORY_SEPARATOR . 'PHPCI' . DIRECTORY_SEPARATOR);
}
if (!file_exists($configFile)) {
$configEnv = getenv('phpci_config_file');
if (!defined('PHPCI_PUBLIC_DIR')) {
define('PHPCI_PUBLIC_DIR', ROOT_DIR . 'public' . DIRECTORY_SEPARATOR);
}
if (!empty($configEnv)) {
$configFile = $configEnv;
}
if (!defined('PHPCI_APP_DIR')) {
define('PHPCI_APP_DIR', ROOT_DIR . 'app' . DIRECTORY_SEPARATOR);
}
if (!defined('PHPCI_BIN_DIR')) {
define('PHPCI_BIN_DIR', ROOT_DIR . 'bin' . DIRECTORY_SEPARATOR);
}
if (!defined('PHPCI_RUNTIME_DIR')) {
define('PHPCI_RUNTIME_DIR', ROOT_DIR . 'runtime' . DIRECTORY_SEPARATOR);
}
if (!defined('PHPCI_BUILDS_DIR')) {
define('PHPCI_BUILDS_DIR', ROOT_DIR . 'runtime' . DIRECTORY_SEPARATOR . 'builds' . 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');
\PHPCI\ErrorHandler::register();
if (defined('PHPCI_IS_CONSOLE') && PHPCI_IS_CONSOLE) {
$loggerConfig = LoggerConfig::newFromFile(PHPCI_APP_DIR . "loggerconfig.php");
}
// Load configuration if present:
$conf = [];
$conf = [];
$conf['b8']['app']['namespace'] = 'PHPCI';
$conf['b8']['app']['default_controller'] = 'Home';
$conf['b8']['view']['path'] = dirname(__DIR__) . '/src/PHPCI/View/';
$conf['b8']['view']['path'] = PHPCI_DIR . 'View' . DIRECTORY_SEPARATOR;
$config = new b8\Config($conf);
$configFile = PHPCI_APP_DIR . 'config.yml';
if (file_exists($configFile)) {
$config->loadYaml($configFile);
}
require_once(dirname(__DIR__) . '/vars.php');
if (!defined('PHPCI_URL') && !empty($config)) {
define('PHPCI_URL', $config->get('phpci.url', '') . '/');
}
if (!defined('PHPCI_IS_CONSOLE')) {
define('PHPCI_IS_CONSOLE', false);
}
\PHPCI\Helper\Lang::init($config);
\PHPCI\Helper\Lang::setLanguage("en");