Skip to content

Commit

Permalink
Merge pull request #18 from ishanvyas22/upgrade-app-to-cake4
Browse files Browse the repository at this point in the history
Upgrade app to CakePHP 4
  • Loading branch information
ishanvyas22 authored Aug 8, 2020
2 parents 717afad + 4bea9df commit 0b054ad
Show file tree
Hide file tree
Showing 60 changed files with 12,531 additions and 10,633 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ end_of_line = crlf

[*.yml]
indent_style = space
indent_size = 2
indent_size = 4

[*.twig]
insert_final_newline = false
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
/logs/*
/tmp/*
/vendor/*
/config/Migrations/schema-dump-default.lock
/config/Migrations/*.lock
/.phpunit.result.cache
/clover.xml

# OS generated files #
######################
Expand Down
49 changes: 10 additions & 39 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
language: php

dist: trusty

branches:
only:
- master
- develop

php:
- 5.6
- 7.0
- 7.1
- 7.2
- 7.3
- 7.4

env:
matrix:
- DB=mysql DATABASE_URL='mysql://root:[email protected]/cakevue_spa?init[]=SET sql_mode = "STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"' DATABASE_TEST_URL='mysql://root:root@127.0.0.1/test_cakevue_spa?init[]=SET sql_mode = "STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"'
- DEFAULT=1 DATABASE_TEST_URL='mysql://ishan:vyas@127.0.0.1/test_cakevue_spa'

services:
- mysql
Expand All @@ -28,48 +24,23 @@ cache:
matrix:
fast_finish: true

global:
- DEFAULT=1
- PHPCS=0
- PHPSTAN=0
- CODECOVERAGE=0

include:
- php: 7.2
env: PHPCS=1 DEFAULT=0

- php: 7.2
env: PHPSTAN=1 DEFAULT=0

- php: 7.2
env: CODECOVERAGE=1 DEFAULT=0 DB=mysql DATABASE_URL='mysql://root:[email protected]/cakevue_spa?init[]=SET sql_mode = "STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"' DATABASE_TEST_URL='mysql://root:[email protected]/test_cakevue_spa?init[]=SET sql_mode = "STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"'

before_script:
- if [ $DB = 'mysql' ]; then mysql -u root -e 'CREATE DATABASE cakevue_spa;'; fi
- if [ $DB = 'mysql' ]; then mysql -u root -e 'CREATE DATABASE test_cakevue_spa;'; fi
- if [ $DB = 'mysql' ]; then mysql -u root -e "CREATE USER 'ishan'@'localhost' IDENTIFIED BY 'ishan';"; fi
- if [ $DB = 'mysql' ]; then mysql -u root -e "GRANT ALL ON cakevue_spa.* TO 'ishan'@'localhost';"; fi
- if [ $DB = 'mysql' ]; then mysql -u root -e "GRANT ALL ON test_cakevue_spa.* TO 'ishan'@'localhost';"; fi
- if [[ $PHPCS = 1 ]]; then composer require cakephp/cakephp-codesniffer:^3.0; fi
- if [[ $DEFAULT = 1 ]]; then composer install --no-interaction; fi
- if [[ $DEFAULT = 1 ]]; then composer test-setup; fi
- if [[ $DEFAULT = 1 ]]; then composer run-script post-install-cmd --no-interaction; fi
before_install:
- phpenv config-rm xdebug.ini

- if [[ $CODECOVERAGE = 1 ]]; then composer install --no-interaction; fi
- if [[ $CODECOVERAGE = 1 ]]; then composer run-script post-install-cmd --no-interaction; fi
- if [[ $CODECOVERAGE = 1 ]]; then composer test-setup; fi
install:
- mysql -u root -e "CREATE DATABASE test_cakevue_spa; CREATE USER 'ishan'@'localhost' IDENTIFIED BY 'vyas'; GRANT ALL ON test_cakevue_spa.* TO 'ishan'@'localhost';"
- composer install --no-interaction

script:
- if [[ $DEFAULT = 1 ]]; then composer test; fi

- if [[ $PHPCS = 1 ]]; then vendor/bin/phpcs -p --extensions=php --standard=vendor/cakephp/cakephp-codesniffer/CakePHP ./src ./tests; fi

- if [[ $PHPSTAN = 1 ]]; then composer phpstan-setup && composer phpstan; fi

- if [[ $CODECOVERAGE == 1 ]]; then phpdbg -qrr vendor/bin/phpunit --coverage-clover=clover.xml; fi

after_success:
- if [[ $CODECOVERAGE == 1 ]]; then bash <(curl -s https://codecov.io/bash); fi
- if [[ $PHPCS = 1 ]]; then composer cs-check; fi
- if [[ $PHPSTAN = 1 ]]; then composer analyse; fi

notifications:
email: false
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Release Notes

## [Unreleased](https://github.com/ishanvyas22/cakephpvue-spa/compare/1.1.2...master)

### Added
- Upgrade application to CakePHP 4.x

### Fixed
- Rename `CHANGLOG.md` to `CHANGELOG.md` ([2eb3eae](https://github.com/ishanvyas22/cakephpvue-spa/commit/2eb3eae7292cc8a083ba90245dff7ffbaca4cca1))
73 changes: 0 additions & 73 deletions CHANGLOG.md

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ A basic CakePHP + VueJS single page application. Provides basic skeleton/boilerp
```
- **To generate production version of js file**
```bash
npm run production
npm run prod
```

## Notes
Expand Down
34 changes: 17 additions & 17 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,21 @@
"type": "project",
"license": "MIT",
"require": {
"php": ">=5.6",
"php": ">=7.2",
"ext-json": "*",
"cakephp/cakephp": "3.8.*",
"cakephp/cakephp-codesniffer": "^3.0",
"cakephp/migrations": "^2.0.0",
"cakephp/plugin-installer": "^1.0",
"ishanvyas22/asset-mix": "^0.3.0",
"josegonzalez/dotenv": "3.*",
"mobiledetect/mobiledetectlib": "2.*"
"cakephp/cakephp": "~4.1.0",
"cakephp/migrations": "^3.0",
"cakephp/plugin-installer": "^1.2",
"ishanvyas22/asset-mix": "^1.0",
"mobiledetect/mobiledetectlib": "^2.8"
},
"require-dev": {
"cakephp/bake": "^1.1",
"cakephp/debug_kit": "^3.15.0",
"cakephp/bake": "^2.0.3",
"cakephp/cakephp-codesniffer": "~4.2.0",
"cakephp/debug_kit": "^4.1",
"josegonzalez/dotenv": "^3.2",
"phpstan/phpstan": "^0.12.36",
"phpunit/phpunit": "^8.0",
"psy/psysh": "@stable"
},
"autoload": {
Expand All @@ -38,15 +40,13 @@
"@test",
"@cs-fix",
"@cs-check",
"@phpstan"
"@analyse"
],
"cs-check": "phpcs -p --extensions=php --standard=vendor/cakephp/cakephp-codesniffer/CakePHP ./src ./tests",
"cs-fix": "phpcbf --colors --standard=vendor/cakephp/cakephp-codesniffer/CakePHP ./src ./tests",
"test-setup": "cp composer.json composer.backup && composer require --dev phpunit/phpunit:\"^5.7.14|^6.0\" && mv composer.backup composer.json",
"analyse": "phpstan analyse -l 5 src/",
"cs-check": "phpcs --colors -p src/ tests/",
"cs-fix": "phpcbf --colors -p src/ tests/",
"test": "phpunit --colors=always",
"test-coverage": "phpunit --coverage-clover=clover.xml",
"phpstan-setup": "cp composer.json composer.backup && composer require --dev phpstan/phpstan && mv composer.backup composer.json",
"phpstan": "phpstan analyse -l 5 src/"
"test-coverage": "phpunit --coverage-clover=clover.xml"
},
"prefer-stable": true,
"config": {
Expand Down
Loading

0 comments on commit 0b054ad

Please sign in to comment.