GETTING STARTED
5
PIMCORE5–GETTINGSTARTED
Pimcore 5
=
(Pimcore 4 - Zend Framework 1)
+
(Symfony 3 + E-Commerce Framework)
Why Symfony instead of ZF 3?
PIMCORE5–GETTINGSTARTED
• State-of-the-art
• Long-term Support (backward compatibility promise)
• Active Development
• Huge Community / 3rd Party-Tools & Integrations
• Configuration, Dependency Injection / Container
• Event-Driven
• Wide-spread, eg. Drupal, ez Publish, …
New Folder Structure
PIMCORE5–GETTINGSTARTED
• /app/ - Configs, Templates
• /bin/ - Executable Files (eg. /bin/console)
• /pimcore/ - Pimcore Files
• /src/ - Project Code (Controller, Services, Models, …)
• /var/ - Generated Files (not public – Symfony-Cache, Versions, …)
• /vendor/ - 3rd-Party Dependencies
• /web/ - Document – Root (Statics, Assets, …)
Differences in the Folder Structure
PIMCORE5–GETTINGSTARTED
• Project is located outside the Document-Root
• Everything that should be available via HTTP, has to be in /web/
• /static/is now /web/static/Trennung zwischen /var/ (private) und
/web/var/ (public)
• /website/ is now /app/and /src/
• /src/can contain any PSR-4 compliant classes
z.B. AppBundle and YourCompany
• Contains everything that used to be in /website/lib , /website/models and
/website/controllers
• CLI as Commands or scripts in /bin/
Symfony MVC - Overview
PIMCORE5–GETTINGSTARTED
• Event-Driven | Logic in Event Listeners
• Adjustable Routing (Config, Annotation, Dynamic, …)
• Flexible but very abstract
Controller / Action Differences
PIMCORE5–GETTINGSTARTED
• Controller can by any callable
• Default is AppBundleController... in /src/ folder
• Context-information are provided as arguments
• eg. request object, additional by argument resolver (eg. dokument)
• Per request / partial dedicated view instance
• View renderer and view model are separated
• Hooks in dispatch process are events (-> event-driven)
• Convenience functions by parent class or traits
• awesome_test|foo-bar => AwesomeTest|fooBar
Controller Example
PIMCORE5–GETTINGSTARTED
Template Differerences
PIMCORE5–GETTINGSTARTED
• Templates are located in /app/Resources/views/
• Flexible Templating: PHP (incl. Zend-Style) + Twig
• File structure: Controller/action.html.php
• Layout – concept (inheritance)
• Area-bricks (XML replaced by PHP class)
• Templating helpers
• PhpDoc annotations
Template Examples
PIMCORE5–GETTINGSTARTED
Templates – Area Example
PIMCORE5–GETTINGSTARTED
Bundles aka Extensions
PIMCORE5–GETTINGSTARTED
• Pimcore Bundle = Symfony Bundle + additional Helpers
• Composer or in /src/ (z.B. Project-specific)
• Much more possibilities as in version 4
• Config
• Routing
• Controllers / Templates / Commands / AreaBlocks
• EventListeners / Handlers + Services
• Extending
• Public Assets in AwesomeBundle/Resources/public
Command asset:install links files to /web/bundles/awesome
Good to know …
PIMCORE5–GETTINGSTARTED
• Better support of different environments (test, dev, prod)
• Doctrine DBAL
• Swiftmailer
• PHP 7.0
Migration from v4 to v5
PIMCORE5–GETTINGSTARTED
• Manually + supported by tools
• Controller
• Views / Bricks
• Zend_ has to be replaced
(in some cases there are compatible replacements)
• Compatibility Bridge runs v4 code in v5 environment
• Database structure remains almost untouched

Pimcore Webinar #1

  • 1.
  • 2.
    PIMCORE5–GETTINGSTARTED Pimcore 5 = (Pimcore 4- Zend Framework 1) + (Symfony 3 + E-Commerce Framework)
  • 3.
    Why Symfony insteadof ZF 3? PIMCORE5–GETTINGSTARTED • State-of-the-art • Long-term Support (backward compatibility promise) • Active Development • Huge Community / 3rd Party-Tools & Integrations • Configuration, Dependency Injection / Container • Event-Driven • Wide-spread, eg. Drupal, ez Publish, …
  • 4.
    New Folder Structure PIMCORE5–GETTINGSTARTED •/app/ - Configs, Templates • /bin/ - Executable Files (eg. /bin/console) • /pimcore/ - Pimcore Files • /src/ - Project Code (Controller, Services, Models, …) • /var/ - Generated Files (not public – Symfony-Cache, Versions, …) • /vendor/ - 3rd-Party Dependencies • /web/ - Document – Root (Statics, Assets, …)
  • 5.
    Differences in theFolder Structure PIMCORE5–GETTINGSTARTED • Project is located outside the Document-Root • Everything that should be available via HTTP, has to be in /web/ • /static/is now /web/static/Trennung zwischen /var/ (private) und /web/var/ (public) • /website/ is now /app/and /src/ • /src/can contain any PSR-4 compliant classes z.B. AppBundle and YourCompany • Contains everything that used to be in /website/lib , /website/models and /website/controllers • CLI as Commands or scripts in /bin/
  • 6.
    Symfony MVC -Overview PIMCORE5–GETTINGSTARTED • Event-Driven | Logic in Event Listeners • Adjustable Routing (Config, Annotation, Dynamic, …) • Flexible but very abstract
  • 7.
    Controller / ActionDifferences PIMCORE5–GETTINGSTARTED • Controller can by any callable • Default is AppBundleController... in /src/ folder • Context-information are provided as arguments • eg. request object, additional by argument resolver (eg. dokument) • Per request / partial dedicated view instance • View renderer and view model are separated • Hooks in dispatch process are events (-> event-driven) • Convenience functions by parent class or traits • awesome_test|foo-bar => AwesomeTest|fooBar
  • 8.
  • 9.
    Template Differerences PIMCORE5–GETTINGSTARTED • Templatesare located in /app/Resources/views/ • Flexible Templating: PHP (incl. Zend-Style) + Twig • File structure: Controller/action.html.php • Layout – concept (inheritance) • Area-bricks (XML replaced by PHP class) • Templating helpers • PhpDoc annotations
  • 10.
  • 11.
    Templates – AreaExample PIMCORE5–GETTINGSTARTED
  • 12.
    Bundles aka Extensions PIMCORE5–GETTINGSTARTED •Pimcore Bundle = Symfony Bundle + additional Helpers • Composer or in /src/ (z.B. Project-specific) • Much more possibilities as in version 4 • Config • Routing • Controllers / Templates / Commands / AreaBlocks • EventListeners / Handlers + Services • Extending • Public Assets in AwesomeBundle/Resources/public Command asset:install links files to /web/bundles/awesome
  • 13.
    Good to know… PIMCORE5–GETTINGSTARTED • Better support of different environments (test, dev, prod) • Doctrine DBAL • Swiftmailer • PHP 7.0
  • 14.
    Migration from v4to v5 PIMCORE5–GETTINGSTARTED • Manually + supported by tools • Controller • Views / Bricks • Zend_ has to be replaced (in some cases there are compatible replacements) • Compatibility Bridge runs v4 code in v5 environment • Database structure remains almost untouched