Skip to content

Commit

Permalink
Merge branch '5.0.x' into #15343-improve-stubs
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeckerson committed May 1, 2021
2 parents fbf3f2c + b0dfa5e commit 5bddc28
Show file tree
Hide file tree
Showing 105 changed files with 961 additions and 949 deletions.
28 changes: 24 additions & 4 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ jobs:
- name: Setup Environment Variables
run: |
echo "ZEPHIR_PARSER_VERSION=v1.3.6" >> $GITHUB_ENV
echo "ZEPHIR_VERSION=0.13.1" >> $GITHUB_ENV
echo "ZEPHIR_VERSION=0.13.4" >> $GITHUB_ENV
echo "LANG=en_US.UTF-8" >> $GITHUB_ENV
echo "LANGUAGE=en_US.UTF-8" >> $GITHUB_ENV
echo "LC_ALL=en_US.UTF-8" >> $GITHUB_ENV
- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand Down Expand Up @@ -73,6 +76,12 @@ jobs:
$HOME/bin/zephir generate
(cd build && php gen-build.php)
- name: Upload compile-errors.log
uses: actions/upload-artifact@v2
with:
name: compile-errors
path: compile-errors.log

- name: Create Pecl Package (PHP 8)
id: pecl_create
run: |
Expand Down Expand Up @@ -164,7 +173,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, intl, json, gd, imagick, redis, igbinary, apcu, msgpack, memcached, yaml
extensions: mbstring, intl, json, imagick, gd, gettext, igbinary, apcu, msgpack, memcached, yaml, redis
ini-values: apc.enable_cli=on, session.save_path=/tmp, extension=psr.so, extension=phalcon.so
tools: pecl

Expand All @@ -181,6 +190,17 @@ jobs:
- name: Verify Install
run: php --ri phalcon

- name: Setup locales
run: |
sudo sudo apt-get install tzdata locales -y
sudo sed -i -e 's/# de_DE.UTF-8 UTF-8/de_DE.UTF-8 UTF-8/' /etc/locale.gen
sudo sed -i -e 's/# el_GR.UTF-8 UTF-8/el_GR.UTF-8 UTF-8/' /etc/locale.gen
sudo sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen
sudo sed -i -e 's/# es_ES.UTF-8 UTF-8/es_ES.UTF-8 UTF-8/' /etc/locale.gen
sudo sed -i -e 's/# ru_RU.UTF-8 UTF-8/ru_RU.UTF-8 UTF-8/' /etc/locale.gen
sudo dpkg-reconfigure --frontend=noninteractive locales
sudo update-locale LANG=en_US.UTF-8
- name: Install Packages
run: composer install --prefer-dist

Expand Down Expand Up @@ -252,7 +272,7 @@ jobs:
needs: generate
runs-on: ${{ matrix.operating-system }}
env:
PHP_EXTENSIONS: mbstring, intl, json, yaml, apcu, gd, imagick, igbinary, msgpack-beta, redis
PHP_EXTENSIONS: mbstring, intl, json, yaml, apcu, imagick, gd, gettext, igbinary, msgpack-beta, redis
HOMEBREW_NO_INSTALL_CLEANUP: 1
strategy:
fail-fast: false
Expand Down Expand Up @@ -400,7 +420,7 @@ jobs:
php-version: ${{ matrix.php-versions }}
ini-values: apc.enable_cli=on, session.save_path=C:\temp
tools: pecl
extensions: mbstring, intl, json, yaml, apcu, gd, imagick, redis, igbinary, sqlite3, msgpack, psr
extensions: mbstring, intl, json, yaml, apcu, imagick, gd, gettext, igbinary, sqlite3, msgpack, psr, redis
env:
PHPTS: ${{ matrix.ts }}

Expand Down
18 changes: 16 additions & 2 deletions .github/workflows/codecoverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,16 @@ jobs:
- name: Setup Environment Variables
run: |
echo "ZEPHIR_PARSER_VERSION=v1.3.6" >> $GITHUB_ENV
echo "ZEPHIR_VERSION=0.13.1" >> $GITHUB_ENV
echo "ZEPHIR_VERSION=0.13.4" >> $GITHUB_ENV
echo "LANG=en_US.UTF-8" >> $GITHUB_ENV
echo "LANGUAGE=en_US.UTF-8" >> $GITHUB_ENV
echo "LC_ALL=en_US.UTF-8" >> $GITHUB_ENV
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
extensions: mbstring, intl, json, gd, imagick, apcu, yaml, redis, igbinary, msgpack, psr
extensions: mbstring, intl, json, imagick, gd, gettext, apcu, yaml, igbinary, msgpack, psr, redis
ini-values: apc.enable_cli=on, session.save_path=/tmp, extension=psr.so, extension=phalcon.so

- name: Common Settings
Expand Down Expand Up @@ -124,6 +127,17 @@ jobs:
- name: Verify Install
run: php --ri phalcon

- name: Setup locales
run: |
sudo sudo apt-get install tzdata locales -y
sudo sed -i -e 's/# de_DE.UTF-8 UTF-8/de_DE.UTF-8 UTF-8/' /etc/locale.gen
sudo sed -i -e 's/# el_GR.UTF-8 UTF-8/el_GR.UTF-8 UTF-8/' /etc/locale.gen
sudo sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen
sudo sed -i -e 's/# es_ES.UTF-8 UTF-8/es_ES.UTF-8 UTF-8/' /etc/locale.gen
sudo sed -i -e 's/# ru_RU.UTF-8 UTF-8/ru_RU.UTF-8 UTF-8/' /etc/locale.gen
sudo dpkg-reconfigure --frontend=noninteractive locales
sudo update-locale LANG=en_US.UTF-8
- name: Install Packages
run: composer install --prefer-dist

Expand Down
16 changes: 15 additions & 1 deletion CHANGELOG-5.0.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,24 @@
# [5.0.0-alpha.2](https://github.com/phalcon/cphalcon/releases/tag/v5.0.0-alpha.2) (xxxx-xx-xx)

## Changed
- Changed the logging names types to uppercase [#15375](https://github.com/phalcon/cphalcon/issues/15375)
- Changes to the `Phalcon\Logger`:
- Renamed `Phalcon\Logger\Item::getName` to `Phalcon\Logger\Item::getLevelName`
- Renamed `Phalcon\Logger\Item::getType` to `Phalcon\Logger\Item::getLevel`
- Changed the logger timestamp to be `DateTimeImmutable` on a per item basis - more accurate timing
- Changed `Phalcon\Logger` to accept a `DateTimeZone` in the constructor
- Changed placeholder `%type%` to `%level%` to align with the variables [#15411](https://github.com/phalcon/cphalcon/issues/15411)
- Changed `Phalcon\Mvc\Model::getSchema()`, `Phalcon\Mvc\ModelInterface::getSchema()`, `Phalcon\Mvc\Model\Manager::getModelSchema()` `Phalcon\Mvc\Model\ManagerInterface::getModelSchema()` to return `string | null` so as to abide with the latest Zephir [#15411](https://github.com/phalcon/cphalcon/issues/15411)
- Changed the interpolation for the formatters to use the `Phalcon\Support\Helper\Str\Interpolate` [#15411](https://github.com/phalcon/cphalcon/issues/15411)
- Changed the exceptions thrown from factories to be more specific to their namespaces vs. the Factory generic one [#15411](https://github.com/phalcon/cphalcon/issues/15411)

## Added
- Added BINARY and VARBINARY support for Phalcon\Db\Adapter\Mysql [#14927](https://github.com/phalcon/cphalcon/issues/14927)
- Added `BINARY` and `VARBINARY` support for Phalcon\Db\Adapter\Mysql [#14927](https://github.com/phalcon/cphalcon/issues/14927)
- Added `Phalcon\Db\Profiler\Item::getTotalElapsedNanoseconds()` and `Phalcon\Db\Profiler\Item::getTotalElapsedMilliseconds()` for more precision [#15249](https://github.com/phalcon/cphalcon/issues/15249)
- Added `Phalcon\Http\Response\Cookies::isSent()` and `Phalcon\Http\Response\Headers::isSent()`; Added logic to not send the headers or cookies twice. [#15334](https://github.com/phalcon/cphalcon/issues/15334)
- Added `Phalcon\Validation\Validator\File\AbstractFile::checkIsUploadedFile()` method to allow overriding when adding files to the `$_FILES` array directly (not uploading). [#15051](https://github.com/phalcon/cphalcon/issues/15051)
- Added `Phalcon\Support\Helper\Str\Interpolate` to be used throughout the code for interpolation (Logger/Translator) `%type%` to `%level%` to align with the variables [#15411](https://github.com/phalcon/cphalcon/issues/15411)
- Added `Phalcon\Support\HelperFactory` for an easier creation/access of helpers [#15411](https://github.com/phalcon/cphalcon/issues/15411)

## Changed
- `Phalcon\Version` is now moved to `Phalcon\Support\Version`
Expand Down
80 changes: 62 additions & 18 deletions docker/7.4/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,28 @@ ENV MAKEFLAGS="-j${CPU_CORES}"

ADD ./extra.ini /usr/local/etc/php/conf.d/

RUN apt update -y && apt install -y \
nano \
wget \
zip \
git \
apt-utils \
sudo \
libpq-dev \
libmemcached-dev \
libmagickwand-dev \
libyaml-dev \
libicu-dev \
libgmp-dev \
libpng-dev \
libzip-dev && \
pecl install psr && \
# Update
RUN apt update -y && \
apt install -y \
apt-utils \
gettext \
git \
libgmp-dev \
libicu-dev \
libmagickwand-dev \
libmemcached-dev \
libpng-dev \
libpq-dev \
libyaml-dev \
libzip-dev \
locales \
nano \
sudo \
wget \
zip

# PECL Packages
RUN pecl install psr && \
pecl install -o -f redis && \
pecl install igbinary && \
pecl install msgpack && \
Expand All @@ -31,14 +37,52 @@ RUN apt update -y && apt install -y \
pecl install memcached && \
pecl install xdebug

# Locale
RUN sed -i -e 's/# de_DE.UTF-8 UTF-8/de_DE.UTF-8 UTF-8/' /etc/locale.gen && \
sed -i -e 's/# el_GR.UTF-8 UTF-8/el_GR.UTF-8 UTF-8/' /etc/locale.gen && \
sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
sed -i -e 's/# es_ES.UTF-8 UTF-8/es_ES.UTF-8 UTF-8/' /etc/locale.gen && \
sed -i -e 's/# ru_RU.UTF-8 UTF-8/ru_RU.UTF-8 UTF-8/' /etc/locale.gen && \
dpkg-reconfigure --frontend=noninteractive locales && \
update-locale LANG=en_US.UTF-8

# Locale Environment
ENV LANG=en_US.UTF-8 \
LANGUAGE=en_US.UTF-8 \
LC_ALL=en_US.UTF-8

# Zephir Parser
RUN curl -s https://raw.githubusercontent.com/phalcon/zephir/development/.ci/install-zephir-parser.sh | bash

# Install PHP extensions
RUN docker-php-ext-configure gd --with-freetype --with-jpeg=/usr/include/ --enable-gd

RUN docker-php-ext-install zip gmp gd intl pdo_mysql pdo_pgsql && \
docker-php-ext-enable psr redis igbinary msgpack apcu imagick yaml memcached xdebug
RUN docker-php-ext-install \
gd \
gettext \
gmp \
intl \
pdo_mysql \
pdo_pgsql \
zip

# Install PHP extensions
RUN docker-php-ext-enable \
psr \
gettext \
redis \
igbinary \
msgpack \
apcu \
imagick \
yaml \
memcached \
xdebug

# Composer
COPY --from=composer /usr/bin/composer /usr/local/bin/composer

# Bash script with helper aliases
COPY ./.bashrc /root/.bashrc

CMD ["php-fpm"]
81 changes: 63 additions & 18 deletions docker/8.0/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,28 @@ ENV MAKEFLAGS="-j${CPU_CORES}"

ADD ./extra.ini /usr/local/etc/php/conf.d/

RUN apt update -y && apt install -y \
nano \
wget \
zip \
git \
apt-utils \
sudo \
libpq-dev \
libmemcached-dev \
libmagickwand-dev \
libyaml-dev \
libicu-dev \
libgmp-dev \
libpng-dev \
libzip-dev && \
pecl install psr && \
# Update
RUN apt update -y && \
apt install -y \
apt-utils \
gettext \
git \
libgmp-dev \
libicu-dev \
libmagickwand-dev \
libmemcached-dev \
libpng-dev \
libpq-dev \
libyaml-dev \
libzip-dev \
locales \
nano \
sudo \
wget \
zip

# PECL Packages
RUN pecl install psr && \
pecl install -o -f redis && \
pecl install igbinary && \
pecl install msgpack && \
Expand All @@ -37,14 +43,53 @@ RUN cd /opt && \
phpize && ./configure && \
make && make install

# Locale
RUN sed -i -e 's/# de_DE.UTF-8 UTF-8/de_DE.UTF-8 UTF-8/' /etc/locale.gen && \
sed -i -e 's/# el_GR.UTF-8 UTF-8/el_GR.UTF-8 UTF-8/' /etc/locale.gen && \
sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
sed -i -e 's/# es_ES.UTF-8 UTF-8/es_ES.UTF-8 UTF-8/' /etc/locale.gen && \
sed -i -e 's/# ru_RU.UTF-8 UTF-8/ru_RU.UTF-8 UTF-8/' /etc/locale.gen && \
dpkg-reconfigure --frontend=noninteractive locales && \
update-locale LANG=en_US.UTF-8

# Locale Environment
ENV LANG=en_US.UTF-8 \
LANGUAGE=en_US.UTF-8 \
LC_ALL=en_US.UTF-8

# Zephir Parser
RUN cd /opt && \
curl -s https://raw.githubusercontent.com/phalcon/zephir/development/.ci/install-zephir-parser.sh | bash

# Install PHP extensions
RUN docker-php-ext-configure gd --with-freetype --with-jpeg=/usr/include/ --enable-gd

RUN docker-php-ext-install zip gmp gd intl pdo_mysql pdo_pgsql && \
docker-php-ext-enable psr redis igbinary msgpack apcu imagick yaml memcached xdebug
RUN docker-php-ext-install \
gd \
gettext \
gmp \
intl \
pdo_mysql \
pdo_pgsql \
zip

# Install PHP extensions
RUN docker-php-ext-enable \
psr \
gettext \
redis \
igbinary \
msgpack \
apcu \
imagick \
yaml \
memcached \
xdebug

# Composer
COPY --from=composer /usr/bin/composer /usr/local/bin/composer

# Bash script with helper aliases
COPY ./.bashrc /root/.bashrc

CMD ["php-fpm"]
2 changes: 2 additions & 0 deletions phalcon/Annotations/AnnotationsFactory.zep
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ use Phalcon\Helper\Arr;
*/
class AnnotationsFactory extends AbstractFactory
{
protected exception = "Phalcon\\Annotations\\Exception";

/**
* AdapterFactory constructor.
*/
Expand Down
3 changes: 2 additions & 1 deletion phalcon/Cache/AdapterFactory.zep
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
namespace Phalcon\Cache;

use Phalcon\Cache\Adapter\AdapterInterface;
use Phalcon\Cache\Exception\Exception;
use Phalcon\Factory\AbstractFactory;
use Phalcon\Storage\SerializerFactory;

Expand All @@ -20,6 +19,8 @@ use Phalcon\Storage\SerializerFactory;
*/
class AdapterFactory extends AbstractFactory
{
protected exception = "Phalcon\\Cache\\Exception\\Exception";

/**
* @var SerializerFactory
*/
Expand Down
2 changes: 2 additions & 0 deletions phalcon/Config/ConfigFactory.zep
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ use Phalcon\Helper\Arr;
*/
class ConfigFactory extends AbstractFactory
{
protected exception = "Phalcon\\Config\\Exception";

/**
* ConfigFactory constructor.
*/
Expand Down
2 changes: 1 addition & 1 deletion phalcon/Db/Adapter/Pdo/Postgresql.zep
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class Postgresql extends PdoAdapter
if fetch schema, descriptor["schema"] {
unset descriptor["schema"];
} else {
let schema = "";
let schema = null;
}

if isset descriptor["password"] {
Expand Down
2 changes: 2 additions & 0 deletions phalcon/Db/Adapter/PdoFactory.zep
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ use Phalcon\Helper\Arr;

class PdoFactory extends AbstractFactory
{
protected exception = "Phalcon\\Db\\Exception";

/**
* Constructor
*/
Expand Down
Loading

0 comments on commit 5bddc28

Please sign in to comment.