ZFConf 2012: Dependency Management в PHP и Zend Framework 2 (Кирилл Чебунин)

  • 1,890 views
Uploaded on

http://www.zfconf.ru/2012/talks/dependency-management-in-php-and-zend-framework-2/

http://www.zfconf.ru/2012/talks/dependency-management-in-php-and-zend-framework-2/

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
1,890
On Slideshare
0
From Embeds
0
Number of Embeds
1

Actions

Shares
Downloads
28
Comments
0
Likes
1

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Dependency PHPManagement Zend Framework 2 Kirill chEbba Chebunin Creara
  • 2. Actual PHP Problems  Code Quality − Design Patterns  Standards − PSR  Complete Solutions − Libraries − Modules, Bundles, Plugins − ToolsZFConf 2012 (c) Kirill chEbba Chebunin
  • 3. Dependency ManagementZFConf 2012 (c) Kirill chEbba Chebunin
  • 4. The ProblemZFConf 2012 (c) Kirill chEbba Chebunin
  • 5. The ProblemZFConf 2012 (c) Kirill chEbba Chebunin
  • 6. The ProblemZFConf 2012 (c) Kirill chEbba Chebunin
  • 7. Solutions  Python: easy_install, pip  Ruby: gems  Java: maven, ivy  C#(.NET): NuGet, NuPack  PHP: PEAR/PyrusZFConf 2012 (c) Kirill chEbba Chebunin
  • 8. Solutions. PHP Frameworks  Symfony2 − Git Submodules − bin/vendors − Composer  Zend Framework2 − Pyrus − Modules?ZFConf 2012 (c) Kirill chEbba Chebunin
  • 9. ComposerZFConf 2012 (c) Kirill chEbba Chebunin
  • 10. Composer  PEAR. Why NOT?  Composer. Why? − Created for Dependency management − Separate storage & Package metadata − Support existing infrastructure − Dist & Source − Extendable − Autoload SupportZFConf 2012 (c) Kirill chEbba Chebunin
  • 11. Composer. Architecture  Package  Repository – package meta data − Composer, Pear, VCS, etc  Downloader − Archive, VCS, Pear  Installer − Library, Project  Autoload − PSR-0, ClassMapZFConf 2012 (c) Kirill chEbba Chebunin
  • 12. ZF2 + ComposerZFConf 2012 (c) Kirill chEbba Chebunin
  • 13. ZF2 + Composer. Pear composer.json "repositories": [ { "type": "pear", "url": "http://packages.zendframework.com" } ]ZFConf 2012 (c) Kirill chEbba Chebunin
  • 14. ZF2 + Composer. Pear "require": { "php": ">=5.3.2", "pear-zf2/Zend_Mvc": "2.0.0beta3", "pear-zf2/Zend_Di": "2.0.0beta3", "pear-zf2/Zend_Code": "2.0.0beta3", "pear-zf2/Zend_Config": "2.0.0beta3", "pear-zf2/Zend_EventManager": "2.0.0beta3", "pear-zf2/Zend_Filter": "2.0.0beta3", "pear-zf2/Zend_Http": "2.0.0beta3", "pear-zf2/Zend_Loader": "2.0.0beta3", "pear-zf2/Zend_Module": "2.0.0beta3", "pear-zf2/Zend_Registry": "2.0.0beta3", "pear-zf2/Zend_Stdlib": "2.0.0beta3", "pear-zf2/Zend_Uri": "2.0.0beta3", "pear-zf2/Zend_Validator": "2.0.0beta3", "pear-zf2/Zend_View": "2.0.0beta3" }ZFConf 2012 (c) Kirill chEbba Chebunin
  • 15. ZF2 + Composer. Pear public/index.php //require_once //(getenv(ZF2_PATH) ?: vendor/ZendFramework/library) // ./Zend/Loader/AutoloaderFactory.php; //ZendLoaderAutoloaderFactory::factory(); require_once vendor/.composer/autoload.php;ZFConf 2012 (c) Kirill chEbba Chebunin
  • 16. ZF2 + Composer. Pear /path/to/project$ composer installZFConf 2012 (c) Kirill chEbba Chebunin
  • 17. ZF2 + Composer. PearZFConf 2012 (c) Kirill chEbba Chebunin
  • 18. ZF2 + Composer. Pear Problems:  Missed dependencies in zf2 channel  Missed versions in zf2 channel  No package groups support in Composer Zend_Framework#StandardZFConf 2012 (c) Kirill chEbba Chebunin
  • 19. ZF2 + Composer. Composercomposer.json"repositories": [ { "type": "composer", "url": "https://raw.github.com/chEbba/Zf2Composer/master" }]ZFConf 2012 (c) Kirill chEbba Chebunin
  • 20. ZF2 + Composer. Composer "require": { "php": ">=5.3.2", "pear-zf2/Zend_Mvc": "2.0.0beta3", "pear-zf2/Zend_EventManager": "2.0.0beta3", "pear-zf2/Zend_Module": "2.0.0beta3", "pear-zf2/Zend_View": "2.0.0beta3" }ZFConf 2012 (c) Kirill chEbba Chebunin
  • 21. ZF2 + Composer. ComposerZFConf 2012 (c) Kirill chEbba Chebunin
  • 22. ZF2 + Composer. ModuleZFConf 2012 (c) Kirill chEbba Chebunin
  • 23. ZF2 + Composer. Modulecomposer.json "name": "zendframework/zend-developer-tools", "description": "ZF2 module for developer and debug tools.", "keywords": ["zend", "zf", "module", "developer", "tools"], "homepage": "https://github.com/zendframework/ZendDeveloperTools", "type": "library", "license": "New BSD License", "authors": [ { "name": "Zend Technologies USA", "email": "info@zendframework.com", "homepage": "http://zendframework.com" } ],ZFConf 2012 (c) Kirill chEbba Chebunin
  • 24. ZF2 + Composer. Modulecomposer.json "name": "zendframework/zend-developer-tools", "description": "ZF2 module for developer and debug tools.", "keywords": ["zend", "zf", "module", "developer", "tools"], "homepage": "https://github.com/zendframework/ZendDeveloperTools", "type": "library", "license": "New BSD License", "authors": [ { "name": "Zend Technologies USA", "email": "info@zendframework.com", "homepage": "http://zendframework.com" } ],ZFConf 2012 (c) Kirill chEbba Chebunin
  • 25. ZF2 + Composer. Module "version": "1.0.0-pr1", "require":{ "php":">=5.3.2", "pear-zf2/zend_mvc": "2.0.0beta3", "pear-zf2/zend_eventmanager": "2.0.0beta3", "pear-zf2/zend_http": "2.0.0beta3", "pear-zf2/zend_stdlib": "2.0.0beta3", "pear-zf2/zend_view": "2.0.0beta3" }, "autoload":{ "classmap":[""] }ZFConf 2012 (c) Kirill chEbba Chebunin
  • 26. ZF2 + Composer. Modulehttp://packagist.org/packages/submitZFConf 2012 (c) Kirill chEbba Chebunin
  • 27. ZF2 + Composer. Modulecomposer.json"require": { "php": ">=5.3.2", "pear-zf2/Zend_Mvc": "2.0.0beta3", "pear-zf2/Zend_EventManager": "2.0.0beta3", "pear-zf2/Zend_Module": "2.0.0beta3", "pear-zf2/Zend_View": "2.0.0beta3", "zendframework/zend_developer_tools": "1.0.0-alpha1"}ZFConf 2012 (c) Kirill chEbba Chebunin
  • 28. ZF2 + Composer. Moduleapplication.config.php modules => array( Application, ZendDeveloperTools )ZFConf 2012 (c) Kirill chEbba Chebunin
  • 29. ZF2 + Composer. Pear /path/to/project$ composer updateZFConf 2012 (c) Kirill chEbba Chebunin
  • 30. ZF2 + Composer. ComposerZFConf 2012 (c) Kirill chEbba Chebunin
  • 31. Links  https://github.com/chEbba/Zf2Composer/  https://github.com/zendframework/ZendSkeletonApplication/  https://github.com/zendframework/ZendDeveloperTools/  https://github.com/stefankleff/ZendDeveloperTools/  http://getcomposer.org/  http://packagist.org/  http://packages.zendframework.com/  http://modules.zendframework.com/ZFConf 2012 (c) Kirill chEbba Chebunin
  • 32. Questions? Use Complete Solutions, BITCH! Github: chEbba Twitter: @iamchEbba Mail: iam@chebba.org Made by CoylZFConf 2012 (c) Kirill chEbba Chebunin