Skip to content

Commit

Permalink
Merge pull request #556 from FriendsOfCake/cake-4.x
Browse files Browse the repository at this point in the history
Cake 4.x
  • Loading branch information
ADmad committed Dec 2, 2020
2 parents 919f7f6 + 15eabf8 commit a600086
Show file tree
Hide file tree
Showing 42 changed files with 801 additions and 513 deletions.
5 changes: 4 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
; This file is for unifying the coding style for different editors and IDEs.
; More information at http://editorconfig.org

root = false
root = true

[*]
indent_style = space
Expand All @@ -14,3 +14,6 @@ trim_trailing_whitespace = true
[*.yml]
indent_style = space
indent_size = 2

[*.neon]
indent_style = tab
11 changes: 11 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Remove files for archives generated using `git archive`
CONTRIBUTING.md export-ignore
.editorconfig export-ignore
.gitattributes export-ignore
.gitignore export-ignore
phpunit.xml.dist export-ignore
.scrutinizer.yml export-ignore
.stickler.yml export-ignore
tests export-ignore
docs export-ignore
.github export-ignore
94 changes: 94 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: CI

on: [push, pull_request]

jobs:
testsuite:
runs-on: ubuntu-18.04
strategy:
fail-fast: false
matrix:
php-version: ['7.2', '7.4']
db-type: [sqlite, mysql, pgsql]
prefer-lowest: ['']
include:
- php-version: '7.2'
db-type: 'sqlite'
prefer-lowest: 'prefer-lowest'

services:
postgres:
image: postgres
ports:
- 5432:5432
env:
POSTGRES_PASSWORD: postgres

steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1

- name: Setup Service
if: matrix.db-type == 'mysql'
run: |
sudo service mysql start
mysql -h 127.0.0.1 -u root -proot -e 'CREATE DATABASE cakephp;'
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: mbstring, intl, pdo_${{ matrix.db-type }}
coverage: pcov

- name: Composer install
run: |
if ${{ matrix.prefer-lowest == 'prefer-lowest' }}; then
composer update --prefer-lowest --prefer-stable
else
composer install
fi
- name: Run PHPUnit
run: |
if [[ ${{ matrix.db-type }} == 'sqlite' ]]; then export DB_URL='sqlite:///:memory:'; fi
if [[ ${{ matrix.db-type }} == 'mysql' ]]; then export DB_URL='mysql://root:root@127.0.0.1/cakephp'; fi
if [[ ${{ matrix.db-type }} == 'pgsql' ]]; then export DB_URL='postgres://postgres:postgres@127.0.0.1/postgres'; fi
if [[ ${{ matrix.php-version }} == '7.4' && ${{ matrix.db-type }} == 'sqlite' ]]; then
vendor/bin/phpunit --coverage-clover=coverage.xml
else
vendor/bin/phpunit
fi
- name: Code Coverage Report
if: success() && matrix.php-version == '7.4' && matrix.db-type == 'sqlite'
uses: codecov/codecov-action@v1

cs-stan:
name: Coding Standard & Static Analysis
runs-on: ubuntu-18.04

steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
extension: mbstring, intl
coverage: none
tools: cs2pr, phpstan:^0.12

- name: Composer Install
run: composer install

- name: Run phpcs
run: vendor/bin/phpcs --report=checkstyle --standard=vendor/cakephp/cakephp-codesniffer/CakePHP src/ tests/ | cs2pr

- name: Run phpstan
if: success() || failure()
run: phpstan analyse
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
vendor/
composer.lock
.phpunit.result.cache
64 changes: 0 additions & 64 deletions .travis.yml

This file was deleted.

10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
[![Build Status](https://img.shields.io/travis/FriendsOfCake/cakephp-upload/master.svg?style=flat-square)](https://travis-ci.org/FriendsOfCake/cakephp-upload)
[![Coverage Status](https://img.shields.io/coveralls/FriendsOfCake/cakephp-upload.svg?style=flat-square)](https://coveralls.io/r/FriendsOfCake/cakephp-upload?branch=master)
[![Build Status](https://img.shields.io/github/workflow/status/FriendsOfCake/cakephp-upload/CI/master?style=flat-square)](https://github.com/FriendsOfCake/cakephp-upload/actions?query=workflow%3ACI+branch%3Amaster)
[![Coverage Status](https://img.shields.io/codecov/c/github/FriendsOfCake/cakephp-upload.svg?style=flat-square)](https://codecov.io/github/FriendsOfCake/cakephp-upload)
[![Total Downloads](https://img.shields.io/packagist/dt/josegonzalez/cakephp-upload.svg?style=flat-square)](https://packagist.org/packages/josegonzalez/cakephp-upload)
[![Latest Stable Version](https://img.shields.io/packagist/v/josegonzalez/cakephp-upload.svg?style=flat-square)](https://packagist.org/packages/josegonzalez/cakephp-upload)
[![Documentation Status](https://readthedocs.org/projects/cakephp-upload/badge/?version=latest&style=flat-square)](https://readthedocs.org/projects/cakephp-upload/?badge=latest)

# Upload Plugin

The Upload Plugin is an attempt to sanely upload files using techniques garnered from packages such as [MeioUpload](http://github.com/jrbasso/MeioUpload) , [UploadPack](http://github.com/szajbus/cakephp-uploadpack) and [PHP documentation](http://php.net/manual/en/features.file-upload.php).
The Upload Plugin is an attempt to easily handle file uploads with CakePHP.

See [this branch](https://github.com/FriendsOfCake/cakephp-upload/tree/2.x) for CakePHP 2.x documentation.
See [4.x branch](https://github.com/FriendsOfCake/cakephp-upload/tree/4.x) for CakePHP 3.x documentation.

See [2.x branch](https://github.com/FriendsOfCake/cakephp-upload/tree/2.x) for CakePHP 2.x documentation.

See [this blog post](http://josediazgonzalez.com/2015/12/05/uploading-files-and-images/) for a tutorial on using the 3.x version.

Expand Down
11 changes: 5 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,14 @@
}
],
"require": {
"cakephp/orm": "^3.5",
"league/flysystem": "*"
"cakephp/orm": "^4.0.2",
"league/flysystem": "^1.0"
},
"require-dev": {
"cakephp/cakephp": "^3.5",
"cakephp/chronos": "^1.1",
"phpunit/phpunit": "^5.7.14|^6.0",
"cakephp/cakephp": "^4.0.2",
"phpunit/phpunit": "~8.5.0",
"league/flysystem-vfs": "*",
"cakephp/cakephp-codesniffer": "dev-master"
"cakephp/cakephp-codesniffer": "^4.0"
},
"autoload": {
"psr-4": {
Expand Down

0 comments on commit a600086

Please sign in to comment.