diff options
author | Remi Collet <remi@remirepo.net> | 2020-01-08 16:32:54 +0100 |
---|---|---|
committer | Remi Collet <remi@remirepo.net> | 2020-01-08 16:32:54 +0100 |
commit | e1a48058a9d0fa69aee2eb1317f2bca7be4d0c3b (patch) | |
tree | d87651baf84336fddc84f6028113969fbae10c86 | |
parent | 06f0281b93763fb605a0f153c08bc59d13176066 (diff) |
switch to Laminas
-rw-r--r-- | composer.json | 84 | ||||
-rw-r--r-- | php-laminas-cache.spec | 218 |
2 files changed, 159 insertions, 143 deletions
diff --git a/composer.json b/composer.json index d662ed4..ca36824 100644 --- a/composer.json +++ b/composer.json @@ -1,41 +1,58 @@ { - "name": "zendframework/zend-cache", + "name": "laminas/laminas-cache", "description": "Caching implementation with a variety of storage options, as well as codified caching strategies for callbacks, classes, and output", "license": "BSD-3-Clause", "keywords": [ - "zendframework", - "zf", + "laminas", "cache", "psr-6", "psr-16" ], + "homepage": "https://laminas.dev", "support": { - "docs": "https://docs.zendframework.com/zend-cache/", - "issues": "https://github.com/zendframework/zend-cache/issues", - "source": "https://github.com/zendframework/zend-cache", - "rss": "https://github.com/zendframework/zend-cache/releases.atom", - "chat": "https://zendframework-slack.herokuapp.com", - "forum": "https://discourse.zendframework.com/c/questions/components" + "docs": "https://docs.laminas.dev/laminas-cache/", + "issues": "https://github.com/laminas/laminas-cache/issues", + "source": "https://github.com/laminas/laminas-cache", + "rss": "https://github.com/laminas/laminas-cache/releases.atom", + "chat": "https://laminas.dev/chat", + "forum": "https://discourse.laminas.dev" + }, + "config": { + "process-timeout": 600, + "sort-packages": true + }, + "extra": { + "branch-alias": { + "dev-master": "2.9.x-dev", + "dev-develop": "2.10.x-dev" + }, + "laminas": { + "component": "Laminas\\Cache", + "config-provider": "Laminas\\Cache\\ConfigProvider" + } }, "require": { "php": "^5.6 || ^7.0", + "laminas/laminas-eventmanager": "^2.6.3 || ^3.2", + "laminas/laminas-servicemanager": "^2.7.8 || ^3.3", + "laminas/laminas-stdlib": "^3.2.1", + "laminas/laminas-zendframework-bridge": "^1.0", "psr/cache": "^1.0", - "psr/simple-cache": "^1.0", - "zendframework/zend-eventmanager": "^2.6.3 || ^3.2", - "zendframework/zend-servicemanager": "^2.7.8 || ^3.3", - "zendframework/zend-stdlib": "^3.2.1" + "psr/simple-cache": "^1.0" }, "require-dev": { "cache/integration-tests": "^0.16", + "laminas/laminas-coding-standard": "~1.0.0", + "laminas/laminas-serializer": "^2.6", + "laminas/laminas-session": "^2.7.4", "phpbench/phpbench": "^0.13", - "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.2", - "zendframework/zend-coding-standard": "~1.0.0", - "zendframework/zend-serializer": "^2.6", - "zendframework/zend-session": "^2.7.4" + "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.2" + }, + "provide": { + "psr/cache-implementation": "1.0", + "psr/simple-cache-implementation": "1.0" }, "suggest": { - "zendframework/zend-serializer": "Zend\\Serializer component", - "zendframework/zend-session": "Zend\\Session component", "ext-apc": "APC or compatible extension, to use the APC storage adapter", "ext-apcu": "APCU >= 5.1.0, to use the APCu storage adapter", "ext-dba": "DBA, to use the DBA storage adapter", @@ -46,6 +63,8 @@ "ext-redis": "Redis, to use Redis storage adapter", "ext-wincache": "WinCache, to use the WinCache storage adapter", "ext-xcache": "XCache, to use the XCache storage adapter", + "laminas/laminas-serializer": "Laminas\\Serializer component", + "laminas/laminas-session": "Laminas\\Session component", "mongodb/mongodb": "Required for use with the ext-mongodb adapter", "mongofill/mongofill": "Alternative to ext-mongo - a pure PHP implementation designed as a drop in replacement" }, @@ -54,36 +73,18 @@ "autoload/patternPluginManagerPolyfill.php" ], "psr-4": { - "Zend\\Cache\\": "src/" + "Laminas\\Cache\\": "src/" } }, "autoload-dev": { "psr-4": { - "ZendTest\\Cache\\": "test/", - "ZendBench\\Cache\\": "benchmark/" + "LaminasTest\\Cache\\": "test/", + "LaminasBench\\Cache\\": "benchmark/" }, "files": [ "test/autoload.php" ] }, - "config": { - "process-timeout": 600, - "sort-packages": true - }, - "provide": { - "psr/cache-implementation": "1.0", - "psr/simple-cache-implementation": "1.0" - }, - "extra": { - "branch-alias": { - "dev-master": "2.9.x-dev", - "dev-develop": "2.10.x-dev" - }, - "zf": { - "component": "Zend\\Cache", - "config-provider": "Zend\\Cache\\ConfigProvider" - } - }, "scripts": { "check": [ "@cs-check", @@ -93,5 +94,8 @@ "cs-fix": "phpcbf", "test": "phpunit --colors=always", "test-coverage": "phpunit --colors=always --coverage-clover clover.xml" + }, + "replace": { + "zendframework/zend-cache": "self.version" } } diff --git a/php-laminas-cache.spec b/php-laminas-cache.spec index 84e4b95..e82ef2f 100644 --- a/php-laminas-cache.spec +++ b/php-laminas-cache.spec @@ -1,4 +1,4 @@ -# remirepo/Fedora spec file for php-zendframework-zend-cache +# remirepo/Fedora spec file for php-laminas-cache # # Copyright (c) 2015-2020 Remi Collet # License: CC-BY-SA @@ -6,26 +6,25 @@ # # Please, preserve the changelog entries # -%global bootstrap 0 -%global gh_commit cffd54a2dc4db094976d3b3f05e418a047cc9110 +# When buid without laminas-session +%global bootstrap 1 +%global gh_commit f4746a868c3e2f2da63c19d23efac12b9d1bb554 %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) -%global gh_owner zendframework -%global gh_project zend-cache +%global gh_owner laminas +%global gh_project laminas-cache +%global zf_name zend-cache %global php_home %{_datadir}/php +%global namespace Laminas %global library Cache -%if %{bootstrap} -%global with_tests 0%{?_with_tests:1} -%else %global with_tests 0%{!?_without_tests:1} -%endif -Name: php-%{gh_owner}-%{gh_project} +Name: php-%{gh_project} Version: 2.9.0 Release: 1%{?dist} -Summary: Zend Framework %{library} component +Summary: %{namespace} Framework %{library} component License: BSD -URL: https://zendframework.github.io/%{gh_project}/ +URL: https://github.com/%{gh_owner}/%{gh_project} Source0: %{gh_commit}/%{name}-%{version}-%{gh_short}.tgz Source1: makesrc.sh @@ -39,76 +38,71 @@ BuildRequires: php-pcre BuildRequires: php-spl # remirepo:1 %if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 -BuildRequires: (php-composer(psr/cache) >= 1.0 with php-composer(psr/cache) < 2) -BuildRequires: (php-composer(psr/simple-cache) >= 1.0 with php-composer(psr/simple-cache) < 2) -BuildRequires: (php-autoloader(%{gh_owner}/zend-eventmanager) >= 3.2 with php-autoloader(%{gh_owner}/zend-eventmanager) < 4) -BuildRequires: (php-autoloader(%{gh_owner}/zend-servicemanager) >= 3.3 with php-autoloader(%{gh_owner}/zend-servicemanager) < 4) -BuildRequires: (php-autoloader(%{gh_owner}/zend-stdlib) >= 3.2.1 with php-autoloader(%{gh_owner}/zend-stdlib) < 4) +BuildRequires: (php-autoloader(%{gh_owner}/laminas-eventmanager) >= 3.2 with php-autoloader(%{gh_owner}/laminas-eventmanager) < 4) +BuildRequires: (php-autoloader(%{gh_owner}/laminas-servicemanager) >= 3.3 with php-autoloader(%{gh_owner}/laminas-servicemanager) < 4) +BuildRequires: (php-autoloader(%{gh_owner}/laminas-stdlib) >= 3.2.1 with php-autoloader(%{gh_owner}/laminas-stdlib) < 4) +BuildRequires: (php-autoloader(%{gh_owner}/laminas-zendframework-bridge) >= 1.0 with php-autoloader(%{gh_owner}/laminas-zendframework-bridge) < 2) +BuildRequires: (php-composer(psr/cache) >= 1.0 with php-composer(psr/cache) < 2) +BuildRequires: (php-composer(psr/simple-cache) >= 1.0 with php-composer(psr/simple-cache) < 2) # From composer, "require-dev": { # "cache/integration-tests": "^0.16", +# "laminas/laminas-coding-standard": "~1.0.0", +# "laminas/laminas-serializer": "^2.6", +# "laminas/laminas-session": "^2.7.4", # "phpbench/phpbench": "^0.13", -# "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.2", -# "zendframework/zend-coding-standard": "~1.0.0", -# "zendframework/zend-serializer": "^2.6", -# "zendframework/zend-session": "^2.7.4" -%global phpunit %{_bindir}/phpunit7 -BuildRequires: phpunit7 >= 7.1.2 +# "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.2" +BuildRequires: (php-composer(cache/integration-tests) >= 0.16 with php-composer(cache/integration-tests) < 1) +BuildRequires: (php-autoloader(%{gh_owner}/laminas-serializer) >= 2.6 with php-autoloader(%{gh_owner}/laminas-serializer) < 3) +%if ! %{bootstrap} +BuildRequires: (php-autoloader(%{gh_owner}/laminas-session) >= 2.7.4 with php-autoloader(%{gh_owner}/laminas-session) < 3) +%endif # remirepo:14 %else -BuildRequires: php-composer(psr/cache) < 2 -BuildRequires: php-composer(psr/cache) >= 1.0 -BuildRequires: php-composer(psr/simple-cache) < 2 -BuildRequires: php-composer(psr/simple-cache) >= 1.0 -BuildRequires: php-autoloader(%{gh_owner}/zend-eventmanager) < 4 -BuildRequires: php-autoloader(%{gh_owner}/zend-eventmanager) >= 3.2 -BuildRequires: php-autoloader(%{gh_owner}/zend-servicemanager) < 4 -BuildRequires: php-autoloader(%{gh_owner}/zend-servicemanager) >= 3.3 -BuildRequires: php-autoloader(%{gh_owner}/zend-stdlib) < 4 -BuildRequires: php-autoloader(%{gh_owner}/zend-stdlib) >= 3.2.1 -%global phpunit %{_bindir}/phpunit6 -BuildRequires: phpunit6 >= 6.5.8 +BuildRequires: php-laminas-eventmanager +BuildRequires: php-laminas-servicemanager +BuildRequires: php-laminas-stdlib +BuildRequires: php-laminas-zendframework-bridge +BuildRequires: php-psr-cache +BuildRequires: php-psr-simple-cache +BuildRequires: php-cache-integration-tests +BuildRequires: php-laminas-serializer +%if ! %{bootstrap} +BuildRequires: php-laminas-session %endif -BuildRequires: php-cache-integration-tests >= 0.16 -BuildRequires: php-composer(%{gh_owner}/zend-serializer) >= 2.6 -BuildRequires: php-composer(%{gh_owner}/zend-session) >= 2.7.4 +%endif +%global phpunit %{_bindir}/phpunit7 +BuildRequires: phpunit7 >= 7.1.2 # Autoloader -BuildRequires: php-composer(%{gh_owner}/zend-loader) >= 2.5 BuildRequires: php-fedora-autoloader-devel %endif # From composer, "require": { # "php": "^5.6 || ^7.0", +# "laminas/laminas-eventmanager": "^2.6.3 || ^3.2", +# "laminas/laminas-servicemanager": "^2.7.8 || ^3.3", +# "laminas/laminas-stdlib": "^3.2.1", +# "laminas/laminas-zendframework-bridge": "^1.0", # "psr/cache": "^1.0", -# "psr/simple-cache": "^1.0", -# "zendframework/zend-eventmanager": "^2.6.3 || ^3.2", -# "zendframework/zend-servicemanager": "^2.7.8 || ^3.3", -# "zendframework/zend-stdlib": "^2.7.7 || ^3.1" +# "psr/simple-cache": "^1.0" Requires: php(language) >= 5.6 -%if ! %{bootstrap} # remirepo:1 %if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 -Requires: (php-composer(psr/cache) >= 1.0 with php-composer(psr/cache) < 2) -Requires: (php-composer(psr/simple-cache) >= 1.0 with php-composer(psr/simple-cache) < 2) -Requires: (php-autoloader(%{gh_owner}/zend-eventmanager) >= 3.2 with php-autoloader(%{gh_owner}/zend-eventmanager) < 4) -Requires: (php-autoloader(%{gh_owner}/zend-servicemanager) >= 3.3 with php-autoloader(%{gh_owner}/zend-servicemanager) < 4) -Requires: (php-autoloader(%{gh_owner}/zend-stdlib) >= 3.2.1 with php-autoloader(%{gh_owner}/zend-stdlib) < 4) -# remirepo:12 +Requires: (php-autoloader(%{gh_owner}/laminas-eventmanager) >= 3.2 with php-autoloader(%{gh_owner}/laminas-eventmanager) < 4) +Requires: (php-autoloader(%{gh_owner}/laminas-servicemanager) >= 3.3 with php-autoloader(%{gh_owner}/laminas-servicemanager) < 4) +Requires: (php-autoloader(%{gh_owner}/laminas-stdlib) >= 3.2.1 with php-autoloader(%{gh_owner}/laminas-stdlib) < 4) +Requires: (php-autoloader(%{gh_owner}/laminas-zendframework-bridge) >= 1.0 with php-autoloader(%{gh_owner}/laminas-zendframework-bridge) < 2) +Requires: (php-composer(psr/cache) >= 1.0 with php-composer(psr/cache) < 2) +Requires: (php-composer(psr/simple-cache) >= 1.0 with php-composer(psr/simple-cache) < 2) +# remirepo:8 %else -Requires: php-composer(psr/cache) < 2 -Requires: php-composer(psr/cache) >= 1.0 -Requires: php-composer(psr/simple-cache) < 2 -Requires: php-composer(psr/simple-cache) >= 1.0 -Requires: php-autoloader(%{gh_owner}/zend-eventmanager) < 4 -Requires: php-autoloader(%{gh_owner}/zend-eventmanager) >= 3.2 -Requires: php-autoloader(%{gh_owner}/zend-servicemanager) < 4 -Requires: php-autoloader(%{gh_owner}/zend-servicemanager) >= 3.3 -Requires: php-autoloader(%{gh_owner}/zend-stdlib) < 4 -Requires: php-autoloader(%{gh_owner}/zend-stdlib) >= 3.2.1 +Requires: php-laminas-eventmanager +Requires: php-laminas-servicemanager +Requires: php-laminas-stdlib +Requires: php-laminas-zendframework-bridge +Requires: php-psr-cache +Requires: php-psr-simple-cache %endif # From composer, "suggest": { -# "zendframework/zend-serializer": "Zend\\Serializer component", -# "zendframework/zend-session": "Zend\\Session component", -# "ext-apcu": "APCU, to use the APC storage adapter", # "ext-apc": "APC or compatible extension, to use the APC storage adapter", # "ext-apcu": "APCU >= 5.1.0, to use the APCu storage adapter", # "ext-dba": "DBA, to use the DBA storage adapter", @@ -119,17 +113,18 @@ Requires: php-autoloader(%{gh_owner}/zend-stdlib) >= 3.2.1 # "ext-redis": "Redis, to use Redis storage adapter", # "ext-wincache": "WinCache, to use the WinCache storage adapter", # "ext-xcache": "XCache, to use the XCache storage adapter", +# "laminas/laminas-serializer": "Laminas\\Serializer component", +# "laminas/laminas-session": "Laminas\\Session component", # "mongodb/mongodb": "Required for use with the ext-mongodb adapter", # "mongofill/mongofill": "Alternative to ext-mongo - a pure PHP implementation designed as a drop in replacement" -Suggests: php-composer(%{gh_owner}/zend-serializer) -Suggests: php-composer(%{gh_owner}/zend-session) -Suggests: php-pecl(apcu) +Suggests: php-apcu Suggests: php-dba -Suggests: php-pecl(memcache) -Suggests: php-pecl(memcached) -Suggests: php-pecl(redis) +Suggests: php-memcache +Suggests: php-memcached +Suggests: php-redis +Suggests: php-composer(%{gh_owner}/laminas-serializer) +Suggests: php-composer(%{gh_owner}/laminas-session) Suggests: php-composer(mongodb/mongodb) -%endif # From phpcompatinfo report for version 2.9.0 Requires: php-reflection Requires: php-date @@ -138,25 +133,24 @@ Requires: php-spl # Autoloader Requires: php-composer(fedora/autoloader) -Obsoletes: php-ZendFramework2-%{library} < 2.5 -Obsoletes: php-ZendFramework2-%{library}-apc < 2.5 -Obsoletes: php-ZendFramework2-%{library}-memcached < 2.5 -Provides: php-ZendFramework2-%{library} = %{version} -Provides: php-ZendFramework2-%{library}-apc = %{version} -Provides: php-ZendFramework2-%{library}-memcached = %{version} -Provides: php-composer(%{gh_owner}/%{gh_project}) = %{version} +# Compatibily ensure by the bridge +Obsoletes: php-zendframework-%{zf_name} < 2.9.0-99 +Provides: php-zendframework-%{zf_name} = %{version}-99 +Provides: php-composer(%{gh_owner}/%{gh_project}) = %{version} +Provides: php-composer(zendframework/%{zf_name}) = %{version} Provides: php-autoloader(%{gh_owner}/%{gh_project}) = %{version} +Provides: php-autoloader(zendframework/%{zf_name}) = %{version} Provides: php-composer(psr/cache-implementation) = 1.0 Provides: php-composer(psr/simple-cache-implementation) = 1.0 %description -Zend\Cache provides a general cache system for PHP. -The Zend\Cache component is able to cache different patterns +%{namespace}\Cache provides a general cache system for PHP. +The %{namespace}\Cache component is able to cache different patterns (class, object, output, etc) using different storage adapters (DB, File, Memcache, etc). -Documentation: https://zendframework.github.io/%{gh_project}/ +Documentation: https://docs.laminas.dev/%{gh_project}/ %prep @@ -167,39 +161,43 @@ mv LICENSE.md LICENSE mv autoload/*.php src %build -: Create dependency autoloader - deprecated -cat << 'EOF' | tee autoload.php -<?php -require_once __DIR__ . '/%{library}/patternPluginManagerPolyfill.php'; -require_once '%{php_home}/Psr/Cache/autoload.php'; -require_once '%{php_home}/Psr/SimpleCache/autoload.php'; -EOF - : Create autoloader phpab --template fedora --output src/autoload.php src cat << 'EOF' | tee -a src/autoload.php \Fedora\Autoloader\Dependencies::required([ '%{php_home}/Psr/Cache/autoload.php', '%{php_home}/Psr/SimpleCache/autoload.php', - '%{php_home}/Zend/Stdlib/autoload.php', - '%{php_home}/Zend/ServiceManager/autoload.php', - '%{php_home}/Zend/EventManager/autoload.php', + '%{php_home}/%{namespace}/Stdlib/autoload.php', + '%{php_home}/%{namespace}/ServiceManager/autoload.php', + '%{php_home}/%{namespace}/EventManager/autoload.php', __DIR__ . '/patternPluginManagerPolyfill.php', ]); \Fedora\Autoloader\Dependencies::optional([ - '%{php_home}/Zend/Serializer/autoload.php', - '%{php_home}/Zend/Session/autoload.php', + '%{php_home}/%{namespace}/Serializer/autoload.php', + '%{php_home}/%{namespace}/Session/autoload.php', '%{php_home}/MongoDB/autoload.php', ]); EOF +cat << 'EOF' | tee zf.php +<?php +require_once '%{php_home}/Fedora/Autoloader/autoload.php'; +\Fedora\Autoloader\Dependencies::required([ + '%{php_home}/%{namespace}/ZendFrameworkBridge/autoload.php', + dirname(dirname(__DIR__)) . '/%{namespace}/%{library}/autoload.php', +]); +EOF + %install -mkdir -p %{buildroot}%{php_home}/Zend/ -cp -pr src %{buildroot}%{php_home}/Zend/%{library} +: Laminas library +mkdir -p %{buildroot}%{php_home}/%{namespace}/ +cp -pr src %{buildroot}%{php_home}/%{namespace}/%{library} -install -m644 autoload.php %{buildroot}%{php_home}/Zend/%{library}-autoload.php +: Zend equiv +mkdir -p %{buildroot}%{php_home}/Zend/%{library} +cp -pr zf.php %{buildroot}%{php_home}/Zend/%{library}/autoload.php %check @@ -207,13 +205,11 @@ install -m644 autoload.php %{buildroot}%{php_home}/Zend/%{library}-autoload.php mkdir vendor cat << 'EOF' | tee vendor/autoload.php <?php -require_once '%{buildroot}%{php_home}/Zend/%{library}/autoload.php'; -# For BR without new autoloader +require_once '%{buildroot}%{php_home}/%{namespace}/%{library}/autoload.php'; \Fedora\Autoloader\Dependencies::required([ '%{php_home}/Cache/IntegrationTests/autoload.php', - '%{php_home}/Zend/autoload.php', ]); -\Fedora\Autoloader\Autoload::addPsr4('ZendTest\\%{library}\\', dirname(__DIR__) . '/test'); +\Fedora\Autoloader\Autoload::addPsr4('%{namespace}Test\\%{library}\\', dirname(__DIR__) . '/test'); EOF # Try to slowdown tests with erratic results @@ -221,13 +217,25 @@ sed -e '/unlinkDelay/s/5000/50000/' \ -e '/usleep/s/1000/10000/' \ -i test/Storage/Adapter/FilesystemTest.php +%if %{bootstrap} +rm test/Storage/Adapter/SessionTest.php +%endif + +: upstream test suite ret=0 -for cmdarg in "php %{phpunit}" php71 php72 php73 php74; do +for cmdarg in "php %{phpunit}" php72 php73 php74; do if which $cmdarg; then set $cmdarg - $1 ${2:-%{_bindir}/phpunit7} --verbose || ret=1 + $1 ${2:-%{_bindir}/phpunit7} || ret=1 fi done + +: check compat autoloader +php -r ' +require "%{buildroot}%{php_home}/Zend/%{library}/autoload.php"; +return (class_exists("\\Zend\\%{library}\\StorageFactory") ? 0 : 1); +' + exit $ret %else : Test suite disabled @@ -241,10 +249,14 @@ exit $ret %doc *.md %doc composer.json %{php_home}/Zend/%{library} -%{php_home}/Zend/%{library}-autoload.php +%{php_home}/%{namespace}/%{library} %changelog +* Wed Jan 8 2020 Remi Collet <remi@remirepo.net> - 2.9.0-1 +- switch to Laminas +- boostrap build without laminas-session + * Fri Aug 30 2019 Remi Collet <remi@remirepo.net> - 2.9.0-1 - update to 2.9.0 - raise dependency on zend-stdlib 3.2.1 |