Commit ea09367e by Timothy J Warren

Config files for various code quality services

parent 0715d814
imports:
- php
tools:
external_code_coverage:
timeout: 1000
# PHP
# Don't like PSR standards, not going to get messages for them!
php_code_sniffer: false
php_sim: true
# Can't be used with similarity analyzer
php_cpd: false
php_mess_detector: true
php_pdepend: true
php_loc: true
php_analyzer:
config:
metrics_lack_of_cohesion_methods:
enabled: true
doc_comment_fixes:
enabled: true
php_hhvm: true
\ No newline at end of file
language: php
php:
- 5.5
- 5.6
- hhvm
install:
- composer install
env:
- DB=mysql
- DB=pgsql
before_script:
- sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'DROP DATABASE IF EXISTS todo_test;' -U postgres; fi"
- sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'create database todo_test;' -U postgres; fi"
- sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'create database IF NOT EXISTS todo_test;'; fi";
script:
- vendor/bin/phinx migrate -e testing -c tests/phinx/$DB.yml
- mkdir -p build/logs
- cd tests && phpunit --coverage-clover build/logs/clover.xml
after_script:
- wget https://scrutinizer-ci.com/ocular.phar
- php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml
\ No newline at end of file
......@@ -10,18 +10,22 @@ build_settings:
- "migrations"
setup:
composer:
action: "install"
env:
APPLICATION_ENV: "development"
shell:
- "cd %BUILD_PATH% && vendor/bin/phinx rollback -e testing -t0"
- "cd %BUILD_PATH% && vendor/bin/phinx migrate -e testing"
test:
php_unit:
config: 'tests/phpunit.xml'
run_from: 'tests'
coverage: '../web/coverage/'
php_mess_detector:
allowed_warnings: 10
rules:
- "unusedcode"
- "naming"
php_docblock_checker:
php_loc:
# php_docblock_checker:
# php_loc:
<?php
// Require base bootstrap file
require_once('../application/third_party/CIUnit/bootstrap_phpunit.php');
require_once(__DIR__ . '/../application/third_party/CIUnit/bootstrap_phpunit.php');
// Require autoloader
require_once('./env/autoloader.php');
require_once(__DIR__ . '/env/autoloader.php');
/**
* Noop Controller
......
......@@ -6,30 +6,29 @@
spl_autoload_register(function($class) {
$paths = [
'../application/controllers/',
'../application/models/',
'../application/libraries/',
'../application/core/',
'../system/core/',
'../system/libraries/'
'application/controllers',
'application/models',
'application/libraries',
'application/core',
'system/core',
'system/libraries'
];
foreach($paths as $path)
{
$path = __DIR__ . "/../../{$path}/";
$exact_file = "{$path}{$class}.php";
$lower_file = $path . mb_strtolower($class) . ".php";
if (file_exists($exact_file))
if (file_exists($lower_file))
{
require_once($exact_file);
require_once($lower_file);
return;
}
elseif (file_exists($lower_file))
else if (file_exists($exact_file))
{
require_once($lower_file);
require_once($exact_file);
return;
}
}
});
\ No newline at end of file
paths:
migrations: %%PHINX_CONFIG_DIR%%/../../migrations
environments:
default_migration_table: phinxlog
default_database: testing
testing:
adapter: mysql
host: localhost
name: todo_test
user: root
pass:
port: 3306
charset: utf8
\ No newline at end of file
paths:
migrations: %%PHINX_CONFIG_DIR%%/../../migrations
environments:
default_migration_table: phinxlog
default_database: testing
testing:
adapter: pgsql
host: localhost
name: todo_test
user: postgres
pass:
port: 5432
charset: utf8
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment