diff options
-rw-r--r-- | composer.json | 10 | ||||
-rw-r--r-- | php-mongodb-autoload.php | 15 | ||||
-rw-r--r-- | php-mongodb.spec | 30 |
3 files changed, 27 insertions, 28 deletions
diff --git a/composer.json b/composer.json index 259835f..61ff3b1 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,10 @@ ], "require": { "php": ">=5.4", - "ext-mongodb": "^1.1.0" + "ext-mongodb": "^1.2.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8" }, "autoload": { "psr-4": { "MongoDB\\": "src/" }, @@ -19,5 +22,10 @@ }, "autoload-dev": { "psr-4": { "MongoDB\\Tests\\": "tests/" } + }, + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } } } diff --git a/php-mongodb-autoload.php b/php-mongodb-autoload.php index 4cf36b9..6381225 100644 --- a/php-mongodb-autoload.php +++ b/php-mongodb-autoload.php @@ -1,17 +1,6 @@ <?php /* Autoloader for mongodb/mongodb and its dependencies */ -$vendorDir = '/usr/share/php'; -// Use Symfony autoloader -if (!isset($fedoraClassLoader) || !($fedoraClassLoader instanceof \Symfony\Component\ClassLoader\ClassLoader)) { - if (!class_exists('Symfony\\Component\\ClassLoader\\ClassLoader', false)) { - require_once $vendorDir . '/Symfony/Component/ClassLoader/ClassLoader.php'; - } - - $fedoraClassLoader = new \Symfony\Component\ClassLoader\ClassLoader(); - $fedoraClassLoader->register(); -} - -$fedoraClassLoader->addPrefix('MongoDB\\', dirname(__DIR__)); - +require_once '/usr/share/php/Fedora/Autoloader/autoload.php'; +\Fedora\Autoloader\Autoload::addPsr4('MongoDB\\', __DIR__); require_once __DIR__. '/functions.php'; diff --git a/php-mongodb.spec b/php-mongodb.spec index 3d64f0f..97de0e6 100644 --- a/php-mongodb.spec +++ b/php-mongodb.spec @@ -6,7 +6,7 @@ # # Please, preserve the changelog entries # -%global gh_commit 302de20d8302183e1c70b335d81798cec5bcebd4 +%global gh_commit 9dfb2c5fc917d7438b44eb8f4d247ba3e3984e75 %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) %global gh_owner mongodb #global gh_date 20151102 @@ -22,7 +22,7 @@ #global prever beta2 Name: php-%{gh_owner} -Version: 1.0.4 +Version: 1.1.0 %if 0%{?gh_date} Release: 0.2.%{gh_date}git%{gh_short}%{?dist} %else @@ -45,22 +45,24 @@ BuildRequires: php(language) >= 5.4 BuildRequires: php-reflection BuildRequires: php-spl BuildRequires: php-pecl(mongodb) -BuildRequires: php-composer(phpunit/phpunit) BuildRequires: mongodb-server >= 2.4 +# From composer.json, "require-dev": { +# "phpunit/phpunit": "^4.8" +BuildRequires: php-composer(phpunit/phpunit) >= 4.8 # For autoloader -BuildRequires: php-composer(symfony/class-loader) +BuildRequires: php-composer(fedora/autoloader) %endif # From composer.json, "require": { # "php": ">=5.4" -# "ext-mongodb": "^1.1.0" +# "ext-mongodb": "^1.2.0" Requires: php(language) >= 5.4 -Requires: php-pecl(mongodb) >= 1.1.0 +Requires: php-pecl(mongodb) >= 1.2.0 # From phpcompatinfo report for 1.0.0alpha1 Requires: php-reflection Requires: php-spl # For autoloader -Requires: php-composer(symfony/class-loader) +Requires: php-composer(fedora/autoloader) # Composer Provides: php-composer(%{gh_owner}/%{gh_owner}) = %{version}%{?prever} @@ -116,12 +118,8 @@ cat << 'EOF' | tee tests/bootstrap.php <?php // Library require_once '%{buildroot}%{_datadir}/php/%{psr0}/autoload.php'; - // Test suite -require_once '%{_datadir}/php/Symfony/Component/ClassLoader/Psr4ClassLoader.php'; -$Loader = new \Symfony\Component\ClassLoader\Psr4ClassLoader(); -$Loader->addPrefix("MongoDB\\Tests\\", __DIR__); -$Loader->register(); +\Fedora\Autoloader\Autoload::addPsr4('MongoDB\\Tests\\', __DIR__); EOF : Run the test suite @@ -159,13 +157,17 @@ rm -rf %{buildroot} %{!?_licensedir:%global license %%doc} %license LICENSE %doc composer.json -%doc README.md -%doc RELEASE-* +%doc *.md %doc docs %{_datadir}/php/%{psr0} %changelog +* Wed Dec 7 2016 Remi Collet <remi@fedoraproject.org> - 1.1.0-1 +- update to 1.1.0 +- raise dependency on php-pecl-mongodb 1.2.0 +- switch to fedora/autoloader + * Tue Dec 6 2016 Remi Collet <remi@fedoraproject.org> - 1.0.4-1 - update to 1.0.4 |