summaryrefslogtreecommitdiffstats
path: root/php-laminas-diactoros2.spec
diff options
context:
space:
mode:
Diffstat (limited to 'php-laminas-diactoros2.spec')
-rw-r--r--php-laminas-diactoros2.spec17
1 files changed, 12 insertions, 5 deletions
diff --git a/php-laminas-diactoros2.spec b/php-laminas-diactoros2.spec
index 3165b15..f8efada 100644
--- a/php-laminas-diactoros2.spec
+++ b/php-laminas-diactoros2.spec
@@ -38,7 +38,7 @@
Name: php-%{gh_project}%{major}
Version: 2.2.2
-Release: 1%{?gh_release}%{?dist}
+Release: 2%{?gh_release}%{?dist}
Summary: PSR HTTP Message implementations v%{major}
License: BSD
@@ -157,7 +157,8 @@ mv LICENSE.md LICENSE
: Create autoloader
phpab --template fedora --output src/autoload.php src
cat <<'AUTOLOAD' | tee -a src/autoload.php
-\Fedora\Autoloader\Dependencies::required(array(
+if (!function_exists('Laminas\\Diactoros\\createUploadedFile')) {
+ \Fedora\Autoloader\Dependencies::required(array(
'%{phpdir}/Psr/Http/Message/autoload.php',
'%{phpdir}/Psr/Http/Message/http-factory-autoload.php',
__DIR__.'/functions/create_uploaded_file.php',
@@ -168,14 +169,16 @@ cat <<'AUTOLOAD' | tee -a src/autoload.php
__DIR__.'/functions/normalize_server.php',
__DIR__.'/functions/normalize_uploaded_files.php',
__DIR__.'/functions/parse_cookie_header.php',
-));
+ ));
+}
AUTOLOAD
cat << 'EOF' | tee zf.php
<?php
require_once '%{php_home}/Fedora/Autoloader/autoload.php';
$dir = dirname(dirname(__DIR__)) . '/%{namespace}/%{library}%{major}';
-\Fedora\Autoloader\Dependencies::required([
+if (!function_exists('Zend\\Diactoros\\createUploadedFile')) {
+ \Fedora\Autoloader\Dependencies::required([
'%{php_home}/%{namespace}/ZendFrameworkBridge/autoload.php',
$dir . '/autoload.php',
$dir . '/functions/create_uploaded_file.legacy.php',
@@ -186,7 +189,8 @@ $dir = dirname(dirname(__DIR__)) . '/%{namespace}/%{library}%{major}';
$dir . '/functions/normalize_server.legacy.php',
$dir . '/functions/normalize_uploaded_files.legacy.php',
$dir . '/functions/parse_cookie_header.legacy.php',
-]);
+ ]);
+}
EOF
@@ -248,6 +252,9 @@ exit $RETURN_CODE
%changelog
+* Thu Jan 23 2020 Remi Collet <remi@remirepo.net> - 2.2.2-2
+- fix autoloader, ensure functions are not defined twice
+
* Wed Jan 22 2020 Remi Collet <remi@remirepo.net> - 2.2.2-1
- update to 2.2.2
- rename to php-laminas-diactoros2