Skip to content

Commit

Permalink
Merge pull request #14702 from phalcon/4.0.x
Browse files Browse the repository at this point in the history
4.0.1
  • Loading branch information
sergeyklay authored Jan 11, 2020
2 parents fe17e3a + 0354a67 commit 55577fd
Show file tree
Hide file tree
Showing 314 changed files with 369,571 additions and 367,832 deletions.
111 changes: 111 additions & 0 deletions .ci/cleanup-packages.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
<?php

namespace PhalconCi;

class PackageCloud
{
protected const API_ENDPOINT = "packagecloud.io";

private $apiKey;
private $user;
private $repo;

public function __construct($apiKey, $user, $repo)
{
$this->apiKey = $apiKey;
$this->user = $user;
$this->repo = $repo;
}

protected function buildRequestUrl($url)
{
$baseUrl = "https://" . $this->apiKey . ":@" . self::API_ENDPOINT;
return $baseUrl . $url;
}

protected function getCurl()
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

return $ch;
}

public function query($url)
{
echo "Opening: " . $url . PHP_EOL;

$ch = $this->getCurl();

curl_setopt($ch, CURLOPT_URL, $this->buildRequestUrl($url));

if (false === ($retval = curl_exec($ch))) {
print_r(curl_error($ch));
curl_close($ch);
} else {
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
switch ($httpCode) {
case "200":
return json_decode($retval);
break;
default:
exit("Unable to connect to api");
}
}
}

public function getOutdatedPackages($days = 30)
{
$now = new \DateTime();

$packages = $this->query("/api/v1/repos/" . $this->user . "/" . $this->repo . "/packages.json?per_page=100");
$outdatedPackages = [];
foreach ($packages as $package) {
$packageDate = \DateTime::createFromFormat("Y-m-d\TH:i:s.u\Z", $package->created_at);
$age = $packageDate->diff($now)->days;
if ($age > $days) {
$package->age = $age;
$outdatedPackages[] = $package;
}
}
return $outdatedPackages;
}

public function deleteOutdatedPackages($days = 30)
{
$packages = $this->getOutdatedPackages($days);
foreach ($packages as $package) {
$this->deletePackage($package->destroy_url, $package->age);
}
}

public function deletePackage($packageUrl, $age)
{
echo "Deleting: " . $packageUrl . " [" . $age . " days old]... ";
$ch = $this->getCurl();

curl_setopt($ch, CURLOPT_URL, $this->buildRequestUrl($packageUrl));
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");

if (false === ($retval = curl_exec($ch))) {
print_r(curl_error($ch));
curl_close($ch);
} else {
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
switch ($httpCode) {
case "200":
echo "done" . PHP_EOL;
break;
default:
echo "fail" . PHP_EOL;
}
return json_decode($retval);
}
}
}

$packageCloud = new PackageCloud(getenv('PACKAGECLOUD_TOKEN'), "phalcon", "nightly");
$packageCloud->deleteOutdatedPackages(30); //days
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: Bug report
about: Create a report to help us improve
title: "[BUG]: "
labels: Bug - Unverified
labels: 'bug, status: unverified'
assignees: ''

---
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: Feature request
about: Suggest an idea for this project
title: "[NFR]: "
labels: Feature - NFR
labels: new feature request
assignees: ''

---
Expand Down
13 changes: 7 additions & 6 deletions .github/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ daysUntilClose: 1

# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable
exemptLabels:
- "Bug - Low"
- "Bug - Medium"
- "Bug - High"
- WIP
- "status: high"
- "status: medium"
- "status: low"
- "bug"
- "wip"
- Locked
- "Feature - NFR"
- "Enhancement"
- "new feature request"
- "enhancement"

# Set to true to ignore issues in a project (defaults to false)
exemptProjects: false
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/packagecloud-cleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Cleanup Packagecloud packages
on:
schedule:
- cron: '0 2 * * *' # Daily at 02:00
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Setup PHP
uses: shivammathur/setup-php@v1
with:
php-version: '7.4'
- name: Cleanup Packagecloud
run: php .ci/cleanup-packages.php
env:
PACKAGECLOUD_TOKEN: ${{ secrets.PACKAGECLOUD_TOKEN }}
92 changes: 92 additions & 0 deletions .github/workflows/pecl.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: Pecl builder

on:
create:
tags:
push:
paths:
- .github/workflows/pecl.yml
- package.xml
- 'build/php7/safe/**'
- LICENSE.txt
- CHANGELOG-4.0.md
- CODE_OF_CONDUCT.md
- CODE_OWNERS.TXT
pull_request:
paths:
- .github/workflows/pecl.yml
- package.xml
- 'build/php7/safe/**'
- LICENSE.txt
- CHANGELOG-4.0.md
- CODE_OF_CONDUCT.md
- CODE_OWNERS.TXT
jobs:
build:
runs-on: ubuntu-latest
name: Build Phalcon Pecl Package
steps:
- name: Show system info
run: uname -m
- name: Git checkout
uses: actions/checkout@v2-beta
with:
fetch-depth: 1
- name: Setup PHP
uses: shivammathur/setup-php@v1
with:
php-version: '7.4'
extensions: mbstring, intl, json
pecl: true
- name: Create pecl package
id: pecl_create
run: |
cp build/php7/safe/config.w32 config.w32
cp build/php7/safe/phalcon.zep.c phalcon.zep.c
cp build/php7/safe/config.m4 config.m4
cp build/php7/safe/php_phalcon.h php_phalcon.h
cp build/php7/safe/phalcon.zep.h phalcon.zep.h
pecl package
phalcon_package="`ls | grep phalcon-*tgz`"
mv $phalcon_package phalcon-pecl.tgz
- name: Validate pecl package
run: pecl package-validate phalcon-pecl.tgz
- uses: actions/upload-artifact@v1
with:
name: 'phalcon-pecl'
path: phalcon-pecl.tgz
install-nix:
needs: build
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest, macOS-latest]
php-versions: ['7.2', '7.3', '7.4']
name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }}
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v1
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, intl, json
pecl: true
- name: Testing PHP version
run: |
php -m
php -v | head -n 1
php-cgi -v | head -n 1
phpdbg -V | head -n 1
pecl -V
php-config --version
phpize -v
- name: Download phalcon pecl package
uses: actions/download-artifact@v1
with:
name: phalcon-pecl
- name: Install package
run: |
export MAKEFLAGS="-j$(getconf _NPROCESSORS_ONLN)"
sudo pecl -v install phalcon-pecl/phalcon-pecl.tgz
- name: Verify install
run: php -m | grep phalcon
21 changes: 20 additions & 1 deletion BACKERS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Our Backers and supporters

You can join them in supporting Phalcon and Zephir development by visiting our page on [Open Collective](https://phalcon.link/fund) and becoming a sponsor or a backer!
You can join them in supporting Phalcon and Zephir development by visiting our page on [Open Collective](https://opencollective.com/phalcon) or [Github sponsor](https://phalcon.link/fund) and becoming a sponsor or a backer!

### Supporters

Expand Down Expand Up @@ -74,5 +74,24 @@ Support us with a monthly donation and help us continue our activities. [[Become
<img src="https://opencollective.com/phalcon/tiers/backers.svg?avatarHeight=48&width=800&height=200">
</a>

## Github sponsors

Thanks for the support

[//]: github-sponsors

<a href="https://github.com/ninjapanzer"><img src="https://avatars1.githubusercontent.com/u/159591?s=460&v=4" title="Paul Scarrone" width="60" height="60"></a>
<a href="https://github.com/niden"><img src="https://avatars2.githubusercontent.com/u/1073784?s=460&v=4" title="Nikolaos Dimopoulos" width="60" height="60"></a>
<a href="https://github.com/qmegas"><img src="https://avatars3.githubusercontent.com/u/2444896?s=460&v=4" title="qmegas" width="60" height="60"></a>
<a href="https://github.com/terolblade"><img src="https://avatars3.githubusercontent.com/u/3078649?s=460&v=4" title="Stanislav Sviridenko" width="60" height="60"></a>
<a href="https://github.com/Ruzgfpegk"><img src="https://avatars1.githubusercontent.com/u/3818364?s=460&v=4" title="Ruzgfpegk" width="60" height="60"></a>
<a href="https://github.com/zsilbi"><img src="https://avatars2.githubusercontent.com/u/3886658?s=460&v=4" title="Balázs Németh" width="60" height="60"></a>
<a href="https://github.com/ruudboon"><img src="https://avatars3.githubusercontent.com/u/7444246?s=460&v=4" title="Ruud Boon" width="60" height="60"></a>
<a href="https://github.com/sitchi"><img src="https://avatars0.githubusercontent.com/u/11546683?s=460&v=4" title="Nikoloz Sitchinava" width="60" height="60"></a>
<a href="https://github.com/Montana"><img src="https://avatars3.githubusercontent.com/u/20936398?s=460&v=4" title="Montana Mendy" width="60" height="60"></a>
<a href="https://github.com/ak1113"><img src="https://avatars0.githubusercontent.com/u/38716832?s=460&v=4" title="Akira Kato" width="60" height="60"></a>

[//]: github-sponsors

## Core Team
[Ruud](https://github.com/ruudboon), [Nikolaos](https://github.com/niden), [Serghei](https://github.com/sergeyklay)
19 changes: 18 additions & 1 deletion CHANGELOG-4.0.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# [4.0.1](https://github.com/phalcon/cphalcon/releases/tag/v4.0.1) (2020-01-11)
## Added

## Changed
- Changed the logic when logging times for `Phalcon\Logger` to use `DateTimeImmutable` so as to handle microseconds if necessary. [#2893](https://github.com/phalcon/cphalcon/issues/2893)
- Changed `Phalcon\Http\Cookie::send` and `Phalcon\Http\Cookie::delete` to allow for `samesite` to be passed in the `options` when using PHP > 7.3 [#14627](https://github.com/phalcon/cphalcon/issues/14627)

## Fixed
- Fixed `Phalcon\Mvc\Model\Criteria` Di isn't set when using `Criteria::fromInput()` [#14538](https://github.com/phalcon/cphalcon/issues/14639)
- Fixed `Phalcon\Db\Dialect\Mysql` removing unnecessary parentheses for `double` and `float` [#14645](https://github.com/phalcon/cphalcon/pull/14645) [@pfz](https://github.com/pfz)
- Fixed `Phalcon\Http\Cookie::delete` to parse the correct parameters - cannot use alternative syntax until PHP 7.3 [#14643](https://github.com/phalcon/cphalcon/issues/14643)
- Fixed `Phalcon\Mvc\Model::__isset` to take into account non visible properties by checking the getter if it exists [#13518](https://github.com/phalcon/cphalcon/issues/13518) [#13900](https://github.com/phalcon/cphalcon/issues/13900)
- Fixed `Phalcon\Mvc\Model::__set` to return a more informative message if we are tying to access a non visible property [#13518](https://github.com/phalcon/cphalcon/issues/13518) [#13900](https://github.com/phalcon/cphalcon/issues/13900)
- Fixed `Phalcon\Mvc\Model\Resultset\Simple::toArray` to correctly process virtual fields [#14669](https://github.com/phalcon/cphalcon/issues/14669)
- Fixed `Phalcon\Session\Manager::getUniqueKey` to prefix the key only if `uniqueId` is present [#14688](https://github.com/phalcon/cphalcon/issues/14688)
- Fixed `Phalcon\Db\Adapter\Pdo::describeColumns` to correctly detect ENUM columns [#14691](https://github.com/phalcon/cphalcon/issues/14691)

# [4.0.0](https://github.com/phalcon/cphalcon/releases/tag/v4.0.0) (2019-12-21)

## Added
Expand All @@ -16,7 +33,7 @@
- Changed the `Phalcon\Storage\Adapter\*` constructors to require the `Phalcon\Storage\SerializerFactory` object [#14575](https://github.com/phalcon/cphalcon/pull/14628)

## Fixed
- Fixed `PhalconMvc\Model` to ignore internal setters if properties have the same name as the setter [#14538](https://github.com/phalcon/cphalcon/issues/14538)
- Fixed `Phalcon\Mvc\Model` to ignore internal setters if properties have the same name as the setter [#14538](https://github.com/phalcon/cphalcon/issues/14538)
- Fixed `Phalcon\Logger\Formatter\Line` to not add `PHP_EOL` at the end of the message and added it to the `Phalcon\Logger\Adapter\Stream` [#14547](https://github.com/phalcon/cphalcon/issues/14547)
- Fixed `Phalcon\Mvc\Model\MetaData\Apcu` and `Phalcon\Mvc\Model\MetaData\Redis` to allow setting the `prefix` and `lifetime` using the options or use the default. [#14549](https://github.com/phalcon/cphalcon/issues/14549)
- Fixed `Phalcon\Storage\Adapter\AbstractAdapter`, `Phalcon\Storage\Adapter\AbstractInterface` getters to contain a default value
Expand Down
30 changes: 30 additions & 0 deletions CODE_OWNERS.TXT
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
This file is a list of the people responsible for ensuring that patches for a
particular part of Phalcon are reviewed, either by themselves or by someone
else. They are also the gatekeepers for their part of Phalcon, with the final
word on what goes in or not.

The list is sorted by last name and formatted to allow easy grepping and
beautification by scripts. The fields are: name (N), email (E), web-address
(W), PGP key ID and fingerprint (P), description (D), and snail-mail address
(S).

The sample of querying command to search PECL keyword:
awk -v RS='' -v ORS='\n\n' '/\nD: .*PECL/' CODE_OWNERS.TXT

N: Ruud Boon
E: ruud@phalcon.io
W: https://ruudboon.io
P: 0xF2E9F914DFA1BCD7
D: PECL and all parts of Phalcon not covered by someone else

N: Nikolaos Dimopoulos
E: niden@phalcon.io
W: https://niden.net
P: 0x93F8CA07B9C8C41D
D: All parts of Phalcon not covered by someone else excluding PECL

N: Serghei Iakovlev
E: serghei@phalcon.io
W: https://serghei.blog
P: 0x1E0B5331219BEA88
D: CI/CD Integration, Zephir support, Parsers and Scanners, Volt, Annotation, PHQL support
Loading

0 comments on commit 55577fd

Please sign in to comment.