diff options
author | Remi Collet <remi@remirepo.net> | 2019-06-17 17:00:34 +0200 |
---|---|---|
committer | Remi Collet <remi@remirepo.net> | 2019-06-17 17:00:34 +0200 |
commit | e9ccb236ad7201481a88d6a49c144f80d01996a0 (patch) | |
tree | 7cb2d840a8622d419c6ede5d51e5adb450452121 | |
parent | f866284c80fb1edf603053cfef406e4aae1aa90b (diff) |
- add dependency on symfony/http-kernel
- add dependency on symfony/proxy-manager-bridge
- add dependency on symfony/config
- switch from Symfony 2 to Sypmfony 3 or 4
- raise dependency on php-di 6.0
-rw-r--r-- | composer.json | 31 | ||||
-rw-r--r-- | php-di-symfony2-bridge.spec | 135 |
2 files changed, 129 insertions, 37 deletions
diff --git a/composer.json b/composer.json index e91cb4b..8a05788 100644 --- a/composer.json +++ b/composer.json @@ -1,18 +1,31 @@ { - "name": "php-di/symfony2-bridge", + "name": "php-di/symfony-bridge", "type": "library", - "description": "Integrates PHP-DI to Symfony 2", - "homepage": "https://github.com/PHP-DI/Symfony2-Bridge/", + "description": "Integrates PHP-DI to Symfony", + "homepage": "http://php-di.org/doc/frameworks/symfony2.html", "license": "MIT", "autoload": { - "psr-0": { - "DI\\Bridge\\Symfony": "src/", - "UnitTest\\DI\\Bridge\\Symfony": "tests/", - "FunctionalTest\\DI\\Bridge\\Symfony": "tests/" + "psr-4": { + "DI\\Bridge\\Symfony\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "DI\\Bridge\\Symfony\\Test\\": "tests/" } }, "require": { - "php-di/php-di": "~4.0 || ^5.0", - "symfony/dependency-injection": "~2.0" + "php": "~7.0", + "php-di/php-di": "~6.0", + "symfony/dependency-injection": "~3.3||~4.0", + "symfony/http-kernel": "~3.3||~4.0", + "symfony/proxy-manager-bridge": "~3.3||~4.0", + "symfony/config": "~3.3||~4.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8", + "symfony/filesystem": "^3.0", + "symfony/yaml": "^3.0", + "symfony/debug": "^3.0" } } diff --git a/php-di-symfony2-bridge.spec b/php-di-symfony2-bridge.spec index 9582606..59501e9 100644 --- a/php-di-symfony2-bridge.spec +++ b/php-di-symfony2-bridge.spec @@ -12,18 +12,23 @@ %global github_owner PHP-DI %global github_name Symfony2-Bridge -%global github_version 1.1.0 -%global github_commit e197ddc965e21c8b865a74d45dd73e334b674bd3 +%global github_version 3.0.0 +%global github_commit d536a47f168b2c06fd15a2f902ea6d59ff8dc55d %global composer_vendor php-di %global composer_project symfony2-bridge -# "php-di/php-di": "~4.0 || ^5.0" -%global di_min_ver 4.0 -%global di_max_ver 6.0 -# "symfony/dependency-injection": "~2.0" -%global symfony_min_ver 2.0 -%global symfony_max_ver 3.0 +# "php": ">=7.0.0" +%global php_min_ver 7.0.0 +# "php-di/php-di": "~6.0" +%global di_min_ver 6.0 +%global di_max_ver 7 +# "symfony/dependency-injection": "~3.3||~4.0", +# "symfony/http-kernel": "~3.3||~4.0", +# "symfony/proxy-manager-bridge": "~3.3||~4.0", +# "symfony/config": "~3.3||~4.0" +%global symfony_min_ver 3.3 +%global symfony_max_ver 5 # Build using "--without tests" to disable tests %global with_tests 0%{!?_without_tests:1} @@ -32,8 +37,8 @@ Name: %{composer_vendor}-%{composer_project} Version: %{github_version} -Release: 9%{?github_release}%{?dist} -Summary: PHP-DI integration with Symfony 2 +Release: 1%{?github_release}%{?dist} +Summary: PHP-DI integration with Symfony License: MIT URL: http://php-di.org/doc/frameworks/symfony2.html @@ -47,24 +52,61 @@ BuildArch: noarch # Tests %if %{with_tests} ## composer.json +BuildRequires: php-composer(phpunit/phpunit) +%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 +BuildRequires:(php-composer(php-di/php-di) >= %{di_min_ver} with php-composer(php-di/php-di) < %{di_max_ver}) +BuildRequires:(php-composer(symfony/dependency-injection) >= %{symfony_min_ver} with php-composer(symfony/dependency-injection) < %{symfony_max_ver}) +BuildRequires:(php-composer(symfony/http-kernel) >= %{symfony_min_ver} with php-composer(symfony/http-kernel) < %{symfony_max_ver}) +BuildRequires:(php-composer(symfony/proxy-manager-bridge) >= %{symfony_min_ver} with php-composer(symfony/proxy-manager-bridge) < %{symfony_max_ver}) +BuildRequires:(php-composer(symfony/config) >= %{symfony_min_ver} with php-composer(symfony/config) < %{symfony_max_ver}) +BuildRequires:(php-composer(symfony/filesystem) >= %{symfony_min_ver} with php-composer(symfony/filesystem) < %{symfony_max_ver}) +BuildRequires:(php-composer(symfony/yaml) >= %{symfony_min_ver} with php-composer(symfony/yaml) < %{symfony_max_ver}) +BuildRequires:(php-composer(symfony/debug) >= %{symfony_min_ver} with php-composer(symfony/debug) < %{symfony_max_ver}) +%else BuildRequires: php-composer(php-di/php-di) < %{di_max_ver} BuildRequires: php-composer(php-di/php-di) >= %{di_min_ver} -BuildRequires: php-composer(phpunit/phpunit) BuildRequires: php-composer(symfony/dependency-injection) < %{symfony_max_ver} BuildRequires: php-composer(symfony/dependency-injection) >= %{symfony_min_ver} -## phpcompatinfo (computed from version 1.1.0) -BuildRequires: php(language) >= 5.3.0 +BuildRequires: php-composer(symfony/http-kernel) < %{symfony_max_ver} +BuildRequires: php-composer(symfony/http-kernel) >= %{symfony_min_ver} +BuildRequires: php-composer(symfony/proxy-manager-bridge) < %{symfony_max_ver} +BuildRequires: php-composer(symfony/proxy-manager-bridge) >= %{symfony_min_ver} +BuildRequires: php-composer(symfony/config) < %{symfony_max_ver} +BuildRequires: php-composer(symfony/config) >= %{symfony_min_ver} +BuildRequires: php-composer(symfony/filesystem) < %{symfony_max_ver} +BuildRequires: php-composer(symfony/filesystem) >= %{symfony_min_ver} +BuildRequires: php-composer(symfony/yaml) < %{symfony_max_ver} +BuildRequires: php-composer(symfony/yaml) >= %{symfony_min_ver} +BuildRequires: php-composer(symfony/debug) < %{symfony_max_ver} +BuildRequires: php-composer(symfony/debug) >= %{symfony_min_ver} +%endif +## phpcompatinfo (computed from version 3.0.0) +BuildRequires: php(language) >= %{php_min_ver} ## Autoloader BuildRequires: php-composer(fedora/autoloader) %endif # composer.json -Requires: php-composer(php-di/php-di) >= %{di_min_ver} +%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 +Requires: (php-composer(php-di/php-di) >= %{di_min_ver} with php-composer(php-di/php-di) < %{di_max_ver}) +Requires: (php-composer(symfony/dependency-injection) >= %{symfony_min_ver} with php-composer(symfony/dependency-injection) < %{symfony_max_ver}) +Requires: (php-composer(symfony/http-kernel) >= %{symfony_min_ver} with php-composer(symfony/http-kernel) < %{symfony_max_ver}) +Requires: (php-composer(symfony/proxy-manager-bridge) >= %{symfony_min_ver} with php-composer(symfony/proxy-manager-bridge) < %{symfony_max_ver}) +Requires: (php-composer(symfony/config) >= %{symfony_min_ver} with php-composer(symfony/config) < %{symfony_max_ver}) +%else Requires: php-composer(php-di/php-di) < %{di_max_ver} -Requires: php-composer(symfony/dependency-injection) >= %{symfony_min_ver} +Requires: php-composer(php-di/php-di) >= %{di_min_ver} Requires: php-composer(symfony/dependency-injection) < %{symfony_max_ver} -# phpcompatinfo (computed from version 1.1.0) -Requires: php(language) >= 5.3.0 +Requires: php-composer(symfony/dependency-injection) >= %{symfony_min_ver} +Requires: php-composer(symfony/http-kernel) < %{symfony_max_ver} +Requires: php-composer(symfony/http-kernel) >= %{symfony_min_ver} +Requires: php-composer(symfony/proxy-manager-bridge) < %{symfony_max_ver} +Requires: php-composer(symfony/proxy-manager-bridge) >= %{symfony_min_ver} +Requires: php-composer(symfony/config) < %{symfony_max_ver} +Requires: php-composer(symfony/config) >= %{symfony_min_ver} +%endif +# phpcompatinfo (computed from version 3.0.0) +Requires: php(language) >= %{php_min_ver} # Autoloader Requires: php-composer(fedora/autoloader) @@ -83,7 +125,7 @@ Autoloader: %{phpdir}/DI/Bridge/Symfony/autoload.php %setup -qn %{github_name}-%{github_commit} : Create autoloader -cat <<'AUTOLOAD' | tee src/DI/Bridge/Symfony/autoload.php +cat <<'AUTOLOAD' | tee src/autoload.php <?php /** * Autoloader for %{name} and its' dependencies @@ -95,11 +137,22 @@ require_once '%{phpdir}/Fedora/Autoloader/autoload.php'; \Fedora\Autoloader\Autoload::addPsr4('DI\\Bridge\\Symfony\\', __DIR__); -\Fedora\Autoloader\Dependencies::required(array( +\Fedora\Autoloader\Dependencies::required([ '%{phpdir}/DI/autoload.php', - '%{phpdir}/Symfony/Component/DependencyInjection/autoload.php', -)); - + [ + '%{phpdir}/Symfony4/Component/DependencyInjection/autoload.php', + '%{phpdir}/Symfony3/Component/DependencyInjection/autoload.php', + ], [ + '%{phpdir}/Symfony4/Component/HttpKernel/autoload.php', + '%{phpdir}/Symfony3/Component/HttpKernel/autoload.php', + ], [ + '%{phpdir}/Symfony4/Bridge/ProxyManager/autoload.php', + '%{phpdir}/Symfony3/Bridge/ProxyManager/autoload.php', + ], [ + '%{phpdir}/Symfony4/Component/Config/autoload.php', + '%{phpdir}/Symfony3/Component/Config/autoload.php', + ], +]); AUTOLOAD @@ -108,8 +161,8 @@ AUTOLOAD %install -mkdir -p %{buildroot}%{phpdir} -cp -rp src/* %{buildroot}%{phpdir}/ +mkdir -p %{buildroot}%{phpdir}/DI/Bridge +cp -rp src %{buildroot}%{phpdir}/DI/Bridge/Symfony %check @@ -118,16 +171,34 @@ cp -rp src/* %{buildroot}%{phpdir}/ cat <<'BOOTSTRAP' | tee bootstrap.php <?php require_once '%{buildroot}%{phpdir}/DI/Bridge/Symfony/autoload.php'; -\Fedora\Autoloader\Autoload::addPsr0('FunctionalTest\\DI\\Bridge\\Symfony\\', __DIR__.'/tests'); -\Fedora\Autoloader\Autoload::addPsr0('UnitTest\\DI\\Bridge\\Symfony\\', __DIR__.'/tests'); +\Fedora\Autoloader\Autoload::addPsr4('DI\\Bridge\\Symfony\\Test\\', __DIR__.'/tests'); +\Fedora\Autoloader\Dependencies::required([ + [ + '%{phpdir}/Symfony4/Component/Filesystem/autoload.php', + '%{phpdir}/Symfony3/Component/Filesystem/autoload.php', + ], [ + '%{phpdir}/Symfony4/Component/Yaml/autoload.php', + '%{phpdir}/Symfony3/Component/Yaml/autoload.php', + ], [ + '%{phpdir}/Symfony4/Component/Config/autoload.php', + '%{phpdir}/Symfony3/Component/Config/autoload.php', + ], +]); BOOTSTRAP +# TODO investigate on symfonyGetInPHPDI failure + : Run tests -for cmd in php php56 php70 php71 php72; do +ret=0 +for cmd in php php71 php72 php73 php74; do if which $cmd; then - $cmd %{_bindir}/phpunit --verbose --bootstrap bootstrap.php + $cmd %{_bindir}/phpunit \ + --filter '^((?!(symfonyGetInPHPDI)).)*$' \ + --bootstrap bootstrap.php \ + --verbose || ret=1 fi done +exit $ret %else : Tests skipped %endif @@ -143,6 +214,14 @@ done %changelog +* Mon Jun 17 2019 Remi Collet <remi@remirepo.net> - 3.0.0-1 +- update to 3.0.0 +- add dependency on symfony/http-kernel +- add dependency on symfony/proxy-manager-bridge +- add dependency on symfony/config +- switch from Symfony 2 to Sypmfony 3 or 4 +- raise dependency on php-di 6.0 + * Wed May 10 2017 Remi Collet <remi@remirepo.net> - 1.1.0-5 - add max version to build dependencies - run test suite against PHP SCLs when available |