Installing the ZF2 Composition Packs (Zend Framework 2)

when you use the zend skeleton to launch a new project and the composer to install packages, he recommends this:

"doctrine/common": "Doctrine\\Common >=2.1 for annotation features", "ext-intl": "ext/intl for i18n features", "pecl-weakref": "Implementation of weak references for Zend\\Stdlib\\CallbackHandler", "zendframework/zendpdf": "ZendPdf for creating PDF representations of barcodes", "zendframework/zendservice-recaptcha": "ZendService\\ReCaptcha for rendering ReCaptchas in Zend\\Captcha and/or Zend\\Form" 

I could install zendpdf, zendservice-recaptcha and doctine / common package, but not PECL.

It seems a little sad to me that zf2 offers packages, but leaves users alone how to properly configure the .json composer.

I heard that the composer can also receive PECL packages, but could not find any documentation on it.

How to install them?

+7
source share
1 answer

To install the suggested packages, modify composer.json to include them.

 "repositories": [ { "type": "composer", "url": "http://packages.zendframework.com/" } ], "require": { "php": ">=5.3.3", "zendframework/zendframework": "2.*", "doctrine/common": "dev-master", "zendframework/zendpdf": "2.*", "zendframework/zendservice-recaptcha": "2.*" } 

Then run

 php composer.phar update 

Note: this composer installs doctrine / common with

 git clone http://github.com/doctrine/common 

On Windows git, the PATH environment variable must be specified.

As for ext / intl, this extension is associated with PHP with PHP version 5.3.0. and can be found in the ext / folder of your php installation. [one]

To enable, uncomment (delete the half-column before the directive) in php.ini

 extension=php_intl.dll 

As for pecl-weakref, it is also a PHP extension, but it is not php related and should be installed. More information on how to do this can be found at http://php.net/manual/en/install.pecl.php

The DLL for this PECL extension is currently unavailable. See Also based on the Windows section. [4]

[1] http://php.net/manual/en/intl.requirements.php

[2] http://php.net/manual/en/weakref.installation.php

[3] http://php.net/manual/en/install.pecl.intro.php

[4] http://php.net/manual/en/install.pecl.windows.php

+10
source

All Articles