Symfony, Oxid, Composer

Embed Size (px)

Citation preview

  1. 1. About me Web Developer since age of 15 28 years old Works @renzel.agentur, Isselburg living in Kleve, NRW loves Guitars and nerdy stuff
  2. 2. Today's session What is Symfony? How can we use Symfony in Oxid? How to use composer in Oxid
  3. 3. SymfonyisasetofPHPComponents,aWeb Applicationframework,aPhilosophy,anda Communityallworkingtogetherin harmony.* *http://symfony.com/de/whatissymfony
  4. 4. Full Stack Web Application Framework Combines the power of Symfony components, into a fully featured Web Framework Rich and 'state of the art' feature set includes: - Full MVC Stack, Dependency Injection, Doctrine ORM Integration, Twig Templating Engine etc. High quality standards and rapid development High performance
  5. 5. Facts & Figures 1.000+ Contributers 300.000+ Symfony developers 1.000.000+ monthly downloads ~21 Core Components ~5.800 Symfony Bundles Base for future OXID development http://symfony.com/de/what-is-symfony http://symfony.com/blog/symfony-2-0 https://packagist.org/packages/list.json?tag=symfony-bundle
  6. 6. + = ?
  7. 7. The Answer: Anything you want it to be
  8. 8. Components provide answers, to common questions How do I crawl the DOM? symfony/dom-crawler How do I parse a YAML file? symfony/yaml How do I validate my forms? symfony/validation How do i write a CLI app with PHP? symfony/console
  9. 9. TheComponentsimplementcommonfeatures neededtodevelopwebsites.Theyarethe foundationoftheSymfonyfullstackframework, buttheycanalsobeusedstandaloneevenifyou don'tusetheframeworkastheydon'thaveany mandatorydependencies.* * http://symfony.com/doc/current/components/index.html
  10. 10. Using in Use Symfony Components to handle common tasks like Config parsing, form validation etc. Wrap common business logic in packages, to keep them reusable Use OXID Modules to wrap your packages
  11. 11. Every symphony starts with it's composition.
  12. 12. Introducing: Composer is a dependency manager for PHP applications Resolves dependencies and keeps them as up to date as you need them Used by symfony to install components and bundles Provides access to thousands of PHP libraries, distrubuted via the packagist package repository Comes with an easy to use autoloader
  13. 13. chl@[email protected]:OXID-eSales/oxideshop_ce.git chl@loki~/oxideshop_ce/source$ll insgesamt184 drwxr-xr-x 2chlchl 4096Apr 914:56admin/ drwxr-xr-x 7chlchl 4096Apr 914:56application/ drwxr-xr-x 2chlchl 4096Apr 914:56bin/ -rw-r--r-- 1chlchl 1635Apr 914:56bootstrap.php -rw-r--r-- 1chlchl 1817Apr 914:56composer.json -rw-r--r-- 1chlchl55650Apr 914:56composer.lock -rw-r--r-- 1chlchl 8173Apr 914:56config.inc.php ... chl@loki~/oxideshop_ce/source$composer.pharrequireacirtautas/oxid-module-internals:0.3.1 ./composer.jsonhasbeenupdated Loadingcomposerrepositorieswithpackageinformation Updatingdependencies(includingrequire-dev) -Installingcomposer/installers(v1.0.21) Downloading:100% -Installingacirtautas/oxid-module-internals(v0.3.1) Downloading:100%
  14. 14. chl@loki~/oxideshop_ce/source/modules/oxid-module-internals$ll insgesamt48 -rw-r--r--1chlchl16700Okt1522:28ac_module_internals.png -rw-r--r--1chlchl 317Okt1522:28composer.json drwxr-xr-x3chlchl 4096Okt1522:28controllers/ drwxr-xr-x2chlchl 4096Okt1522:28core/ -rw-r--r--1chlchl 521Okt1522:28menu.xml -rw-r--r--1chlchl 1586Okt1522:28metadata.php -rw-r--r--1chlchl 517Okt1522:28README.md drwxr-xr-x3chlchl 4096Okt1522:28views/ chl@loki~/oxideshop_ce/source$catcomposer.json { ... "require":{ "acirtautas/oxid-module-internals":"0.3.1" } }
  15. 15. Using composer's autoloader in OXID chl@loki~/oxideshop_ce/source$catmodules/functions.php