Skip to content

Commit 19592e0

Browse files
authored
Merge pull request #35 from notpron/cakephp-3.x-upgrade
Cakephp 3.x upgrade
2 parents c68abc3 + 3b69d8a commit 19592e0

46 files changed

Lines changed: 3202 additions & 2160 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ Thumbs.db
2222
###############
2323
!empty
2424
/node_modules
25+
/vendor

.phan/config.php

Lines changed: 414 additions & 0 deletions
Large diffs are not rendered by default.

.travis.yml

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,54 @@
11
language: php
22

3+
sudo: false
4+
35
php:
4-
- 7.0
56
- 7.1
6-
- 7.2
77

88
env:
99
global:
10-
- REPO_NAME=cakephp-queue
11-
- PLUGIN_NAME=Queue
12-
- REQUIRE=""
13-
- DB=mysql CAKE_VERSION=2
14-
15-
- secure: "lMvqukdTy45r8VXnIaIKUI7i39dwDQ7u7yPeN019TVZDhYGa3ul9S0PxWYTXvyay+PqnEtCcp/dfwo57pLDfFKOnD6omLZiwFU4F10P8TIm6cnokw/4dnFEsZnK8fuvqDduwrSZwyTk9J1fvOYSOcGkOOm7y5AqSaDYEpQIPtuI="
10+
- CAKE_VERSION=^3.7.0
11+
- DB=mysql db_dsn='mysql://root@127.0.0.1/cakephp_test'
1612

17-
matrix:
18-
- CAKE_VERSION=2.9
19-
- CAKE_VERSION=2.10 PHPUNIT_VERSION=^5.7
13+
services:
14+
- mysql
2015

2116
matrix:
2217
include:
2318
- php: 7.1
2419
env:
25-
- CODECOVERAGE=1 PHPUNIT_VERSION=^5.7
20+
- PHP_SYNTAX=1
21+
- php: 7.1
22+
env:
23+
- PHP_CS=1
24+
- php: 7.1
25+
env:
26+
- PHP_CPD=1
2627
- php: 7.1
2728
env:
28-
- PHPCS=1
29+
- PHP_MD=1
2930
- php: 7.1
3031
env:
31-
- FOC_VALIDATE=1
32-
exclude:
33-
- php: 7.2
34-
env: CAKE_VERSION=2.9
32+
- PHP_STAN=1
33+
- php: 7.1
34+
env:
35+
- PHP_PHAN=1
36+
- php: 7.1
37+
env:
38+
- PHP_COVERAGE=1
3539

3640
branches:
3741
only:
3842
- master
43+
- 2.x
44+
- 3.x
3945

4046
before_script:
41-
- git clone -b master https://github.com/Oefenweb/travis --depth 1 ../travis
42-
- travis_wait ../travis/before_script.sh
47+
- travis_wait ./.travis/before-script.sh
48+
- mysql -u root -e 'CREATE DATABASE cakephp_test;'
4349

4450
script:
45-
- ../travis/script.sh
51+
- ./.travis/script.sh
4652

4753
after_success:
48-
- ../travis/after_success.sh
49-
50-
notifications:
51-
email: false
52-
hipchat:
53-
rooms:
54-
secure: bTreDxMYliZtwL5N4MjGrf7Zfu/Wi934vFgtZ2TNxoV3ZRWmoSqoWI7TW/SmMYgnSVHEifPutYFA6H6jKMzNaEyqiH8Fq/7ZIVuRb9pfGyXj8+qGBfXyGnPUnqz+ra2j1AewCjfxAJtx7yNi2LBm7eDze8g5j/g0EblkQP7LkzY=
54+
- ./.travis/after-success.sh

.travis/after-success.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env bash
2+
#
3+
# set -x;
4+
set -e;
5+
set -o pipefail;
6+
#
7+
# thisFile="$(readlink -f "${0}")";
8+
# thisFilePath="$(dirname "${thisFile}")";
9+
#
10+
if [ "${PHP_COVERAGE}" = '1' ]; then
11+
bash <(curl -s https://codecov.io/bash);
12+
fi
13+

.travis/before-script.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/usr/bin/env bash
2+
#
3+
# set -x;
4+
set -e;
5+
set -o pipefail;
6+
#
7+
# thisFile="$(readlink -f "${0}")";
8+
# thisFilePath="$(dirname "${thisFile}")";
9+
#
10+
composer install --no-ansi --no-progress --no-interaction --optimize-autoloader;
11+
12+
if [ "${PHP_SYNTAX}" = '1' ]; then
13+
exit 0;
14+
elif [ "${PHP_CS}" = '1' ]; then
15+
exit 0;
16+
elif [ "${PHP_CPD}" = '1' ]; then
17+
exit 0;
18+
elif [ "${PHP_MD}" = '1' ]; then
19+
exit 0;
20+
elif [ "${PHP_STAN}" = '1' ]; then
21+
exit 0;
22+
elif [ "${PHP_PHAN}" = '1' ]; then
23+
pecl install ast;
24+
exit 0;
25+
fi
26+
27+
composer require "cakephp/cakephp:${CAKE_VERSION}" --dev --no-ansi --no-progress --no-interaction;
28+

.travis/script.sh

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#!/usr/bin/env bash
2+
#
3+
# set -x;
4+
set -e;
5+
set -o pipefail;
6+
#
7+
# thisFile="$(readlink -f "${0}")";
8+
# thisFilePath="$(dirname "${thisFile}")";
9+
#
10+
if [ "${PHP_SYNTAX}" = '1' ]; then
11+
[ "$(find . \( -path './vendor' \) -prune -o -type f \( -name '*.ctp' -o -name '*.php' \) -print0 | xargs -0 --no-run-if-empty -L1 -i'{}' php -l '{}' | grep -vc 'No syntax errors')" -eq 0 ];
12+
elif [ "${PHP_CS}" = '1' ]; then
13+
excludePaths=( \
14+
'vendor/*' \
15+
);
16+
excludePathsJoined=$(printf ",%s" "${excludePaths[@]}");
17+
excludePathsJoined=${excludePathsJoined:1};
18+
19+
vendor/bin/phpcs \
20+
--config-set installed_paths "${PWD}/vendor/cakephp/cakephp-codesniffer,${PWD}/vendor/oefenweb/cakephp-codesniffer" \
21+
;
22+
vendor/bin/phpcs . --standard=CakePHPOefenweb --extensions=ctp,php --ignore="${excludePathsJoined}";
23+
elif [ "${PHP_CPD}" = '1' ]; then
24+
vendor/bin/phpcpd . --names '*.php,*.ctp' --exclude vendor --no-interaction --fuzzy .;
25+
elif [ "${PHP_MD}" = '1' ]; then
26+
excludePaths=( \
27+
'**/vendor' \
28+
);
29+
excludePathsJoined=$(printf ",%s" "${excludePaths[@]}");
30+
excludePathsJoined=${excludePathsJoined:1};
31+
32+
vendor/bin/phpmd . text phpmd.xml --suffixes php --exclude "${excludePathsJoined}" || true;
33+
elif [ "${PHP_STAN}" = '1' ]; then
34+
vendor/bin/phpstan analyse -c phpstan.neon -l 5 src/;
35+
elif [ "${PHP_PHAN}" = '1' ]; then
36+
vendor/bin/phan;
37+
elif [ "${PHP_COVERAGE}" = '1' ]; then
38+
vendor/bin/phpunit --coverage-clover=clover.xml;
39+
else
40+
vendor/bin/phpunit;
41+
fi
42+

CONTRIBUTING.md

Lines changed: 0 additions & 69 deletions
This file was deleted.

Config/Schema/schema.php

Lines changed: 0 additions & 43 deletions
This file was deleted.

0 commit comments

Comments
 (0)