PK 0˜´PK8%Ú Ú
LICENSE.mdnu €žÙ˜ Copyright (c) 2020 Laminas Project a Series of LF Projects, LLC.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
- Neither the name of Laminas Foundation nor the names of its contributors may
be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
PK 0˜´PÁÖFý[ [ COPYRIGHT.mdnu €žÙ˜ Copyright (c) 2020 Laminas Project a Series of LF Projects, LLC. (https://getlaminas.org/)
PK 0˜´PÆSÆ Æ .travis.ymlnu €žÙ˜ language: php
cache:
directories:
- $HOME/.composer/cache
env:
global:
- COMPOSER_ARGS="--no-interaction"
- COVERAGE_DEPS="php-coveralls/php-coveralls"
matrix:
fast_finish: true
include:
- php: 5.6
- php: 7.0
- php: 7.1
- php: 7.2
env:
- TEST_COVERAGE=true
- CS_CHECK=true
- php: 7.3
- php: 7.4
before_install:
- if [[ $TEST_COVERAGE != 'true' ]]; then phpenv config-rm xdebug.ini || return 0 ; fi
install:
- travis_retry composer install $COMPOSER_ARGS
- if [[ $TEST_COVERAGE == 'true' ]]; then travis_retry composer require --dev $COMPOSER_ARGS $COVERAGE_DEPS ; fi
- stty cols 120 && composer show
script:
- if [[ $TEST_COVERAGE == 'true' ]]; then composer test-coverage ; else composer test ; fi
- if [[ $CS_CHECK == 'true' ]]; then composer cs-check ; fi
after_script:
- if [[ $TEST_COVERAGE == 'true' ]]; then vendor/bin/php-coveralls -v ; fi
notifications:
email: false
PK 0˜´Pxú= = .coveralls.ymlnu €žÙ˜ coverage_clover: clover.xml
json_path: coveralls-upload.json
PK 0˜´P“³™Ú% % phpcs.xmlnu €žÙ˜
src
test
test/TestAsset/
test/classes.php
PK 0˜´PK™FÐÅ Å README.mdnu €žÙ˜ # laminas-zendframework-bridge
[![Build Status](https://travis-ci.com/laminas/laminas-zendframework-bridge.svg?branch=master)](https://travis-ci.com/laminas/laminas-zendframework-bridge)
[![Coverage Status](https://coveralls.io/repos/github/laminas/laminas-zendframework-bridge/badge.svg?branch=master)](https://coveralls.io/github/laminas/laminas-zendframework-bridge?branch=master)
This library provides a custom autoloader that aliases legacy Zend Framework,
Apigility, and Expressive classes to their replacements under the Laminas
Project.
This package should be installed only if you are also using the composer plugin
that installs Laminas packages to replace ZF/Apigility/Expressive packages.
## Installation
Run the following to install this library:
```bash
$ composer require laminas/laminas-zendframework-bridge
```
## Support
* [Issues](https://github.com/laminas/laminas-zendframework-bridge/issues/)
* [Forum](https://discourse.laminas.dev/)
PK 0˜´PŒéÕú/ /
.gitignorenu €žÙ˜ /.phpunit.result.cache
/composer.lock
/vendor/
PK 0˜´PÛe郊E ŠE config/replacements.phpnu €žÙ˜ 'zendframework/zendframework',
'zend-developer-tools/toolbar/bjy' => 'zend-developer-tools/toolbar/bjy',
'zend-developer-tools/toolbar/doctrine' => 'zend-developer-tools/toolbar/doctrine',
// NAMESPACES
// Zend Framework components
'Zend\\AuraDi\\Config' => 'Laminas\\AuraDi\\Config',
'Zend\\Authentication' => 'Laminas\\Authentication',
'Zend\\Barcode' => 'Laminas\\Barcode',
'Zend\\Cache' => 'Laminas\\Cache',
'Zend\\Captcha' => 'Laminas\\Captcha',
'Zend\\Code' => 'Laminas\\Code',
'ZendCodingStandard\\Sniffs' => 'LaminasCodingStandard\\Sniffs',
'ZendCodingStandard\\Utils' => 'LaminasCodingStandard\\Utils',
'Zend\\ComponentInstaller' => 'Laminas\\ComponentInstaller',
'Zend\\Config' => 'Laminas\\Config',
'Zend\\ConfigAggregator' => 'Laminas\\ConfigAggregator',
'Zend\\ConfigAggregatorModuleManager' => 'Laminas\\ConfigAggregatorModuleManager',
'Zend\\ConfigAggregatorParameters' => 'Laminas\\ConfigAggregatorParameters',
'Zend\\Console' => 'Laminas\\Console',
'Zend\\ContainerConfigTest' => 'Laminas\\ContainerConfigTest',
'Zend\\Crypt' => 'Laminas\\Crypt',
'Zend\\Db' => 'Laminas\\Db',
'ZendDeveloperTools' => 'Laminas\\DeveloperTools',
'Zend\\Di' => 'Laminas\\Di',
'Zend\\Diactoros' => 'Laminas\\Diactoros',
'ZendDiagnostics\\Check' => 'Laminas\\Diagnostics\\Check',
'ZendDiagnostics\\Result' => 'Laminas\\Diagnostics\\Result',
'ZendDiagnostics\\Runner' => 'Laminas\\Diagnostics\\Runner',
'Zend\\Dom' => 'Laminas\\Dom',
'Zend\\Escaper' => 'Laminas\\Escaper',
'Zend\\EventManager' => 'Laminas\\EventManager',
'Zend\\Feed' => 'Laminas\\Feed',
'Zend\\File' => 'Laminas\\File',
'Zend\\Filter' => 'Laminas\\Filter',
'Zend\\Form' => 'Laminas\\Form',
'Zend\\Http' => 'Laminas\\Http',
'Zend\\HttpHandlerRunner' => 'Laminas\\HttpHandlerRunner',
'Zend\\Hydrator' => 'Laminas\\Hydrator',
'Zend\\I18n' => 'Laminas\\I18n',
'Zend\\InputFilter' => 'Laminas\\InputFilter',
'Zend\\Json' => 'Laminas\\Json',
'Zend\\Ldap' => 'Laminas\\Ldap',
'Zend\\Loader' => 'Laminas\\Loader',
'Zend\\Log' => 'Laminas\\Log',
'Zend\\Mail' => 'Laminas\\Mail',
'Zend\\Math' => 'Laminas\\Math',
'Zend\\Memory' => 'Laminas\\Memory',
'Zend\\Mime' => 'Laminas\\Mime',
'Zend\\ModuleManager' => 'Laminas\\ModuleManager',
'Zend\\Mvc' => 'Laminas\\Mvc',
'Zend\\Navigation' => 'Laminas\\Navigation',
'Zend\\Paginator' => 'Laminas\\Paginator',
'Zend\\Permissions' => 'Laminas\\Permissions',
'Zend\\Pimple\\Config' => 'Laminas\\Pimple\\Config',
'Zend\\ProblemDetails' => 'Mezzio\\ProblemDetails',
'Zend\\ProgressBar' => 'Laminas\\ProgressBar',
'Zend\\Psr7Bridge' => 'Laminas\\Psr7Bridge',
'Zend\\Router' => 'Laminas\\Router',
'Zend\\Serializer' => 'Laminas\\Serializer',
'Zend\\Server' => 'Laminas\\Server',
'Zend\\ServiceManager' => 'Laminas\\ServiceManager',
'ZendService\\ReCaptcha' => 'Laminas\\ReCaptcha',
'ZendService\\Twitter' => 'Laminas\\Twitter',
'Zend\\Session' => 'Laminas\\Session',
'Zend\\SkeletonInstaller' => 'Laminas\\SkeletonInstaller',
'Zend\\Soap' => 'Laminas\\Soap',
'Zend\\Stdlib' => 'Laminas\\Stdlib',
'Zend\\Stratigility' => 'Laminas\\Stratigility',
'Zend\\Tag' => 'Laminas\\Tag',
'Zend\\Test' => 'Laminas\\Test',
'Zend\\Text' => 'Laminas\\Text',
'Zend\\Uri' => 'Laminas\\Uri',
'Zend\\Validator' => 'Laminas\\Validator',
'Zend\\View' => 'Laminas\\View',
'ZendXml' => 'Laminas\\Xml',
'Zend\\Xml2Json' => 'Laminas\\Xml2Json',
'Zend\\XmlRpc' => 'Laminas\\XmlRpc',
'ZendOAuth' => 'Laminas\\OAuth',
// class ZendAcl in zend-expressive-authorization-acl
'ZendAcl' => 'LaminasAcl',
'Zend\\Expressive\\Authorization\\Acl\\ZendAcl' => 'Mezzio\\Authorization\\Acl\\LaminasAcl',
// class ZendHttpClientDecorator in zend-feed
'ZendHttp' => 'LaminasHttp',
// class ZendModuleProvider in zend-config-aggregator-modulemanager
'ZendModule' => 'LaminasModule',
// class ZendRbac in zend-expressive-authorization-rbac
'ZendRbac' => 'LaminasRbac',
'Zend\\Expressive\\Authorization\\Rbac\\ZendRbac' => 'Mezzio\\Authorization\\Rbac\\LaminasRbac',
// class ZendRouter in zend-expressive-router-zendrouter
'ZendRouter' => 'LaminasRouter',
'Zend\\Expressive\\Router\\ZendRouter' => 'Mezzio\\Router\\LaminasRouter',
// class ZendViewRenderer in zend-expressive-zendviewrenderer
'ZendViewRenderer' => 'LaminasViewRenderer',
'Zend\\Expressive\\ZendView\\ZendViewRenderer' => 'Mezzio\\LaminasView\\LaminasViewRenderer',
'a\\Zend' => 'a\\Zend',
'b\\Zend' => 'b\\Zend',
'c\\Zend' => 'c\\Zend',
'd\\Zend' => 'd\\Zend',
'e\\Zend' => 'e\\Zend',
'f\\Zend' => 'f\\Zend',
'g\\Zend' => 'g\\Zend',
'h\\Zend' => 'h\\Zend',
'i\\Zend' => 'i\\Zend',
'j\\Zend' => 'j\\Zend',
'k\\Zend' => 'k\\Zend',
'l\\Zend' => 'l\\Zend',
'm\\Zend' => 'm\\Zend',
'n\\Zend' => 'n\\Zend',
'o\\Zend' => 'o\\Zend',
'p\\Zend' => 'p\\Zend',
'q\\Zend' => 'q\\Zend',
'r\\Zend' => 'r\\Zend',
's\\Zend' => 's\\Zend',
't\\Zend' => 't\\Zend',
'u\\Zend' => 'u\\Zend',
'v\\Zend' => 'v\\Zend',
'w\\Zend' => 'w\\Zend',
'x\\Zend' => 'x\\Zend',
'y\\Zend' => 'y\\Zend',
'z\\Zend' => 'z\\Zend',
// Expressive
'Zend\\Expressive' => 'Mezzio',
'ZendAuthentication' => 'LaminasAuthentication',
'ZendAcl' => 'LaminasAcl',
'ZendRbac' => 'LaminasRbac',
'ZendRouter' => 'LaminasRouter',
'ExpressiveUrlGenerator' => 'MezzioUrlGenerator',
'ExpressiveInstaller' => 'MezzioInstaller',
// Apigility
'ZF\\Apigility' => 'Laminas\\ApiTools',
'ZF\\ApiProblem' => 'Laminas\\ApiTools\\ApiProblem',
'ZF\\AssetManager' => 'Laminas\\ApiTools\\AssetManager',
'ZF\\ComposerAutoloading' => 'Laminas\\ComposerAutoloading',
'ZF\\Configuration' => 'Laminas\\ApiTools\\Configuration',
'ZF\\ContentNegotiation' => 'Laminas\\ApiTools\\ContentNegotiation',
'ZF\\ContentValidation' => 'Laminas\\ApiTools\\ContentValidation',
'ZF\\DevelopmentMode' => 'Laminas\\DevelopmentMode',
'ZF\\Doctrine\\QueryBuilder' => 'Laminas\\ApiTools\\Doctrine\\QueryBuilder',
'ZF\\Hal' => 'Laminas\\ApiTools\\Hal',
'ZF\\HttpCache' => 'Laminas\\ApiTools\\HttpCache',
'ZF\\MvcAuth' => 'Laminas\\ApiTools\\MvcAuth',
'ZF\\OAuth2' => 'Laminas\\ApiTools\\OAuth2',
'ZF\\Rest' => 'Laminas\\ApiTools\\Rest',
'ZF\\Rpc' => 'Laminas\\ApiTools\\Rpc',
'ZF\\Versioning' => 'Laminas\\ApiTools\\Versioning',
'a\\ZF' => 'a\\ZF',
'b\\ZF' => 'b\\ZF',
'c\\ZF' => 'c\\ZF',
'd\\ZF' => 'd\\ZF',
'e\\ZF' => 'e\\ZF',
'f\\ZF' => 'f\\ZF',
'g\\ZF' => 'g\\ZF',
'h\\ZF' => 'h\\ZF',
'i\\ZF' => 'i\\ZF',
'j\\ZF' => 'j\\ZF',
'k\\ZF' => 'k\\ZF',
'l\\ZF' => 'l\\ZF',
'm\\ZF' => 'm\\ZF',
'n\\ZF' => 'n\\ZF',
'o\\ZF' => 'o\\ZF',
'p\\ZF' => 'p\\ZF',
'q\\ZF' => 'q\\ZF',
'r\\ZF' => 'r\\ZF',
's\\ZF' => 's\\ZF',
't\\ZF' => 't\\ZF',
'u\\ZF' => 'u\\ZF',
'v\\ZF' => 'v\\ZF',
'w\\ZF' => 'w\\ZF',
'x\\ZF' => 'x\\ZF',
'y\\ZF' => 'y\\ZF',
'z\\ZF' => 'z\\ZF',
'ApigilityModuleInterface' => 'ApiToolsModuleInterface',
'ApigilityProviderInterface' => 'ApiToolsProviderInterface',
'ApigilityVersionController' => 'ApiToolsVersionController',
// PACKAGES
// ZF components, MVC
'zendframework/skeleton-application' => 'laminas/skeleton-application',
'zendframework/zend-auradi-config' => 'laminas/laminas-auradi-config',
'zendframework/zend-authentication' => 'laminas/laminas-authentication',
'zendframework/zend-barcode' => 'laminas/laminas-barcode',
'zendframework/zend-cache' => 'laminas/laminas-cache',
'zendframework/zend-captcha' => 'laminas/laminas-captcha',
'zendframework/zend-code' => 'laminas/laminas-code',
'zendframework/zend-coding-standard' => 'laminas/laminas-coding-standard',
'zendframework/zend-component-installer' => 'laminas/laminas-component-installer',
'zendframework/zend-composer-autoloading' => 'laminas/laminas-composer-autoloading',
'zendframework/zend-config-aggregator' => 'laminas/laminas-config-aggregator',
'zendframework/zend-config' => 'laminas/laminas-config',
'zendframework/zend-console' => 'laminas/laminas-console',
'zendframework/zend-container-config-test' => 'laminas/laminas-container-config-test',
'zendframework/zend-crypt' => 'laminas/laminas-crypt',
'zendframework/zend-db' => 'laminas/laminas-db',
'zendframework/zend-developer-tools' => 'laminas/laminas-developer-tools',
'zendframework/zend-diactoros' => 'laminas/laminas-diactoros',
'zendframework/zenddiagnostics' => 'laminas/laminas-diagnostics',
'zendframework/zend-di' => 'laminas/laminas-di',
'zendframework/zend-dom' => 'laminas/laminas-dom',
'zendframework/zend-escaper' => 'laminas/laminas-escaper',
'zendframework/zend-eventmanager' => 'laminas/laminas-eventmanager',
'zendframework/zend-feed' => 'laminas/laminas-feed',
'zendframework/zend-file' => 'laminas/laminas-file',
'zendframework/zend-filter' => 'laminas/laminas-filter',
'zendframework/zend-form' => 'laminas/laminas-form',
'zendframework/zend-httphandlerrunner' => 'laminas/laminas-httphandlerrunner',
'zendframework/zend-http' => 'laminas/laminas-http',
'zendframework/zend-hydrator' => 'laminas/laminas-hydrator',
'zendframework/zend-i18n' => 'laminas/laminas-i18n',
'zendframework/zend-i18n-resources' => 'laminas/laminas-i18n-resources',
'zendframework/zend-inputfilter' => 'laminas/laminas-inputfilter',
'zendframework/zend-json' => 'laminas/laminas-json',
'zendframework/zend-json-server' => 'laminas/laminas-json-server',
'zendframework/zend-ldap' => 'laminas/laminas-ldap',
'zendframework/zend-loader' => 'laminas/laminas-loader',
'zendframework/zend-log' => 'laminas/laminas-log',
'zendframework/zend-mail' => 'laminas/laminas-mail',
'zendframework/zend-math' => 'laminas/laminas-math',
'zendframework/zend-memory' => 'laminas/laminas-memory',
'zendframework/zend-mime' => 'laminas/laminas-mime',
'zendframework/zend-modulemanager' => 'laminas/laminas-modulemanager',
'zendframework/zend-mvc' => 'laminas/laminas-mvc',
'zendframework/zend-navigation' => 'laminas/laminas-navigation',
'zendframework/zend-oauth' => 'laminas/laminas-oauth',
'zendframework/zend-paginator' => 'laminas/laminas-paginator',
'zendframework/zend-permissions-acl' => 'laminas/laminas-permissions-acl',
'zendframework/zend-permissions-rbac' => 'laminas/laminas-permissions-rbac',
'zendframework/zend-pimple-config' => 'laminas/laminas-pimple-config',
'zendframework/zend-progressbar' => 'laminas/laminas-progressbar',
'zendframework/zend-psr7bridge' => 'laminas/laminas-psr7bridge',
'zendframework/zend-recaptcha' => 'laminas/laminas-recaptcha',
'zendframework/zend-router' => 'laminas/laminas-router',
'zendframework/zend-serializer' => 'laminas/laminas-serializer',
'zendframework/zend-server' => 'laminas/laminas-server',
'zendframework/zend-servicemanager' => 'laminas/laminas-servicemanager',
'zendframework/zendservice-recaptcha' => 'laminas/laminas-recaptcha',
'zendframework/zendservice-twitter' => 'laminas/laminas-twitter',
'zendframework/zend-session' => 'laminas/laminas-session',
'zendframework/zend-skeleton-installer' => 'laminas/laminas-skeleton-installer',
'zendframework/zend-soap' => 'laminas/laminas-soap',
'zendframework/zend-stdlib' => 'laminas/laminas-stdlib',
'zendframework/zend-stratigility' => 'laminas/laminas-stratigility',
'zendframework/zend-tag' => 'laminas/laminas-tag',
'zendframework/zend-test' => 'laminas/laminas-test',
'zendframework/zend-text' => 'laminas/laminas-text',
'zendframework/zend-uri' => 'laminas/laminas-uri',
'zendframework/zend-validator' => 'laminas/laminas-validator',
'zendframework/zend-view' => 'laminas/laminas-view',
'zendframework/zend-xml2json' => 'laminas/laminas-xml2json',
'zendframework/zend-xml' => 'laminas/laminas-xml',
'zendframework/zend-xmlrpc' => 'laminas/laminas-xmlrpc',
// Expressive packages
'zendframework/zend-expressive' => 'mezzio/mezzio',
'zendframework/zend-expressive-zendrouter' => 'mezzio/mezzio-laminasrouter',
'zendframework/zend-problem-details' => 'mezzio/mezzio-problem-details',
'zendframework/zend-expressive-zendviewrenderer' => 'mezzio/mezzio-laminasviewrenderer',
// Apigility packages
'zfcampus/apigility-documentation' => 'laminas-api-tools/documentation',
'zfcampus/statuslib-example' => 'laminas-api-tools/statuslib-example',
'zfcampus/zf-apigility' => 'laminas-api-tools/api-tools',
'zfcampus/zf-api-problem' => 'laminas-api-tools/api-tools-api-problem',
'zfcampus/zf-asset-manager' => 'laminas-api-tools/api-tools-asset-manager',
'zfcampus/zf-configuration' => 'laminas-api-tools/api-tools-configuration',
'zfcampus/zf-content-negotiation' => 'laminas-api-tools/api-tools-content-negotiation',
'zfcampus/zf-content-validation' => 'laminas-api-tools/api-tools-content-validation',
'zfcampus/zf-development-mode' => 'laminas/laminas-development-mode',
'zfcampus/zf-doctrine-querybuilder' => 'laminas-api-tools/api-tools-doctrine-querybuilder',
'zfcampus/zf-hal' => 'laminas-api-tools/api-tools-hal',
'zfcampus/zf-http-cache' => 'laminas-api-tools/api-tools-http-cache',
'zfcampus/zf-mvc-auth' => 'laminas-api-tools/api-tools-mvc-auth',
'zfcampus/zf-oauth2' => 'laminas-api-tools/api-tools-oauth2',
'zfcampus/zf-rest' => 'laminas-api-tools/api-tools-rest',
'zfcampus/zf-rpc' => 'laminas-api-tools/api-tools-rpc',
'zfcampus/zf-versioning' => 'laminas-api-tools/api-tools-versioning',
// CONFIG KEYS, SCRIPT NAMES, ETC
// ZF components
'::fromZend' => '::fromLaminas', // psr7bridge
'::toZend' => '::toLaminas', // psr7bridge
'use_zend_loader' => 'use_laminas_loader', // zend-modulemanager
'zend-config' => 'laminas-config',
'zend-developer-tools/' => 'laminas-developer-tools/',
'zend-tag-cloud' => 'laminas-tag-cloud',
'zenddevelopertools' => 'laminas-developer-tools',
'zendbarcode' => 'laminasbarcode',
'ZendBarcode' => 'LaminasBarcode',
'zendcache' => 'laminascache',
'ZendCache' => 'LaminasCache',
'zendconfig' => 'laminasconfig',
'ZendConfig' => 'LaminasConfig',
'zendfeed' => 'laminasfeed',
'ZendFeed' => 'LaminasFeed',
'zendfilter' => 'laminasfilter',
'ZendFilter' => 'LaminasFilter',
'zendform' => 'laminasform',
'ZendForm' => 'LaminasForm',
'zendi18n' => 'laminasi18n',
'ZendI18n' => 'LaminasI18n',
'zendinputfilter' => 'laminasinputfilter',
'ZendInputFilter' => 'LaminasInputFilter',
'zendlog' => 'laminaslog',
'ZendLog' => 'LaminasLog',
'zendmail' => 'laminasmail',
'ZendMail' => 'LaminasMail',
'zendmvc' => 'laminasmvc',
'ZendMvc' => 'LaminasMvc',
'zendpaginator' => 'laminaspaginator',
'ZendPaginator' => 'LaminasPaginator',
'zendserializer' => 'laminasserializer',
'ZendSerializer' => 'LaminasSerializer',
'zendtag' => 'laminastag',
'ZendTag' => 'LaminasTag',
'zendtext' => 'laminastext',
'ZendText' => 'LaminasText',
'zendvalidator' => 'laminasvalidator',
'ZendValidator' => 'LaminasValidator',
'zendview' => 'laminasview',
'ZendView' => 'LaminasView',
'zend-framework.flf' => 'laminas-project.flf',
// Expressive-related
"'zend-expressive'" => "'mezzio'",
'"zend-expressive"' => '"mezzio"',
'zend-expressive.' => 'mezzio.',
'zend-expressive-authorization' => 'mezzio-authorization',
'zend-expressive-hal' => 'mezzio-hal',
'zend-expressive-session' => 'mezzio-session',
'zend-expressive-swoole' => 'mezzio-swoole',
'zend-expressive-tooling' => 'mezzio-tooling',
// Apigility-related
"'zf-apigility'" => "'api-tools'",
'"zf-apigility"' => '"api-tools"',
'zf-apigility/' => 'api-tools/',
'zf-apigility-admin' => 'api-tools-admin',
'zf-content-negotiation' => 'api-tools-content-negotiation',
'zf-hal' => 'api-tools-hal',
'zf-rest' => 'api-tools-rest',
'zf-rpc' => 'api-tools-rpc',
'zf-content-validation' => 'api-tools-content-validation',
'zf-apigility-ui' => 'api-tools-ui',
'zf-apigility-documentation-blueprint' => 'api-tools-documentation-blueprint',
'zf-apigility-documentation-swagger' => 'api-tools-documentation-swagger',
'zf-apigility-welcome' => 'api-tools-welcome',
'zf-api-problem' => 'api-tools-api-problem',
'zf-configuration' => 'api-tools-configuration',
'zf-http-cache' => 'api-tools-http-cache',
'zf-mvc-auth' => 'api-tools-mvc-auth',
'zf-oauth2' => 'api-tools-oauth2',
'zf-versioning' => 'api-tools-versioning',
'ZfApigilityDoctrineQueryProviderManager' => 'LaminasApiToolsDoctrineQueryProviderManager',
'ZfApigilityDoctrineQueryCreateFilterManager' => 'LaminasApiToolsDoctrineQueryCreateFilterManager',
'zf-apigility-doctrine' => 'api-tools-doctrine',
'zf-development-mode' => 'laminas-development-mode',
'zf-doctrine-querybuilder' => 'api-tools-doctrine-querybuilder',
// 3rd party Apigility packages
'api-skeletons/zf-' => 'api-skeletons/zf-', // api-skeletons packages
'zf-oauth2-' => 'zf-oauth2-', // api-skeletons OAuth2-related packages
'ZF\\OAuth2\\Client' => 'ZF\\OAuth2\\Client', // api-skeletons/zf-oauth2-client
'ZF\\OAuth2\\Doctrine' => 'ZF\\OAuth2\\Doctrine', // api-skeletons/zf-oauth2-doctrine
];
PK 0˜´Pw¨gç‚3 ‚3 src/ConfigPostProcessor.phpnu €žÙ˜ true,
'factories' => true,
'invokables' => true,
'services' => true,
];
/** @var array String keys => string values */
private $exactReplacements = [
'zend-expressive' => 'mezzio',
'zf-apigility' => 'api-tools',
];
/** @var Replacements */
private $replacements;
/** @var callable[] */
private $rulesets;
public function __construct()
{
$this->replacements = new Replacements();
/* Define the rulesets for replacements.
*
* Each ruleset has the following signature:
*
* @param mixed $value
* @param string[] $keys Full nested key hierarchy leading to the value
* @return null|callable
*
* If no match is made, a null is returned, allowing it to fallback to
* the next ruleset in the list. If a match is made, a callback is returned,
* and that will be used to perform the replacement on the value.
*
* The callback should have the following signature:
*
* @param mixed $value
* @param string[] $keys
* @return mixed The transformed value
*/
$this->rulesets = [
// Exact values
function ($value) {
return is_string($value) && isset($this->exactReplacements[$value])
? [$this, 'replaceExactValue']
: null;
},
// Router (MVC applications)
// We do not want to rewrite these.
function ($value, array $keys) {
$key = array_pop($keys);
// Only worried about a top-level "router" key.
return $key === 'router' && count($keys) === 0 && is_array($value)
? [$this, 'noopReplacement']
: null;
},
// service- and pluginmanager handling
function ($value) {
return is_array($value) && array_intersect_key(self::SERVICE_MANAGER_KEYS_OF_INTEREST, $value) !== []
? [$this, 'replaceDependencyConfiguration']
: null;
},
// Array values
function ($value, array $keys) {
return 0 !== count($keys) && is_array($value)
? [$this, '__invoke']
: null;
},
];
}
/**
* @param string[] $keys Hierarchy of keys, for determining location in
* nested configuration.
* @return array
*/
public function __invoke(array $config, array $keys = [])
{
$rewritten = [];
foreach ($config as $key => $value) {
// Determine new key from replacements
$newKey = is_string($key) ? $this->replace($key, $keys) : $key;
// Keep original values with original key, if the key has changed, but only at the top-level.
if (empty($keys) && $newKey !== $key) {
$rewritten[$key] = $value;
}
// Perform value replacements, if any
$newValue = $this->replace($value, $keys, $newKey);
// Key does not already exist and/or is not an array value
if (! array_key_exists($newKey, $rewritten) || ! is_array($rewritten[$newKey])) {
// Do not overwrite existing values with null values
$rewritten[$newKey] = array_key_exists($newKey, $rewritten) && null === $newValue
? $rewritten[$newKey]
: $newValue;
continue;
}
// New value is null; nothing to do.
if (null === $newValue) {
continue;
}
// Key already exists as an array value, but $value is not an array
if (! is_array($newValue)) {
$rewritten[$newKey][] = $newValue;
continue;
}
// Key already exists as an array value, and $value is also an array
$rewritten[$newKey] = static::merge($rewritten[$newKey], $newValue);
}
return $rewritten;
}
/**
* Perform substitutions as needed on an individual value.
*
* The $key is provided to allow fine-grained selection of rewrite rules.
*
* @param mixed $value
* @param string[] $keys Key hierarchy
* @param null|int|string $key
* @return mixed
*/
private function replace($value, array $keys, $key = null)
{
// Add new key to the list of keys.
// We do not need to remove it later, as we are working on a copy of the array.
array_push($keys, $key);
// Identify rewrite strategy and perform replacements
$rewriteRule = $this->replacementRuleMatch($value, $keys);
return $rewriteRule($value, $keys);
}
/**
* Merge two arrays together.
*
* If an integer key exists in both arrays, the value from the second array
* will be appended to the first array. If both values are arrays, they are
* merged together, else the value of the second array overwrites the one
* of the first array.
*
* Based on zend-stdlib Zend\Stdlib\ArrayUtils::merge
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
*
* @return array
*/
public static function merge(array $a, array $b)
{
foreach ($b as $key => $value) {
if (! isset($a[$key]) && ! array_key_exists($key, $a)) {
$a[$key] = $value;
continue;
}
if (null === $value && array_key_exists($key, $a)) {
// Leave as-is if value from $b is null
continue;
}
if (is_int($key)) {
$a[] = $value;
continue;
}
if (is_array($value) && is_array($a[$key])) {
$a[$key] = static::merge($a[$key], $value);
continue;
}
$a[$key] = $value;
}
return $a;
}
/**
* @param mixed $value
* @param null|int|string $key
* @return callable Callable to invoke with value
*/
private function replacementRuleMatch($value, $key = null)
{
foreach ($this->rulesets as $ruleset) {
$result = $ruleset($value, $key);
if (is_callable($result)) {
return $result;
}
}
return [$this, 'fallbackReplacement'];
}
/**
* Replace a value using the translation table, if the value is a string.
*
* @param mixed $value
* @return mixed
*/
private function fallbackReplacement($value)
{
return is_string($value)
? $this->replacements->replace($value)
: $value;
}
/**
* Replace a value matched exactly.
*
* @param mixed $value
* @return mixed
*/
private function replaceExactValue($value)
{
return $this->exactReplacements[$value];
}
private function replaceDependencyConfiguration(array $config)
{
$aliases = isset($config['aliases']) && is_array($config['aliases'])
? $this->replaceDependencyAliases($config['aliases'])
: [];
if ($aliases) {
$config['aliases'] = $aliases;
}
$config = $this->replaceDependencyInvokables($config);
$config = $this->replaceDependencyFactories($config);
$config = $this->replaceDependencyServices($config);
$keys = self::SERVICE_MANAGER_KEYS_OF_INTEREST;
foreach ($config as $key => $data) {
if (isset($keys[$key])) {
continue;
}
$config[$key] = is_array($data) ? $this->__invoke($data, [$key]) : $data;
}
return $config;
}
/**
* Rewrite dependency aliases array
*
* In this case, we want to keep the alias as-is, but rewrite the target.
*
* We need also provide an additional alias if the alias key is a legacy class.
*
* @return array
*/
private function replaceDependencyAliases(array $aliases)
{
foreach ($aliases as $alias => $target) {
if (! is_string($alias) || ! is_string($target)) {
continue;
}
$newTarget = $this->replacements->replace($target);
$newAlias = $this->replacements->replace($alias);
$notIn = [$newTarget];
$name = $newTarget;
while (isset($aliases[$name])) {
$notIn[] = $aliases[$name];
$name = $aliases[$name];
}
if ($newAlias === $alias && ! in_array($alias, $notIn, true)) {
$aliases[$alias] = $newTarget;
continue;
}
if (isset($aliases[$newAlias])) {
continue;
}
if (! in_array($newAlias, $notIn, true)) {
$aliases[$alias] = $newAlias;
$aliases[$newAlias] = $newTarget;
}
}
return $aliases;
}
/**
* Rewrite dependency invokables array
*
* In this case, we want to keep the alias as-is, but rewrite the target.
*
* We need also provide an additional alias if invokable is defined with
* an alias which is a legacy class.
*
* @return array
*/
private function replaceDependencyInvokables(array $config)
{
if (empty($config['invokables']) || ! is_array($config['invokables'])) {
return $config;
}
foreach ($config['invokables'] as $alias => $target) {
if (! is_string($alias)) {
continue;
}
$newTarget = $this->replacements->replace($target);
$newAlias = $this->replacements->replace($alias);
if ($alias === $target || isset($config['aliases'][$newAlias])) {
$config['invokables'][$alias] = $newTarget;
continue;
}
$config['invokables'][$newAlias] = $newTarget;
if ($newAlias === $alias) {
continue;
}
$config['aliases'][$alias] = $newAlias;
unset($config['invokables'][$alias]);
}
return $config;
}
/**
* @param mixed $value
* @return mixed Returns $value verbatim.
*/
private function noopReplacement($value)
{
return $value;
}
private function replaceDependencyFactories(array $config)
{
if (empty($config['factories']) || ! is_array($config['factories'])) {
return $config;
}
foreach ($config['factories'] as $service => $factory) {
if (! is_string($service)) {
continue;
}
$replacedService = $this->replacements->replace($service);
$factory = is_string($factory) ? $this->replacements->replace($factory) : $factory;
$config['factories'][$replacedService] = $factory;
if ($replacedService === $service) {
continue;
}
unset($config['factories'][$service]);
if (isset($config['aliases'][$service])) {
continue;
}
$config['aliases'][$service] = $replacedService;
}
return $config;
}
private function replaceDependencyServices(array $config)
{
if (empty($config['services']) || ! is_array($config['services'])) {
return $config;
}
foreach ($config['services'] as $service => $serviceInstance) {
if (! is_string($service)) {
continue;
}
$replacedService = $this->replacements->replace($service);
$serviceInstance = is_array($serviceInstance) ? $this->__invoke($serviceInstance) : $serviceInstance;
$config['services'][$replacedService] = $serviceInstance;
if ($service === $replacedService) {
continue;
}
unset($config['services'][$service]);
if (isset($config['aliases'][$service])) {
continue;
}
$config['aliases'][$service] = $replacedService;
}
return $config;
}
}
PK 0˜´P(ªÐa a src/Autoloader.phpnu €žÙ˜ loadClass($class)) {
$legacy = $namespaces[$check]
. strtr(substr($class, strlen($check)), [
'ApiTools' => 'Apigility',
'Mezzio' => 'Expressive',
'Laminas' => 'Zend',
]);
class_alias($class, $legacy);
}
};
}
/**
* @return callable
*/
private static function createAppendAutoloader(array $namespaces, ArrayObject $loaded)
{
/**
* @param string $class Class name to autoload
* @return void
*/
return static function ($class) use ($namespaces, $loaded) {
$segments = explode('\\', $class);
if ($segments[0] === 'ZendService' && isset($segments[1])) {
$segments[0] .= '\\' . $segments[1];
unset($segments[1]);
$segments = array_values($segments);
}
$i = 0;
$check = '';
// We are checking segments of the namespace to match quicker
while (isset($segments[$i + 1], $namespaces[$check . $segments[$i] . '\\'])) {
$check .= $segments[$i] . '\\';
++$i;
}
if ($check === '') {
return;
}
$alias = $namespaces[$check]
. strtr(substr($class, strlen($check)), [
'Apigility' => 'ApiTools',
'Expressive' => 'Mezzio',
'Zend' => 'Laminas',
'AbstractZendServer' => 'AbstractZendServer',
'ZendServerDisk' => 'ZendServerDisk',
'ZendServerShm' => 'ZendServerShm',
'ZendMonitor' => 'ZendMonitor',
]);
$loaded[$alias] = true;
if (class_exists($alias) || interface_exists($alias) || trait_exists($alias)) {
class_alias($alias, $class);
}
};
}
}
PK 0˜´Pd>†û src/RewriteRules.phpnu €žÙ˜ 'Mezzio\\ProblemDetails\\',
'Zend\\Expressive\\' => 'Mezzio\\',
// Laminas
'Zend\\' => 'Laminas\\',
'ZF\\ComposerAutoloading\\' => 'Laminas\\ComposerAutoloading\\',
'ZF\\DevelopmentMode\\' => 'Laminas\\DevelopmentMode\\',
// Apigility
'ZF\\Apigility\\' => 'Laminas\\ApiTools\\',
'ZF\\' => 'Laminas\\ApiTools\\',
// ZendXml, API wrappers, zend-http OAuth support, zend-diagnostics, ZendDeveloperTools
'ZendXml\\' => 'Laminas\\Xml\\',
'ZendOAuth\\' => 'Laminas\\OAuth\\',
'ZendDiagnostics\\' => 'Laminas\\Diagnostics\\',
'ZendService\\ReCaptcha\\' => 'Laminas\\ReCaptcha\\',
'ZendService\\Twitter\\' => 'Laminas\\Twitter\\',
'ZendDeveloperTools\\' => 'Laminas\\DeveloperTools\\',
];
}
/**
* @return array
*/
public static function namespaceReverse()
{
return [
// ZendXml, ZendOAuth, ZendDiagnostics, ZendDeveloperTools
'Laminas\\Xml\\' => 'ZendXml\\',
'Laminas\\OAuth\\' => 'ZendOAuth\\',
'Laminas\\Diagnostics\\' => 'ZendDiagnostics\\',
'Laminas\\DeveloperTools\\' => 'ZendDeveloperTools\\',
// Zend Service
'Laminas\\ReCaptcha\\' => 'ZendService\\ReCaptcha\\',
'Laminas\\Twitter\\' => 'ZendService\\Twitter\\',
// Zend
'Laminas\\' => 'Zend\\',
// Expressive
'Mezzio\\ProblemDetails\\' => 'Zend\\ProblemDetails\\',
'Mezzio\\' => 'Zend\\Expressive\\',
// Laminas to ZfCampus
'Laminas\\ComposerAutoloading\\' => 'ZF\\ComposerAutoloading\\',
'Laminas\\DevelopmentMode\\' => 'ZF\\DevelopmentMode\\',
// Apigility
'Laminas\\ApiTools\\Admin\\' => 'ZF\\Apigility\\Admin\\',
'Laminas\\ApiTools\\Doctrine\\' => 'ZF\\Apigility\\Doctrine\\',
'Laminas\\ApiTools\\Documentation\\' => 'ZF\\Apigility\\Documentation\\',
'Laminas\\ApiTools\\Example\\' => 'ZF\\Apigility\\Example\\',
'Laminas\\ApiTools\\Provider\\' => 'ZF\\Apigility\\Provider\\',
'Laminas\\ApiTools\\Welcome\\' => 'ZF\\Apiglity\\Welcome\\',
'Laminas\\ApiTools\\' => 'ZF\\',
];
}
}
PK 0˜´PÏö?|v v src/autoload.phpnu €žÙ˜ replacements = array_merge(
require __DIR__ . '/../config/replacements.php',
$additionalReplacements
);
// Provide multiple variants of strings containing namespace separators
foreach ($this->replacements as $original => $replacement) {
if (false === strpos($original, '\\')) {
continue;
}
$this->replacements[str_replace('\\', '\\\\', $original)] = str_replace('\\', '\\\\', $replacement);
$this->replacements[str_replace('\\', '\\\\\\\\', $original)] = str_replace('\\', '\\\\\\\\', $replacement);
}
}
/**
* @param string $value
* @return string
*/
public function replace($value)
{
return strtr($value, $this->replacements);
}
}
PK 0˜´Pòâ˜)… … src/Module.phpnu €žÙ˜ getEventManager()
->attach('mergeConfig', [$this, 'onMergeConfig']);
}
/**
* Perform substitutions in the merged configuration.
*
* Rewrites keys and values matching known ZF classes, namespaces, and
* configuration keys to their Laminas equivalents.
*
* Type-hinting deliberately omitted to allow unit testing
* without dependencies on packages that do not exist yet.
*
* @param ModuleEvent $event
*/
public function onMergeConfig($event)
{
/** @var ConfigMergerInterface */
$configMerger = $event->getConfigListener();
$processor = new ConfigPostProcessor();
$configMerger->setMergedConfig(
$processor(
$configMerger->getMergedConfig($returnAsObject = false)
)
);
}
}
PK 0˜´P`Ž&g" " .github/FUNDING.ymlnu €žÙ˜ community_bridge: laminas-project
PK 0˜´P“\Ðä¿ ¿ .gitattributesnu €žÙ˜ /.coveralls.yml export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.travis.yml export-ignore
/phpcs.xml export-ignore
/phpunit.xml.dist export-ignore
/test/ export-ignore
PK 0˜´PV0ls s test/ReplacementsTest.phpnu €žÙ˜ [
file_get_contents(__DIR__ . '/TestAsset/Replacements/TestClass.php'),
file_get_contents(__DIR__ . '/TestAsset/Replacements/TestClass.php.out'),
];
yield 'Apigility module' => ['ZF\Apigility', 'Laminas\ApiTools'];
yield 'Apigility documentation module' => ['ZF\Apigility\Documentation', 'Laminas\ApiTools\Documentation'];
yield 'Apigility modules.config.php' => [
file_get_contents(__DIR__ . '/TestAsset/Replacements/edge-case-apigility-modules.php'),
file_get_contents(__DIR__ . '/TestAsset/Replacements/edge-case-apigility-modules.php.out'),
];
yield 'Auryn' => [
'Northwoods\Container\Zend\Config',
'Northwoods\Container\Zend\Config',
];
yield 'BjyAuthorize' => [
'zend-developer-tools/toolbar/bjy-authorize-role',
'zend-developer-tools/toolbar/bjy-authorize-role',
];
yield 'Expressive ZendRouter' => [
'Zend\Expressive\Router\ZendRouter',
'Mezzio\Router\LaminasRouter',
];
yield 'Expressive ZendView Renderer' => [
'Zend\Expressive\ZendView\ZendViewRenderer',
'Mezzio\LaminasView\LaminasViewRenderer',
];
yield 'Expressive ACL Authorizations' => [
'Zend\Expressive\Authorization\Acl\ZendAcl',
'Mezzio\Authorization\Acl\LaminasAcl',
];
yield 'Expressive RBAC Authorizations' => [
'Zend\Expressive\Authorization\Rbac\ZendRbac',
'Mezzio\Authorization\Rbac\LaminasRbac',
];
yield 'Cache Zend Server abstract adapter' => [
'Zend\Cache\Storage\Adapter\AbstractZendServer',
'Laminas\Cache\Storage\Adapter\AbstractZendServer',
];
yield 'Cache Zend Server Disk adapter' => [
'Zend\Cache\Storage\Adapter\ZendServerDisk',
'Laminas\Cache\Storage\Adapter\ZendServerDisk',
];
yield 'Cache Zend Server Shm adapter' => [
'Zend\Cache\Storage\Adapter\ZendServerShm',
'Laminas\Cache\Storage\Adapter\ZendServerShm',
];
yield 'Log Zend Monitor writer' => [
'Zend\Log\Writer\ZendMonitor',
'Laminas\Log\Writer\ZendMonitor',
];
yield 'Generated class name containing ZendCode in namespace' => [
'Some\Module\ZendCode\GeneratedClass',
'Some\Module\ZendCode\GeneratedClass'
];
yield 'Laminas Rbac class definition' => [
'class ZendRbac',
'class LaminasRbac'
];
yield 'Importing Zend\Expressive\ZendView namespace' => [
'use Zend\Expressive\ZendView',
'use Mezzio\LaminasView'
];
yield 'Importing zend-http client as ZendHttp' => [
'use Zend\Http as ZendHttp',
'use Laminas\Http as LaminasHttp'
];
yield 'ZendHttpClientDecorator definition' => [
'class ZendHttpClientDecorator implements HeaderAwareClientInterface',
'class LaminasHttpClientDecorator implements HeaderAwareClientInterface'
];
yield 'Vendor ZendAcl extension' => [
'\'some-alias\' => Some\Vendor\Acl\ZendAcl::class,',
'\'some-alias\' => Some\Vendor\Acl\ZendAcl::class,'
];
yield 'phpstan-baseline.neon' => [
file_get_contents(__DIR__ . '/TestAsset/Replacements/phpstan-baseline.neon'),
file_get_contents(__DIR__ . '/TestAsset/Replacements/phpstan-baseline.neon.out'),
];
yield 'api-tools config' => [
file_get_contents(__DIR__ . '/TestAsset/Replacements/module.config.php'),
file_get_contents(__DIR__ . '/TestAsset/Replacements/module.config.php.out'),
];
yield 'api-skeletons composer' => [
file_get_contents(__DIR__ . '/TestAsset/Replacements/api-skeletons-composer.json'),
file_get_contents(__DIR__ . '/TestAsset/Replacements/api-skeletons-composer.json.out'),
];
yield 'api-skeletons OAuth2 Client' => [
file_get_contents(__DIR__ . '/TestAsset/Replacements/ZFOAuth2Client.php'),
file_get_contents(__DIR__ . '/TestAsset/Replacements/ZFOAuth2Client.php.out'),
];
yield 'api-skeletons zf-oauth2-doctrine config' => [
file_get_contents(__DIR__ . '/TestAsset/Replacements/zf-oauth2-config.php'),
file_get_contents(__DIR__ . '/TestAsset/Replacements/zf-oauth2-config.php.out'),
];
}
/**
* @dataProvider edgeCases
*
* @param string $string
* @param string $expected
*/
public function testEdgeCases($string, $expected)
{
$replacements = new Replacements();
$this->assertSame($expected, $replacements->replace($string));
}
}
PK 0˜´P™
w˜ ˜ 0 test/TestAsset/Replacements/zf-oauth2-config.phpnu €žÙ˜ [
],
'zf-oauth2-doctrine-permissions-acl' => [
],
'zf-doctrine-querybuilder' => [
],
];
PK 0˜´P¸