summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--composer-chronos.json4
-rw-r--r--composer.json2
-rw-r--r--php-cakephp4.spec131
3 files changed, 127 insertions, 10 deletions
diff --git a/composer-chronos.json b/composer-chronos.json
index 03491e8..029a019 100644
--- a/composer-chronos.json
+++ b/composer-chronos.json
@@ -30,7 +30,7 @@
},
"require-dev": {
"phpunit/phpunit": "^8.0",
- "cakephp/cakephp-codesniffer": "dev-next",
+ "cakephp/cakephp-codesniffer": "^4.0",
"phpbench/phpbench": "^1.0@dev"
},
"autoload": {
@@ -60,6 +60,6 @@
"cs-fix": "phpcbf",
"benchmark": "phpbench run --report=chronos",
"phpstan": "phpstan analyze -c phpstan.neon -l 3 src/",
- "phpstan-setup": "cp composer.json composer.backup && composer require --dev phpstan/phpstan-shim:^0.11 && mv composer.backup composer.json"
+ "phpstan-setup": "cp composer.json composer.backup && composer require --dev phpstan/phpstan:^0.12 && mv composer.backup composer.json"
}
}
diff --git a/composer.json b/composer.json
index 675132a..4024299 100644
--- a/composer.json
+++ b/composer.json
@@ -110,7 +110,7 @@
"@phpstan",
"@psalm"
],
- "stan-setup": "cp composer.json composer.backup && composer require --dev phpstan/phpstan:^0.12 psalm/phar:~3.8.0 && mv composer.backup composer.json"
+ "stan-setup": "cp composer.json composer.backup && composer require --dev phpstan/phpstan:^0.12.7 psalm/phar:~3.8.0 && mv composer.backup composer.json"
},
"config": {
"sort-packages": true,
diff --git a/php-cakephp4.spec b/php-cakephp4.spec
index 1e67ad5..341e317 100644
--- a/php-cakephp4.spec
+++ b/php-cakephp4.spec
@@ -7,11 +7,11 @@
# Please, preserve the changelog entries
#
-# TODO: Http, Form, ORM
+# TODO: Form, ORM
# Auth, Command, Controller, Error, Mailer, Network, Routing, Shell, TestSuite, View
# https://github.com/cakephp/cakephp/releases
-%global gh_commit a5e8c076c54343e47cd47c7888705ad9818f5e0f
+%global gh_commit 94435ab211196ce92014a83ec7bab4e385bf8ba3
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
%global gh_owner cakephp
%global gh_project cakephp
@@ -22,13 +22,13 @@
%global major 4
# https://github.com/cakephp/chronos/releases
-%global chronos_commit 779054d4c7ca88fc086b2cdd1f02aaf0df9ccb01
+%global chronos_commit e1044d27cabf12d19097b436001aa96a3c2e4b0a
%global chronos_short %(c=%{chronos_commit}; echo ${c:0:7})
-%global chronos_version 2.0.1
+%global chronos_version 2.0.2
Name: php-%{pk_vendor}%{major}
-Version: 4.0.2
-Release: 1%{?dist}
+Version: 4.0.3
+Release: 2%{?dist}
Summary: The CakePHP framework
License: MIT
@@ -348,6 +348,78 @@ CakePHP FileSystem Library:
CakePHP filesystem convenience classes to help you work with files and folders.
+%package http
+Summary: CakePHP Http Library
+# From composer.json "require": {
+# "php": ">=7.2.0",
+# "cakephp/core": "^4.0",
+# "cakephp/event": "^4.0",
+# "cakephp/utility": "^4.0",
+# "composer/ca-bundle": "^1.2",
+# "psr/http-client": "^1.0",
+# "psr/http-server-handler": "^1.0",
+# "psr/http-server-middleware": "^1.0",
+# "zendframework/zend-diactoros": "^2.1",
+# "zendframework/zend-httphandlerrunner": "^1.0"
+Requires: php(language) >= 7.2
+Requires: php-composer(%{pk_vendor}/core) = %{version}
+Requires: php-composer(%{pk_vendor}/event) = %{version}
+Requires: php-composer(%{pk_vendor}/utility) = %{version}
+%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
+BuildRequires: (php-composer(composer/ca-bundle) >= 1.2 with php-composer(composer/ca-bundle) < 2)
+Requires: (php-composer(composer/ca-bundle) >= 1.2 with php-composer(composer/ca-bundle) < 2)
+BuildRequires: (php-composer(psr/http-client) >= 1.0 with php-composer(psr/http-client) < 2)
+Requires: (php-composer(psr/http-client) >= 1.0 with php-composer(psr/http-client) < 2)
+BuildRequires: (php-composer(psr/http-server-handler) >= 1.0 with php-composer(psr/http-server-handler) < 2)
+Requires: (php-composer(psr/http-server-handler) >= 1.0 with php-composer(psr/http-server-handler) < 2)
+BuildRequires: (php-composer(psr/http-server-middleware) >= 1.0 with php-composer(psr/http-server-middleware) < 2)
+Requires: (php-composer(psr/http-server-middleware) >= 1.0 with php-composer(psr/http-server-middleware) < 2)
+BuildRequires: (php-composer(laminas/laminas-diactoros) >= 2.1 with php-composer(laminas/laminas-diactoros) < 3)
+Requires: (php-composer(laminas/laminas-diactoros) >= 2.1 with php-composer(laminas/laminas-diactoros) < 3)
+BuildRequires: (php-composer(laminas/laminas-httphandlerrunner) >= 1.0 with php-composer(laminas/laminas-httphandlerrunner) < 2)
+Requires: (php-composer(laminas/laminas-httphandlerrunner) >= 1.0 with php-composer(laminas/laminas-httphandlerrunner) < 2)
+# From composer.json "suggest": {
+# "cakephp/cache": "To use cache session storage",
+# "cakephp/orm": "To use database session storage"
+Suggests: php-composer(%{pk_vendor}/cache)
+Suggests: php-composer(%{pk_vendor}/orm)
+%else
+BuildRequires: php-composer-ca-bundle
+Requires: php-composer-ca-bundle
+BuildRequires: php-psr-http-client
+Requires: php-psr-http-client
+BuildRequires: php-psr-http-server-handler
+Requires: php-psr-http-server-handler
+BuildRequires: php-psr-http-server-middleware
+Requires: php-psr-http-server-middleware
+BuildRequires: php-laminas-diactoros2
+Requires: php-laminas-diactoros2
+BuildRequires: php-laminas-httphandlerrunner
+Requires: php-laminas-httphandlerrunner
+%endif
+# From phpcompatinfo report
+Requires: php-reflection
+Requires: php-simplexml
+Requires: php-curl
+Requires: php-date
+Requires: php-fileinfo
+Requires: php-hash
+Requires: php-json
+Requires: php-libxml
+Requires: php-mbstring
+Requires: php-openssl
+Requires: php-pcre
+Requires: php-session
+Requires: php-spl
+Requires: php-zlib
+Provides: php-composer(%{pk_vendor}/http) = %{version}
+
+%description http
+CakePHP Http Library:
+
+CakePHP HTTP client and PSR7/15 middleware libraries.
+
+
%package i18n
Summary: CakePHP I18n Library
# From composer.json "require": {
@@ -503,6 +575,7 @@ require_once '%{php_home}/Fedora/Autoloader/autoload.php';
'%{php_home}/Aura/Intl/autoload.php',
'%{php_home}/Psr/Log/autoload.php',
'%{php_home}/Psr/SimpleCache/autoload.php',
+ '%{php_home}/Psr/Http/Client/autoload.php',
'%{php_home}/Psr/Http/Message/autoload.php',
'%{php_home}/Psr/Http/Server/autoload.php',
'%{php_home}/Psr/Http/Server/middleware-autoload.php',
@@ -625,6 +698,26 @@ require_once '%{php_home}/Fedora/Autoloader/autoload.php';
]);
EOF
+: ===== Generate "http" autoloader
+cat << 'EOF' | tee src/Http/autoload.php
+<?php
+require_once '%{php_home}/Fedora/Autoloader/autoload.php';
+
+\Fedora\Autoloader\Autoload::addPsr4('Cake\\Http\\', __DIR__);
+\Fedora\Autoloader\Dependencies::required([
+ dirname(__DIR__) . '/Core/autoload.php',
+ dirname(__DIR__) . '/Event/autoload.php',
+ dirname(__DIR__) . '/Utility/autoload.php',
+ '%{php_home}/Composer/CaBundle/autoload.php',
+ '%{php_home}/Psr/Http/Client/autoload.php',
+ '%{php_home}/Psr/Http/Server/autoload.php',
+ '%{php_home}/Psr/Http/Server/middleware-autoload.php',
+ '%{php_home}/Composer/CaBundle/autoload.php',
+ '%{php_home}/Laminas/Diactoros2/autoload.php',
+ '%{php_home}/Laminas/HttpHandlerRunner/autoload.php',
+]);
+EOF
+
: ===== Generate "i18n" autoloader
cat << 'EOF' | tee src/I18n/autoload.php
<?php
@@ -681,7 +774,7 @@ EOF
%install
#: Library
mkdir -p %{buildroot}%{php_home}/%{ns_vendor}%{major}
-for dir in Cache Chronos Collection Console Core Database Datasource Event Filesystem I18n Log Utility Validation; do
+for dir in Cache Chronos Collection Console Core Database Datasource Event Filesystem Http I18n Log Utility Validation; do
cp -pr src/$dir %{buildroot}%{php_home}/%{ns_vendor}%{major}/
done
@@ -725,6 +818,10 @@ require "%{buildroot}%{php_home}/%{ns_vendor}%{major}/Filesystem/autoload.php";
exit (class_exists("Cake\\Filesystem\\File") ? 0 : 1);
'
php -r '
+require "%{buildroot}%{php_home}/%{ns_vendor}%{major}/Http/autoload.php";
+exit (class_exists("Cake\\Http\\Server") ? 0 : 1);
+'
+php -r '
require "%{buildroot}%{php_home}/%{ns_vendor}%{major}/I18n/autoload.php";
exit (class_exists("Cake\\I18n\\Date") ? 0 : 1);
'
@@ -758,6 +855,9 @@ phpunit8 tests/TestCase/Datasource --verbose || ret=1
%endif
phpunit8 tests/TestCase/Event --verbose || ret=1
phpunit8 tests/TestCase/Filesystem --verbose || ret=1
+phpunit8 tests/TestCase/Http \
+ --filter '^((?!(CspMiddlewareTest)).)*$' \
+ --verbose || ret=1
phpunit8 tests/TestCase/I18n --verbose || ret=1
phpunit8 tests/TestCase/Log --verbose || ret=1
phpunit8 tests/TestCase/Utility --verbose || ret=1
@@ -859,6 +959,16 @@ exit $ret
%exclude %{php_home}/%{ns_vendor}%{major}/Filesystem/composer.json
%exclude %{php_home}/%{ns_vendor}%{major}/Filesystem/LICENSE.txt
+%files http
+%{!?_licensedir:%global license %%doc}
+%license src/Http/LICENSE.txt
+%doc src/Http/composer.json
+%doc src/Http/*md
+ %{php_home}/%{ns_vendor}%{major}/Http
+%exclude %{php_home}/%{ns_vendor}%{major}/Http/*.md
+%exclude %{php_home}/%{ns_vendor}%{major}/Http/composer.json
+%exclude %{php_home}/%{ns_vendor}%{major}/Http/LICENSE.txt
+
%files i18n
%{!?_licensedir:%global license %%doc}
%license src/I18n/LICENSE.txt
@@ -901,6 +1011,13 @@ exit $ret
%changelog
+* Mon Feb 10 2020 Remi Collet <remi@remirepo.net> - 4.0.3-2
+- use Chronos 2.0.2
+- add Http component
+
+* Mon Jan 27 2020 Remi Collet <remi@remirepo.net> - 4.0.3-1
+- update to 4.0.3
+
* Mon Jan 13 2020 Remi Collet <remi@remirepo.net> - 4.0.2-1
- update to 4.0.2
- switch from Zend to Laminas