7

I try to install zf2 component using composer but can't do it because composer always download all framework, what am i doing wrong?

Composer version 1beccf9

{
 ...
"repositories": [
 {
   "type": "composer",
   "url": "http://packages.zendframework.com/"
 }
 ],
"require": {
  "zendframework/zend-http" : "2.0.*"
 }
}
Charles
  • 50,943
  • 13
  • 104
  • 142
x4nder
  • 89
  • 4

2 Answers2

5

I enabled php_intl extension and that solved the problem

  • As unrelated as it sounds, this does indeed work. I am using the zend-http package, which does depend on zend-i18n, amongst other things. – jmalloc Mar 13 '13 at 03:23
  • This also worked for me. @weierophinney I think this might help you reproduce if you're still unable to? – ezzatron Mar 13 '13 at 03:32
  • Possible cause: [zendframework/zend-i18n](https://packagist.org/packages/zendframework/zend-i18n) requires `ext-intl` in its Composer config, but [zendframework/zendframework](https://packagist.org/packages/zendframework/zendframework) does not. Because the Composer config for the framework specifies that it 'replaces' the i18n component, Composer sees this as a way to get the i18n component installed for systems where the user does not have ext-intl. Possible solution: add `ext-intl` as a requirement of the framework, or change it to a suggestion in the i18n component. – ezzatron Mar 13 '13 at 04:23
1

I cannot reproduce the issue. I have tried with both the "http" and "https" schema, and in both cases, received only the zend-http package and its dependencies. The only possible issue I can see is that if you're not using the "https" schema, and do not have openssl compiled into your PHP version, it's possible that Composer is unable to reach our repository, and thus defaults to the packagist repository, which will only ever give you the full ZF distribution.

weierophinney
  • 1,790
  • 9
  • 17
  • Strangely because ofcourse i tried to use "https" scheme too. local phpinfo() says that i have "OpenSSL support enabled" "OpenSSL Library Version OpenSSL 1.0.0e 6 Sep 2011" "OpenSSL Header Version OpenSSL 0.9.8r 8 Feb 2011" – x4nder Jan 16 '13 at 20:16
  • i forgot to say that i using composer on windows platform may be it matter – x4nder Jan 16 '13 at 20:28
  • Mini composer log "Loading composer repositories with package information Installing dependencies - Installing zendframework/zendframework (2.0.6) Loading from cache" – x4nder Jan 16 '13 at 20:31
  • @AlexanderStrigin you do run a composer **install** on an empty project (ie no `composer.lock`) or you do the **update**? Cache might sound like there is something wrong locally and you tried it to do first without the repository (so it fetches from packagist) and then you do it with the repository (and it doesn't work since the info is cached). Try to clean up all the things (vendor dir and lock file), does the problem retain? – Jurian Sluiman Jan 16 '13 at 20:46
  • i remove vendor dir and .lock file every times. – x4nder Jan 16 '13 at 20:53
  • I get the same behavior as OP using Ubuntu 12.04: fresh composer.phar; remove `composer.lock`, `vendor/`, and `~/.composer/`; `php composer.phar install`. Result: get full zf2 framework. ;-( – David Weinraub Jan 17 '13 at 14:37
  • I worked with papayasoft on IRC quite a bit last week; at this point, I have to direct you to the composer devs, as I was unable to reproduce the issue using the exact same revision of composer with any of 4 different php versions from both the 5.3 and 5.4 series. – weierophinney Jan 20 '13 at 19:08
  • Same behaviour here, also on Ubuntu 12.04 with a fresh install. – el.atomo Jan 31 '13 at 21:14