Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Minor bugfix: Added missing composer dependency (ServiceManager) to Math package #5186

Closed
wants to merge 1 commit into from

3 participants

@dol

The Zend\Math package uses the ServiceManager. But the composer.json requirements don't define this dependency.
This PR fixes this issue.

@samsonasik

I think it should be on 'suggest' dependency. We still can use Zend\Math\BigInteger\Adapter\Bcmath directly.

@dol

I agree, that you could use Zend\Math\BigInteger\Adapter\Bcmath directly. The convenience of BigIntiger::factory() and the build-in Zend\ServiceMangager\AbstractPluginManager is that you don't have to decide witch adapter to use.
Without the ServiceManager dependency I have to duplicate the code of decision making of using Zend\Math\BigInteger\Adapter\Bcmath or Zend\Math\BigInteger\Adapter\Gmp.
I'd like to use this package for a math project and I don't want to deal with different calculation adapters. The missing dependency blocks me from using this package.
The examples in the ZF2 documentation won't work out of the box without the ServiceManager.

I would rather add ext-bcmath and ext-gmp (e.g) to the 'suggest' section.

Btw:
There was recently a poll on the composer-dev mailinglist about the 'suggest' section and when to display.

@samsonasik

ok, so it up to the zf maintainer to agree or not :). btw, i think 'component' is the better word than 'module' :D

@dol

@samsonasik Thanks you for the critics about this issue. A second opinion is always good. btw: I changed the title from 'module' to 'package' due the naming taken from here.

@weierophinney

@dol I agree with @samsonasik here -- this is a suggested dependency, not a required dependency, as you can use selected functionality from the component without the ServiceManager package installed. While I understand that the examples in the doc will not work without the SM, the documentation also typically assumes you've installed the entire framework.

Change the package to a suggestion, and add in the string "if using the BigInteger::factory functionality". I'd also add "ext-bcmath" and "ext-gmp" as suggestions.

@weierophinney weierophinney referenced this pull request from a commit
@weierophinney weierophinney [#5186] incorporate feedback
- Moved servicemanager to suggested dependency
- Added ext-bcmath and ext-gmp as suggested dependencies
962b960
@weierophinney weierophinney referenced this pull request from a commit
@weierophinney weierophinney Merge branch 'hotfix/5186' into develop
Forward port #5186

Conflicts:
	library/Zend/Math/composer.json
e3d69f2
@weierophinney weierophinney was assigned
@dol dol deleted the dol:bugfix/missing-servicemanager-dependency branch
@ThaDafinser ThaDafinser referenced this pull request from a commit in ThaDafinser/zf2
@weierophinney weierophinney [#5186] incorporate feedback
- Moved servicemanager to suggested dependency
- Added ext-bcmath and ext-gmp as suggested dependencies
6dff8e8
@weierophinney weierophinney referenced this pull request from a commit in zendframework/zend-math
@weierophinney weierophinney Merge pull request zendframework/zf2#5186 from dol/bugfix/missing-ser…
…vicemanager-dependency

Minor bugfix: Added missing composer dependency (ServiceManager) to Math package
44e86e0
@weierophinney weierophinney referenced this pull request from a commit in zendframework/zend-math
@weierophinney weierophinney [zendframework/zf2#5186] incorporate feedback
- Moved servicemanager to suggested dependency
- Added ext-bcmath and ext-gmp as suggested dependencies
41762b2
@weierophinney weierophinney referenced this pull request from a commit in zendframework/zend-math
@weierophinney weierophinney Merge branch 'hotfix/5186' into develop
Forward port zendframework/zf2#5186

Conflicts:
	library/Zend/Math/composer.json
7bb5679
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 1 deletion.
  1. +2 −1  library/Zend/Math/composer.json
View
3  library/Zend/Math/composer.json
@@ -13,7 +13,8 @@
},
"target-dir": "Zend/Math",
"require": {
- "php": ">=5.3.3"
+ "php": ">=5.3.3",
+ "zendframework/zend-servicemanager": "self.version"
},
"suggest": {
"ircmaxell/random-lib": "Fallback random byte generator for Zend\\Math\\Rand if OpenSSL/Mcrypt extensions are unavailable"
Something went wrong with that request. Please try again.