Skip to content

Commit f286de9

Browse files
authored
Merge pull request #1408 from phalcon/4.0.x
4.0.0
2 parents f5f8282 + 688a6c9 commit f286de9

File tree

496 files changed

+104426
-27496
lines changed

Some content is hidden

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

496 files changed

+104426
-27496
lines changed

.ci/build-phar.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/sh
2+
#
3+
# This file is part of the Phalcon Framework.
4+
#
5+
# (c) Phalcon Team <[email protected]>
6+
#
7+
# For the full copyright and license information, please view the
8+
# LICENSE.txt file that was distributed with this source code.
9+
10+
set -eu
11+
12+
if [ "$(command -v box 2>/dev/null || true)" = "" ]; then
13+
(>&2 printf "To use this script you need to install humbug/box: %s \\n" \
14+
"https://github.com/humbug/box")
15+
(>&2 echo "Aborting.")
16+
exit 1
17+
fi
18+
19+
box validate
20+
box compile
21+
22+
if [ ! -f "./phalcon.phar" ] || [ ! -x "./phalcon.phar" ]; then
23+
(>&2 echo "Something went wrong when building zephir.phar")
24+
(>&2 echo "Aborting.")
25+
exit 1
26+
fi

.ci/install-box.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env bash
2+
#
3+
# This file is part of the Phalcon Framework.
4+
#
5+
# (c) Phalcon Team <[email protected]>
6+
#
7+
# For the full copyright and license information, please view the
8+
# LICENSE.txt file that was distributed with this source code.
9+
10+
set -e
11+
12+
: "${BOX_VERSION:=3.8.3}"
13+
14+
wget "https://github.com/humbug/box/releases/download/${BOX_VERSION}/box.phar" \
15+
--quiet \
16+
-O "${HOME}/bin/box"
17+
18+
chmod +x "${HOME}/bin/box"
19+
box --version

.ci/install-phalcon.sh

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/usr/bin/env bash
2+
#
3+
# This file is part of the Phalcon Framework.
4+
#
5+
# (c) Phalcon Team <[email protected]>
6+
#
7+
# For the full copyright and license information, please view the
8+
# LICENSE.txt file that was distributed with this source code.
9+
10+
set -e
11+
12+
: "${PHALCON_VERSION:=master}"
13+
14+
EXT_DIR="$(php-config --extension-dir)"
15+
LOCAL_PATH="phalcon-$PHALCON_VERSION/php-$(php-config --vernum)/$TRAVIS_ARCH"
16+
17+
# Using cache only for tagged Phalcon versions
18+
if [ "$PHALCON_VERSION" != "master" ] &&
19+
[ "$PHALCON_VERSION" != "4.0.x" ] &&
20+
[ -f "$HOME/assets/$LOCAL_PATH/phalcon.so" ]
21+
then
22+
cp "$HOME/assets/$LOCAL_PATH/phalcon.so" "$EXT_DIR/phalcon.so"
23+
else
24+
git clone --depth=1 -v https://github.com/phalcon/cphalcon.git -b "$PHALCON_VERSION" /tmp/phalcon
25+
cd /tmp/phalcon/build || extit 1
26+
./install --phpize "$(phpenv which phpize)" --php-config "$(phpenv which php-config)" 1> /dev/null
27+
28+
mkdir -p "$HOME/assets/$LOCAL_PATH"
29+
cp "$EXT_DIR/phalcon.so" "$HOME/assets/$LOCAL_PATH/phalcon.so"
30+
fi
31+
32+
echo extension=phalcon.so >> "$(phpenv prefix)/etc/php.ini"
33+
34+
"$(phpenv which php)" -m | grep -q phalcon

.ci/serve-webtools.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env bash
2+
#
3+
# This file is part of the Phalcon Framework.
4+
#
5+
# (c) Phalcon Team <[email protected]>
6+
#
7+
# For the full copyright and license information, please view the
8+
# LICENSE.txt file that was distributed with this source code.
9+
10+
set -e
11+
12+
WEB_TOOLS_PROJECT=${HOME}/webtools
13+
14+
rm -rf ${WEB_TOOLS_PROJECT}
15+
phalcon project --directory=$HOME --name=webtools
16+
sed -i "s/'dbname' => 'test',/'dbname' => 'devtools',/g" ${WEB_TOOLS_PROJECT}/app/config/config.php
17+
cd ${WEB_TOOLS_PROJECT}
18+
19+
phalcon webtools enable
20+
phalcon serve &

.codecov.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
codecov:
2+
notify:
3+
require_ci_to_pass: yes
4+
5+
coverage:
6+
precision: 2
7+
round: down
8+
range: "65...90"
9+
10+
status:
11+
project:
12+
default:
13+
# Allow the coverage to drop by threshold %, and posting a success status.
14+
threshold: 0.5
15+
patch:
16+
default:
17+
# trial operation
18+
target: 0%
19+
changes: no
20+
21+
comment:
22+
layout: "header, diff"
23+
behavior: default
24+
require_changes: no
25+
26+
ignore:
27+
- ".git"
28+
- "*.yml"
29+
- "*.json"
30+
- "*.md"
31+
- "*.dist"
32+
- "*.txt"
33+
- "*.bat"
34+
# ignore folders and all its contents
35+
- ".ci/.*"
36+
- ".github/.*"
37+
- ".phalcon/.*"
38+
- "ide/.*"
39+
- "bootstrap/.*"
40+
- "resources/.*"
41+
- "templates/.*"
42+
- "tests/.*"
43+
- "vendor/.*"

.travis.yml

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

3-
sudo: required
4-
53
services:
64
- postgresql
75
- mysql
86

97
matrix:
108
include:
11-
- php: '5.5'
12-
env: PHALCON_VERSION="v3.4.1"
13-
dist: trusty
14-
- php: '5.6'
15-
- php: '7.0'
16-
env: ZEND_BACKEND="--backend=ZendEngine3"
17-
- php: '7.1'
18-
env: ZEND_BACKEND="--backend=ZendEngine3"
19-
- php: '7.2'
20-
env: ZEND_BACKEND="--backend=ZendEngine3"
21-
- php: '7.3'
22-
env: ZEND_BACKEND="--backend=ZendEngine3"
9+
- php: 7.2
10+
env:
11+
- BUILD_PHAR=1
12+
- php: 7.3
13+
env:
14+
- BUILD_PHAR=0
2315

2416
git:
2517
depth: 1
2618

2719
cache:
2820
ccache: true
29-
timeout: 691200
21+
timeout: 604800
3022
directories:
3123
- .temp
3224
- vendor
@@ -37,36 +29,54 @@ cache:
3729

3830
env:
3931
global:
32+
- BUILD_PHAR=1
4033
- PATH="$PATH:~/bin"
4134
- DISPLAY=":99.0"
42-
- PHALCON_VERSION="v3.4.4"
35+
- PHAR_PHP_VERSION=7.2.23
36+
- BOX_VERSION=3.8.3
37+
- PHALCON_VERSION=v4.0.0
4338

4439
before_install:
45-
- export PHP_VERSION=$(php-config --version)
46-
- export PHP_MAJOR="$(echo $TRAVIS_PHP_VERSION | cut -d '.' -f 1)"
47-
- export PHP_EXTENSION_DIR=$(php-config --extension-dir)
4840
- source $TRAVIS_BUILD_DIR/tests/_ci/environment
4941
- export $(cut -d= -f1 $TRAVIS_BUILD_DIR/tests/_ci/environment)
50-
- phpenv config-rm xdebug.ini || true
51-
- if [ -n "$GH_TOKEN" ]; then composer config github-oauth.github.com $GH_TOKEN; fi;
52-
- if [ ! -f "$HOME/cphalcon/$PHALCON_VERSION/tests/_ci/phalcon.ini" ]; then git clone -q --branch $PHALCON_VERSION --depth=1 https://github.com/phalcon/cphalcon.git $HOME/cphalcon/$PHALCON_VERSION >/dev/null 2>&1; fi;
42+
- if [ -n "$GITHUB_TOKEN" ]; then composer config github-oauth.github.com $GITHUB_TOKEN; fi;
5343
- bash tests/_ci/setup_dbs.sh
5444

5545
install:
56-
- if [ ! -f $HOME/ext/$PHALCON_VERSION/$PHP_VERSION/phalcon.so ]; then cd $HOME/cphalcon/$PHALCON_VERSION/build && bash ./install --phpize $(phpenv which phpize) --php-config $(phpenv which php-config) && mkdir -p $HOME/ext/$PHP_VERSION && cp $PHP_EXTENSION_DIR/phalcon.so $HOME/ext/$PHP_VERSION/phalcon.so; fi;
57-
- if [ -f $HOME/ext/$PHALCON_VERSION/$PHP_VERSION/phalcon.so ]; then cp $HOME/ext/$PHALCON_VERSION/$PHP_VERSION/phalcon.so $PHP_EXTENSION_DIR/phalcon.so; fi;
58-
- phpenv config-add $HOME/cphalcon/$PHALCON_VERSION/tests/_ci/phalcon.ini
59-
- cd $TRAVIS_BUILD_DIR
60-
- travis_retry composer install --prefer-dist --no-interaction
61-
- if [ "$PHP_MAJOR" == "7" ]; then composer require --dev phpstan/phpstan:^0.9; fi;
46+
- pecl install --force psr
47+
- .ci/install-phalcon.sh
48+
- |
49+
if [ "$BUILD_PHAR" -eq 1 ]
50+
then
51+
echo "Build Phalcon DevTools PHAR"
52+
composer config platform.php $PHAR_PHP_VERSION
53+
.ci/install-box.sh
54+
.ci/build-phar.sh
55+
fi
6256
6357
before_script:
58+
- travis_retry composer install --no-interaction --no-ansi --no-progress --no-suggest
59+
- composer require --dev phpstan/phpstan
6460
- ln -s $PWD/phalcon ~/bin/phalcon
61+
- .ci/serve-webtools.sh
6562

6663
script:
64+
- mkdir .phalcon
6765
- vendor/bin/phpcs
6866
- vendor/bin/codecept build
69-
- vendor/bin/codecept run unit -v
70-
- vendor/bin/codecept run functional -v
71-
- vendor/bin/codecept run console -v
72-
- '[[ "$PHP_MAJOR" == "5" ]] || vendor/bin/phpstan analyse -l 5 -c phpstan.neon scripts -v'
67+
- vendor/bin/codecept run --coverage-xml
68+
- vendor/bin/psalm --show-info=false
69+
- vendor/bin/phpstan analyse -l 5 -c phpstan.neon src -v
70+
71+
after_success:
72+
- bash <(curl -s https://codecov.io/bash)
73+
74+
deploy:
75+
provider: releases
76+
api_key: $GITHUB_TOKEN
77+
file: phalcon.phar
78+
skip_cleanup: true
79+
on:
80+
php: '7.2'
81+
tags: true
82+
repo: phalcon/phalcon-devtools

CONTRIBUTING.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ Phalcon Team
5656

5757

5858
[pr]: https://help.github.com/articles/about-pull-requests/
59-
[forum]: https://forum.phalconphp.com/
59+
[forum]: https://forum.phalcon.io/
6060
[cphalcon]: https://github.com/phalcon/cphalcon
61-
[srt]: https://docs.phalconphp.com/en/latest/reproducible-tests
62-
[gb]: https://docs.phalconphp.com/en/latest/generating-backtrace
63-
[support]: https://phalconphp.com/en/support/
64-
[nfr]: https://docs.phalconphp.com/en/latest/new-feature-request
61+
[srt]: https://docs.phalcon.io/en/latest/reproducible-tests
62+
[gb]: https://docs.phalcon.io/en/latest/generating-backtrace
63+
[support]: https://phalcon.io/en/support/
64+
[nfr]: https://docs.phalcon.io/en/latest/new-feature-request
6565
[psr]: https://www.php-fig.org/psr/

README.md

Lines changed: 6 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Phalcon Devtools
22

3-
[![Discord](https://img.shields.io/discord/310910488152375297?label=Discord)](http://phalcon.link/discord)
3+
[![codecov](https://codecov.io/gh/phalcon/phalcon-devtools/branch/4.0.x/graph/badge.svg)](https://codecov.io/gh/phalcon/phalcon-devtools)
44
[![Latest Version](https://img.shields.io/packagist/v/phalcon/devtools.svg?style=flat-square)][:devtools:]
55
[![Software License](https://img.shields.io/badge/license-BSD--3-brightgreen.svg?style=flat-square)][:license:]
66
[![Total Downloads](https://img.shields.io/packagist/dt/phalcon/devtools.svg?style=flat-square)][:packagist:]
@@ -21,8 +21,8 @@ with Phalcon framework.
2121

2222
## Requirements
2323

24-
* PHP >= 5.5
25-
* Phalcon >= 3.3.0
24+
* PHP >= 7.2
25+
* Phalcon >= 4.0.0
2626

2727
## Installing via Composer
2828

@@ -37,17 +37,17 @@ Create the composer.json file as follows:
3737
```json
3838
{
3939
"require-dev": {
40-
"phalcon/devtools": "~3.4"
40+
"phalcon/devtools": "~4.0"
4141
}
4242
}
4343
```
4444

45-
If you are still using Phalcon 2.0.x, create a `composer.json` with the following instead:
45+
If you are still using Phalcon 3.4.x, create a `composer.json` with the following instead:
4646

4747
```json
4848
{
4949
"require-dev": {
50-
"phalcon/devtools": "^2.0"
50+
"phalcon/devtools": "^3.4"
5151
}
5252
}
5353
```
@@ -74,18 +74,6 @@ chmod +xr ./phalcon.phar
7474
php ./phalcon.phar
7575
```
7676

77-
## Build Docker Image
78-
79-
Use make command to build the docker image, It will build the image named `phalcon`:
80-
```bash
81-
make image
82-
```
83-
84-
And run container with following command:
85-
```bash
86-
docker run -it --rm phalcon
87-
```
88-
8977
## Installation via Git
9078

9179
Phalcon Devtools can be installed by using Git.
@@ -183,22 +171,6 @@ By creating **config.json** or any other configuration file called **config** in
183171

184172
And then you can use use `phalcon migration run` or `phalcon controller SomeClass` and those commands will be executed with options from file. Arguments provided by developer from command line will overwrite existing one in file.
185173

186-
## Sponsors
187-
188-
Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/phalcon#sponsor)]
189-
190-
<a href="https://opencollective.com/phalcon/#contributors">
191-
<img src="https://opencollective.com/phalcon/tiers/sponsors.svg?avatarHeight=48&width=800">
192-
</a>
193-
194-
## Backers
195-
196-
Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/phalcon#backer)]
197-
198-
<a href="https://opencollective.com/phalcon/#contributors">
199-
<img src="https://opencollective.com/phalcon/tiers/backers.svg?avatarHeight=48&width=800&height=200">
200-
</a>
201-
202174
## License
203175

204176
Phalcon Developer Tools is open source software licensed under the [New BSD License][:license:].<br>

0 commit comments

Comments
 (0)