Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
# Conflicts:
#	library/Zend/Controller/Action.php
  • Loading branch information
mattimatti committed Aug 4, 2023
2 parents d1df387 + 7fa9c5f commit 93feaea
Show file tree
Hide file tree
Showing 3,243 changed files with 152,181 additions and 134,836 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
149 changes: 149 additions & 0 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
name: PHPUnit-9

on: [push, pull_request]

jobs:
phpunit:
name: Tests on PHP ${{ matrix.php-version }}

runs-on: ubuntu-22.04

env:
PHP_EXTENSIONS: none, posix, curl, dom, json, libxml, mbstring, openssl, tokenizer, xml, xmlwriter, ctype, iconv, simplexml, pdo_sqlite, pdo_mysql, fileinfo, json, zip, sqlite, soap, bcmath, mcrypt, igbinary, gd, bz2, lzf, rar, memcached, memcache
PHP_INI_VALUES: memory_limit=-1, assert.exception=1, zend.assertions=1, error_reporting=-1, log_errors_max_len=0, display_errors=On

TESTS_ZEND_DB_ADAPTER_PDO_MYSQL_ENABLED: true
TESTS_ZEND_DB_ADAPTER_MYSQL_USERNAME: github
TESTS_ZEND_DB_ADAPTER_MYSQL_PASSWORD: github
TESTS_ZEND_DB_ADAPTER_MYSQL_DATABASE: zftest
TESTS_ZEND_DB_ADAPTER_MYSQL_HOSTNAME: 127.0.0.1

TESTS_ZEND_DB_ADAPTER_PDO_PGSQL_ENABLED: true
TESTS_ZEND_DB_ADAPTER_PDO_PGSQL_USERNAME: github
TESTS_ZEND_DB_ADAPTER_PDO_PGSQL_PASSWORD: github
TESTS_ZEND_DB_ADAPTER_PDO_PGSQL_DATABASE: zftest

TESTS_ZEND_CACHE_SQLITE_ENABLED: true
TESTS_ZEND_DB_ADAPTER_PDO_SQLITE_ENABLED: true

TESTS_ZEND_CACHE_MEMCACHED_ENABLED: true
TESTS_ZEND_CACHE_MEMCACHED_HOST: 127.0.0.1
TESTS_ZEND_CACHE_MEMCACHED_PORT: 11211

TESTS_ZEND_CACHE_LIBMEMCACHED_ENABLED: true
TESTS_ZEND_CACHE_LIBMEMCACHED_HOST: 127.0.0.1
TESTS_ZEND_CACHE_LIBMEMCACHED_PORT: 11211

# https://hub.docker.com/r/bitnami/openldap
LDAP_ROOT: "dc=example,dc=com"
LDAP_ALLOW_ANON_BINDING: false
LDAP_SKIP_DEFAULT_TREE: "yes"
LDAP_ADMIN_USERNAME: "admin"
LDAP_ADMIN_PASSWORD: "insecure"
LDAP_CONFIG_ADMIN_USERNAME: "admin"
LDAP_CONFIG_ADMIN_PASSWORD: "configpassword"
TESTS_ZEND_LDAP_ONLINE_ENABLED: true
TESTS_ZEND_AUTH_ADAPTER_LDAP_ONLINE_ENABLED: true

LOCALES: "fr_FR@euro fr_FR fr_BE.UTF-8 de en_US"
services:
memcache:
image: memcached:1.6.17-alpine
ports:
- 11211:11211

mysql:
image: bitnami/mysql:8.0.31
env:
MYSQL_ROOT_USER: ${{ env.TESTS_ZEND_DB_ADAPTER_MYSQL_USERNAME }}
MYSQL_ROOT_PASSWORD: ${{ env.TESTS_ZEND_DB_ADAPTER_MYSQL_PASSWORD }}
MYSQL_DATABASE: ${{ env.TESTS_ZEND_DB_ADAPTER_MYSQL_DATABASE }}
MYSQL_AUTHENTICATION_PLUGIN: mysql_native_password
ports:
- 3306:3306
options: >-
--health-cmd "mysqladmin ping"
--health-interval 10s
--health-timeout 5s
--health-retries 10
postgres:
image: postgres:15.1-alpine
ports:
- 5432:5432
env:
POSTGRES_USER: ${{ env.TESTS_ZEND_DB_ADAPTER_PDO_PGSQL_USERNAME }}
POSTGRES_PASSWORD: ${{ env.TESTS_ZEND_DB_ADAPTER_PDO_PGSQL_PASSWORD }}
POSTGRES_DB: ${{ env.TESTS_ZEND_DB_ADAPTER_PDO_PGSQL_DATABASE }}
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
openldap:
image: bitnami/openldap:2.5
ports:
- 1389:1389
env:
LDAP_ROOT: ${{ env.LDAP_ROOT }}
LDAP_ALLOW_ANON_BINDING: ${{ env.LDAP_ALLOW_ANON_BINDING }}
LDAP_SKIP_DEFAULT_TREE: ${{ env.LDAP_SKIP_DEFAULT_TREE }}
LDAP_ADMIN_USERNAME: ${{ env.LDAP_ADMIN_USERNAME }}
LDAP_ADMIN_PASSWORD: ${{ env.LDAP_ADMIN_PASSWORD }}
LDAP_CONFIG_ADMIN_ENABLED: "yes"
LDAP_CONFIG_ADMIN_USERNAME: ${{ env.LDAP_CONFIG_ADMIN_USERNAME }}
LDAP_CONFIG_ADMIN_PASSWORD: ${{ env.LDAP_CONFIG_ADMIN_PASSWORD }}

strategy:
fail-fast: false
matrix:
php-version:
- "8.0"
- "8.1"
- "8.2"
experimental:
- false
include:
- php-version: "8.3"
experimental: true

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Locale
run: |
sudo apt-get update && sudo apt-get install tzdata locales -y && sudo locale-gen $LOCALES
echo "All languages..."
locale -a
- name: Provider config base on env for intergrate test
run: cp tests/TestConfiguration.env.php tests/TestConfiguration.php

- name: Install PHP with extensions
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: cs2pr
extensions: memcached, memcache
ini-values: ${{ env.PHP_INI_VALUES }}
env:
# https:/shivammathur/setup-php/issues/407#issuecomment-773675741
fail-fast: true

- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-suggest

- name: Lint PHP source files
run: |
bin/parallel-lint --exclude vendor --exclude tests/Zend/Loader/_files/ParseError.php . --checkstyle | cs2pr
- name: Setup LDAP
run: |
sudo apt-get install -y libnss-ldap libpam-ldap ldap-utils
tests/resources/openldap/docker-entrypoint-initdb.d/init.sh
- name: "Run tests on PHP ${{ matrix.php-version }} (Experimental: ${{ matrix.experimental }})"
run: bin/phpunit -c tests/phpunit.xml
continue-on-error: ${{ matrix.experimental }}
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,17 @@ tests/Zend/OpenId/_files/*
tests/Zend/Translate/Adapter/_files/zend_cache---internal-metadatas---testid
tests/Zend/Translate/Adapter/_files/zend_cache---testid
tests/TestConfiguration.php
tests/Zend/Cache/zend_cache_tmp_dir*
tests/Zend/Filter/_files/traversed.*
tests/Zend/Filter/_files/**/zipextracted.txt
tests/Zend/Mail/_files/test.tmp/INBOX
tests/Zend/Paginator/_files/test-write-tmp.sqlite
vendor/*
composer.lock
bin/dbunit
bin/phpunit
bin/parallel-lint
.php-cs-fixer.cache
.php_cs.cache
.idea
.vscode
17 changes: 17 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

use PhpCsFixer\Config;
use PhpCsFixer\Finder;

$finder = (new Finder())
->notPath('tests/Zend/Loader/_files/ParseError.php')
->in('.');

return (new Config())
->setRiskyAllowed(true)
->setFinder($finder)
->setRules([
'array_syntax' => ['syntax' => 'short'],
'modernize_types_casting' => true,
'logical_operators' => true,
]);
56 changes: 27 additions & 29 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,42 @@
language: php

sudo: false

php:
- 5.2
- 5.3
- 5.4
- 5.5
- 5.6
- 7
- hhvm
jobs:
include:
- php: 7.0
- php: 7.1
- php: 7.2
- php: 7.3
- php: 7.4
- php: 8.0
allow_failures:
- php: 8.0
fast_finish: true

env: TMPDIR=/tmp
env:
- DEFAULT_COMPOSER_FLAGS="--no-interaction --no-progress --no-suggest" USE_XDEBUG=false

install:
- if [[ "$TRAVIS_PHP_VERSION" == "5.2" ]]; then sh ./tests/php52_install_dependencies.sh; fi
- phpenv rehash
cache:
directories:
- $HOME/.composer/cache

services:
- memcached
- mysql
- postgresql

install:
- phpenv rehash
- if [[ "$USE_XDEBUG" == false ]]; then phpenv config-rm xdebug.ini || return 0; fi
- if [[ "$TRAVIS_PHP_VERSION" == 7* ]]; then phpenv config-add tests/php7.travis.ini; fi
- composer install

before_script:
- phpenv config-rm xdebug.ini || return 0
- if [[ "$TRAVIS_PHP_VERSION" != "5.2" ]]; then travis_retry composer self-update; fi
- if [[ "$TRAVIS_PHP_VERSION" != "5.2" ]]; then travis_retry composer install --no-interaction --prefer-source --dev; fi

- mysql -e 'create database zftest;'
- psql -c 'create database zftest;' -U postgres

- if [[ "$TRAVIS_PHP_VERSION" != "5.2" ]] && [[ "$TRAVIS_PHP_VERSION" != "hhvm" ]] && [[ "$TRAVIS_PHP_VERSION" != "7" ]]; then phpenv config-add tests/config.ini; fi
- if [[ "$TRAVIS_PHP_VERSION" == "5.2" ]]; then phpenv config-add tests/php52_config.ini; fi
- if [[ "$TRAVIS_PHP_VERSION" == "7" ]]; then phpenv config-add tests/php7_config.ini; fi

- cp ./tests/TestConfiguration.travis.php ./tests/TestConfiguration.php

script:
- cd tests/
- php runalltests.php

matrix:
allow_failures:
- php: 7
- php: hhvm
- ./vendor/bin/phpunit

# EOF
36 changes: 36 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [1.22.0] - 2023-01-16
### Added
- Github actions and test improvements #298, #292, #287, #285, #284, #280, #275, #273, #272, #269
- Add AllowDynamicProperties Attribute to classes
- Rector added for easier version upgrades #290
- Mysqli support for connection flags #300

### Fixed
- Limit mktime() YEAR input to prevent 504 error #299
- Generic fixes #310, #303, #297, #296, #295, #279
- Parameter type corrections #306, #294, #266
- Removed code supporting PHP 5.3.3 #265
- stream_set_option is not implemented error fixed #263
- Further PHP 8.2 fixes #291, #289, #281, #261, #268, #277
- Depreciation message fixed for strtoupper #260
- Further PHP 8.1 fixes #301, #258, #269

## [1.21.4] - 2022-09-22
### Added
- CHANGELOG.md
- Now accepting HTTP 2 in Zend_Http_Response #247
### Fixed
- preg_match deprication fixed #256
- Annotation correction #255
- utf8_encode() and utf8_decode() which PHP 8.2 will depricate, have been replaced #252
- Fix for deprecation of ${var} string interpolation for PHP 8.2 #253
- Fixes array keys in filter constructor call #249
- Fixes re-encoding in PDF properties #245
48 changes: 44 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,47 @@
Post end of life changes for zf1 to allow compatibility with the latest PHP versions.
![zf1-future logo](https://imgur.com/S0i6qOh.png)
<sub><sup>Thanks to [WebTigers](https:/WebTigers) for the logo</sup></sub>
# Zend Framework 1 now for PHP 8.1!
### Classic ZF1 Reborn
Zend may have abandoned the original Zend Framework, but the global Zend Framework Community has not! Since Zend sentenced ZF1 to EOL, the Zend Framework community around the globe has continued to work and build on what we consider to be one of the best PHP frameworks of all time.

If you have any requests for tags, releases, or anything else. Feel free to raise an issue and I'll get it sorted.
# ZF1-Future Sponsors
### Products and Projects built with ZF1-Future:

Installable through git clone or through `composer require shardj/zf1-future` https://packagist.org/packages/shardj/zf1-future
<a href="https://webtigers.com"><img src="https://webtigers.s3.amazonaws.com/logos/Logo-New-1-Dark.png" width="50%" /></a>

Recently https:/Shardj/zf1-extras-future has been created for those who need it.
Creators of the [Tiger Development Platform](https://webtigers.com) featuring ZF1-Future

<a href="https://seidengroup.com"><img src="https://www.seidengroup.com/wp-content/uploads/2017/03/SeidenLogo-180.png" alt="Seiden Group: IBM i modernization, PHP, Python, Node.js, and modern RPG" /></a>

Creators of [CommunityPlus+ PHP for IBM i](https://www.seidengroup.com/communityplus-php-for-ibm-i/) featuring ZF1-Future

# ZF1 is Now Version 1.21!
### Over 200 updates and bug fixes since 1.12!
The ZF1 community has been hard at work updating Zend Framework with all of the latest features of PHP 8 and 8.1.

# Documentation
New ZF1-Future Manual: [ZF1-Future Docs](https://zf1future.com/manual)

### Original Docs
The original docs can be found here: https://framework.zend.com/manual/1.12/en/manual.html

### Installation

Installable through git clone or through
`composer require shardj/zf1-future` https://packagist.org/packages/shardj/zf1-future

# System Requirements
ZF1 Future runs on any version of PHP between 7.1 and 8.1! (see composer.json)

# License
The files in this archive are released under the Zend Framework license. You can find a copy of this license in [LICENSE.txt](LICENSE.txt).

# Related Projects

* [ZF1 Extras Future](https:/Shardj/zf1-extras-future)
* [ZF1s](https:/zf1s) - Another community supported continuation of ZF1, with a focus on splitting the frameworks original components into individual packages

# Known issues and solutions

* ``Bootstrap error: Unable to resolve plugin "useragent"; no corresponding plugin with that name``
See comments in: https:/Shardj/zf1-future/issues/92
6 changes: 6 additions & 0 deletions bin/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
!.gitignore
!classmap_generator.php
!zf.bat
!zf.php
!zf.sh
*
12 changes: 7 additions & 5 deletions bin/classmap_generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,18 @@
$libraryPath = getcwd();

// Setup autoloading
$loader = new Zend_Loader_StandardAutoloader(array('autoregister_zf' => true));
$loader = new Zend_Loader_StandardAutoloader(['autoregister_zf' => true]);
$loader->setFallbackAutoloader(true);
$loader->register();

$rules = array(
$rules = [
'help|h' => 'Get usage message',
'library|l-s' => 'Library to parse; if none provided, assumes current directory',
'output|o-s' => 'Where to write autoload file; if not provided, assumes "autoload_classmap.php" in library directory',
'append|a' => 'Append to autoload file if it exists',
'overwrite|w' => 'Whether or not to overwrite existing autoload file',
'ignore|i-s' => 'Comma-separated namespaces to ignore',
);
];

try {
$opts = new Zend_Console_Getopt($rules);
Expand All @@ -78,7 +78,7 @@
exit(0);
}

$ignoreNamespaces = array();
$ignoreNamespaces = [];
if (isset($opts->i)) {
$ignoreNamespaces = explode(',', $opts->i);
}
Expand Down Expand Up @@ -229,7 +229,9 @@
$maxWidth = max($maxWidth, strlen($match[1]));
}

$content = preg_replace('(\n\s+([^=]+)=>)e', "'\n \\1' . str_repeat(' ', " . $maxWidth . " - strlen('\\1')) . '=>'", $content);
$content = preg_replace_callback('(\n\s+([^=]+)=>)', function ($matches) use ($maxWidth) {
return "\n " . $matches[1] . str_repeat(' ', $maxWidth - strlen($matches[1])) . '=>';
}, $content);

// Make the file end by EOL
$content = rtrim($content, "\n") . "\n";
Expand Down
Loading

0 comments on commit 93feaea

Please sign in to comment.