SlideShare a Scribd company logo
eZPublish meets Symfony
Gaetano Giunta | phpDay 2013 | 17.5.2013
5/17/2013gg@ez.no Slide 2
Not your grandpa’s CMS
This is not eZ Publish
ANYMORE
5/17/2013gg@ez.no Slide 3
Not your grandpa’s CMS
The drivers
5/17/2013gg@ez.no Slide 5
Why change?
The need to refactor
 Existing codebase is 10 years old 
 High maintenance cost
 Started with no unit tests - singletons everywhere
 Layers and roles not properly defined / documented - interdependencies
 OOP before php had
 Private/protected/static
 Closures
 Namespaces
 Late static binding
 And much more
 Not built for an AJAX and REST world
5/17/2013gg@ez.no Slide 6
Why change?
Everyone loves NEW!
 Existing codebase is 10 years old 
 Widely deployed
 Well debugged
 Pitfalls have mostly been uncovered by now
 Proven to scale
 Well known:
 Documentation improved over years
 Tutorials, forums, blogs, aggregators
 Active community of practitioners
 Official training courses
5/17/2013gg@ez.no Slide 7
Why change?
Do not forget drawbacks
 Focus on our core business
 Experience Management
 Content Management
 NOT Framework maintenance
 Durable Architecture
 API stability
 Battle tested / not (only) the latest trend
 Scalability
 Lively Community!
5/17/2013gg@ez.no Slide 8
Picking a framework for a platform rebuild
• Simple Integration with existing API
• HMVC (Hierarchical Model View Controller) stack
• Decoupled Components
• Dependency Injection
• Good Template Engine
• Extensible, Open, Reliable ;-)
5/17/2013gg@ez.no Slide 9
Prerequisites
• Homebrew
• Zeta Components
• Zend Framework 2
• Symfony 2
5/17/2013gg@ez.no Slide 10
Candidates
5/17/2013gg@ez.no Slide 11
And the winner is…
Title of presentation is a hint, really...
5/17/2013gg@ez.no Slide 12
And the winner is…
5/17/2013gg@ez.no Slide 13
This is eZ Publish 5!
Standard
Symfony2 App.
(=app)
+eZ Publish
bundles
(PHP & REST APIs
+ Legacy)
vendor/
ezsystems/
ezpublish-kernel
+ Full-blown
Back-office
The challenge
Product Management SCRUM Story:
«As an existing user, I don’t want to be pissed off by a new
#@!$% version!»
5/17/2013gg@ez.no Slide 15
Backwards compatibility
(life sucks)
Product Management SCRUM Story:
«As an existing user, I don’t want to be pissed off by a new
#@!$% version!»
• 100% Data Compatible (same DB scheme)
• Possibility to include legacy templates in the new ones
• Routing fallback
• Load legacy content templates with legacy rules
• Settings
• Access Symfony services from legacy modules
5/17/2013gg@ez.no Slide 16
Backwards compatibility: the objectives
Product Management SCRUM Story:
«As an existing user, I don’t want to be pissed off by a new
#@!$% version!»
• 100% Data Compatible (same DB scheme)
• Possibility to include legacy templates in the new ones
• Routing fallback
• Load legacy content templates with legacy rules
• Settings
• Access Symfony services from legacy modules
5/17/2013gg@ez.no Slide 17
Backwards compatibility: the objectives
A new architecture
Product Management SCRUM Story:
«As an existing user, I don’t want to be pissed off by a new
#@!$% version!»
• 100% Data Compatible (same DB scheme)
• Possibility to include legacy templates in the new ones
• Routing fallback
• Load legacy content templates with legacy rules
• Settings
• Access Symfony services from legacy modules
Challenge Accepted
5/17/2013gg@ez.no Slide 19
BC: the challenge
5/17/2013gg@ez.no Slide 20
Dual-core architecture
Where the magic is
Legacy version still works perfectly standalone
5/17/2013gg@ez.no Slide 21
BC: icing on the cake
Taming the beast
 New Core: a standard Simfony app
 Legacy stack isolated in a dedicated
directory
5/17/2013gg@ez.no Slide 23
Refactoring: directory layout
use SymfonyComponentHttpFoundationRequest;
require_once __DIR__ . '/../ezpublish/autoload.php'; // set up class autoloading
require_once __DIR__ . '/../ezpublish/EzPublishKernel.php';
$kernel = new EzPublishKernel( 'dev', true ); // extends the Sf Kernel class
$kernel->loadClassCache(); // a method from parent class
$request = Request::createFromGlobals();
$response = $kernel->handle( $request );
$response->send();
$kernel->terminate( $request, $response );
 The Kernel class wraps the HTTPKernel
 It adds a Service Container
 It allows to register bundles via registerBundles()
5/17/2013gg@ez.no Slide 24
The new frontend controller
Using Symfony HTTP Kernel
 Sandbox legacy code in a closure
 Index.php had to be refactored (from 1100 lines to 20)
 Logic moved to a php class
 Separated environment setup from execution and teardown
 runCallback() sets up the global legacy environment
5/17/2013gg@ez.no Slide 25
Refactoring: bridging Legacy code
The ChainRouter from the Sf CMF project is used
5/17/2013gg@ez.no Slide 26
Routing: seamless integration
 eZ4 had an incomplete REST API
 Only functionality available: reading content
 Based on Zeta Components MVC component
 A new API has been implemented
 Full reading and writing of content is possible
 All “dictionary” data is also available
 Content-type for response can be JSON or XML (with an XSD!)
 Fully restful
 Usage of all HTTP verbs (and then some: PATCH)
 Respect http headers of request (eg: “Accept”)
 HATEOAS: use urls as resource ids
 No separate request handling framework needed: pure Symfony routing
 Bonus points: a client for the REST API, implements the same interfaces exposed
by the local PHP API – network transparency!!!
5/17/2013gg@ez.no Slide 27
REST API
An ongoing story
5/17/2013gg@ez.no Slide 29
Version 5.1 is around the corner
Where to go from here
There’s a few tickets left!
Did I tell you it’s on the sea?
Want to dive in?
5/17/2013gg@ez.no Slide 31
 Sf2 book – jolly good looking docs:
http://symfony.com/doc/current/book/index.html
 eZ Publish:
 Community: http://share.ez.no
 Source code: https://github.com/ezsystems
 API docs: http://pubsvn.ez.no/preview.html
 Slides soon on Slideshare
 Contact me: @gggeek, gaetano.giunta@ez.no
THANK YOU
5/17/2013gg@ez.no Slide 32
The usual suspects
5/17/2013gg@ez.no Slide 33
And now for something completely different

More Related Content

PPTX
ASP.NET 5: What's the Big Deal
PDF
Ozone-Wayland Support in Chromium (GENIVI 13th All Member Meeting & AMM Open ...
PPTX
Whats new in .net core 3
PDF
A look at FastCgi & Mod_PHP architecture
PDF
Realtime with websockets
PPTX
Learning ASP.NET 5 and MVC 6
DOCX
Entity framework (EF) 7
PDF
OSGi enRoute Unveiled - P Kriens
ASP.NET 5: What's the Big Deal
Ozone-Wayland Support in Chromium (GENIVI 13th All Member Meeting & AMM Open ...
Whats new in .net core 3
A look at FastCgi & Mod_PHP architecture
Realtime with websockets
Learning ASP.NET 5 and MVC 6
Entity framework (EF) 7
OSGi enRoute Unveiled - P Kriens

What's hot (20)

PDF
Lessons learned from a large scale OSGii web app - P Bakker & J de Vreede
PPTX
ASP.NET 5 Overview
PPTX
Production ready Vert.x
PPTX
Phalcon 2 - PHP Brazil Conference
PPTX
Vertx in production
PPTX
Data Management and Streaming Strategies in Drakensang Online
PPTX
Introduction to ASP.NET 5
PPTX
10 Reasons ColdFusion PDFs should rule the world
PPTX
Introducing ASP.NET vNext - A tour of the new ASP.NET platform
PDF
JBoss Fuse - Fuse workshop EAP container
PDF
ColdFusion builder plugins
PDF
This is how we REST
PDF
REST Servers in Delphi XE Using DataSnap
PDF
Instant ColdFusion with Vagrant
PPTX
C++ on the Web: Run your big 3D game in the browser
PDF
Use Case: Building OSGi Enterprise Applications (QCon 14)
PPTX
Combining HTML5 with MVC framework to simplify realtime collaboration for we...
PDF
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...
PPT
Implementing WebServices with Camel and CXF in ServiceMix
PPTX
Messaging for Web and Mobile with Apache ActiveMQ
Lessons learned from a large scale OSGii web app - P Bakker & J de Vreede
ASP.NET 5 Overview
Production ready Vert.x
Phalcon 2 - PHP Brazil Conference
Vertx in production
Data Management and Streaming Strategies in Drakensang Online
Introduction to ASP.NET 5
10 Reasons ColdFusion PDFs should rule the world
Introducing ASP.NET vNext - A tour of the new ASP.NET platform
JBoss Fuse - Fuse workshop EAP container
ColdFusion builder plugins
This is how we REST
REST Servers in Delphi XE Using DataSnap
Instant ColdFusion with Vagrant
C++ on the Web: Run your big 3D game in the browser
Use Case: Building OSGi Enterprise Applications (QCon 14)
Combining HTML5 with MVC framework to simplify realtime collaboration for we...
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...
Implementing WebServices with Camel and CXF in ServiceMix
Messaging for Web and Mobile with Apache ActiveMQ
Ad

Similar to eZPublish meets Simfony2 - phpDay2013 (20)

PDF
Symfony HTTP Kernel for refactoring legacy apps: the eZ Publish case study - ...
PPTX
Symfony2 for legacy app rejuvenation: the eZ Publish case study
PDF
Ny symfony meetup may 2015
PPTX
Content Management Systems and Refactoring - Drupal, WordPress and eZ Publish
PDF
Symfony and eZ Publish
PDF
eZ Publish Platform 5.4 public webinar
PDF
Unleash your Symfony projects with eZ Platform
PDF
eZ Publish Norwegian Public User Group
PDF
Symfony and eZ Publish: boarding now!
PDF
eZ Publish Platform 5.2 and roadmap
PPTX
Migrating extensions to eZ Publish 5
PDF
Symfony 4.0 + - Track Technique eZ Roadshow 2019 - PARIS
PDF
eZ Publish 5 in depth inspection
PDF
2013.04.23 eZ Sessions 6 - Migrating legacy eZ Publish extensions - Lukasz Se...
PDF
Symfony2 San Francisco Meetup 2009
ODP
An introduction to Symfony 2 for symfony 1 developers
PDF
Symfony presentation
PDF
Symfony 2.0 on PHP 5.3
PDF
Symfony4 - Deep dive
Symfony HTTP Kernel for refactoring legacy apps: the eZ Publish case study - ...
Symfony2 for legacy app rejuvenation: the eZ Publish case study
Ny symfony meetup may 2015
Content Management Systems and Refactoring - Drupal, WordPress and eZ Publish
Symfony and eZ Publish
eZ Publish Platform 5.4 public webinar
Unleash your Symfony projects with eZ Platform
eZ Publish Norwegian Public User Group
Symfony and eZ Publish: boarding now!
eZ Publish Platform 5.2 and roadmap
Migrating extensions to eZ Publish 5
Symfony 4.0 + - Track Technique eZ Roadshow 2019 - PARIS
eZ Publish 5 in depth inspection
2013.04.23 eZ Sessions 6 - Migrating legacy eZ Publish extensions - Lukasz Se...
Symfony2 San Francisco Meetup 2009
An introduction to Symfony 2 for symfony 1 developers
Symfony presentation
Symfony 2.0 on PHP 5.3
Symfony4 - Deep dive
Ad

More from Gaetano Giunta (14)

PDF
php day 2008 - Introduzione agli ez components
PDF
phpday 2006 - SEA case study
PDF
phpday 2006 - WS in PHP
PDF
Powerful Automation Made Simple
PPTX
Managing changes to eZPublish Database
PDF
Symfony vs. Message Brokers
PPTX
Designing a Docker Stack for Symfony apps: lessons learned
PDF
eZ Publish 5: from zero to automated deployment (and no regressions!) in one ...
PPTX
Rabbits, indians and... Symfony meets queueing brokers
PPTX
Making Symfony Services async with RabbitMq (and more Symfony)
PDF
EzPerformancelogger & Graphite
PDF
Ez performance measurement
ODP
Ez Content Staging for the rest of us
ODP
An eZ Publish Craftsman's toolchest
php day 2008 - Introduzione agli ez components
phpday 2006 - SEA case study
phpday 2006 - WS in PHP
Powerful Automation Made Simple
Managing changes to eZPublish Database
Symfony vs. Message Brokers
Designing a Docker Stack for Symfony apps: lessons learned
eZ Publish 5: from zero to automated deployment (and no regressions!) in one ...
Rabbits, indians and... Symfony meets queueing brokers
Making Symfony Services async with RabbitMq (and more Symfony)
EzPerformancelogger & Graphite
Ez performance measurement
Ez Content Staging for the rest of us
An eZ Publish Craftsman's toolchest

Recently uploaded (20)

PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
Accuracy of neural networks in brain wave diagnosis of schizophrenia
PPTX
Machine Learning_overview_presentation.pptx
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
Spectroscopy.pptx food analysis technology
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
A comparative analysis of optical character recognition models for extracting...
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
cuic standard and advanced reporting.pdf
PDF
Getting Started with Data Integration: FME Form 101
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPT
Teaching material agriculture food technology
PPTX
1. Introduction to Computer Programming.pptx
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PDF
MIND Revenue Release Quarter 2 2025 Press Release
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Reach Out and Touch Someone: Haptics and Empathic Computing
Assigned Numbers - 2025 - Bluetooth® Document
Accuracy of neural networks in brain wave diagnosis of schizophrenia
Machine Learning_overview_presentation.pptx
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Spectroscopy.pptx food analysis technology
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
NewMind AI Weekly Chronicles - August'25-Week II
A comparative analysis of optical character recognition models for extracting...
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
cuic standard and advanced reporting.pdf
Getting Started with Data Integration: FME Form 101
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
Diabetes mellitus diagnosis method based random forest with bat algorithm
“AI and Expert System Decision Support & Business Intelligence Systems”
Teaching material agriculture food technology
1. Introduction to Computer Programming.pptx
Group 1 Presentation -Planning and Decision Making .pptx
MIND Revenue Release Quarter 2 2025 Press Release

eZPublish meets Simfony2 - phpDay2013

  • 1. eZPublish meets Symfony Gaetano Giunta | phpDay 2013 | 17.5.2013
  • 2. 5/17/[email protected] Slide 2 Not your grandpa’s CMS
  • 3. This is not eZ Publish ANYMORE 5/17/[email protected] Slide 3 Not your grandpa’s CMS
  • 5. 5/17/[email protected] Slide 5 Why change? The need to refactor
  • 6.  Existing codebase is 10 years old   High maintenance cost  Started with no unit tests - singletons everywhere  Layers and roles not properly defined / documented - interdependencies  OOP before php had  Private/protected/static  Closures  Namespaces  Late static binding  And much more  Not built for an AJAX and REST world 5/17/[email protected] Slide 6 Why change? Everyone loves NEW!
  • 7.  Existing codebase is 10 years old   Widely deployed  Well debugged  Pitfalls have mostly been uncovered by now  Proven to scale  Well known:  Documentation improved over years  Tutorials, forums, blogs, aggregators  Active community of practitioners  Official training courses 5/17/[email protected] Slide 7 Why change? Do not forget drawbacks
  • 8.  Focus on our core business  Experience Management  Content Management  NOT Framework maintenance  Durable Architecture  API stability  Battle tested / not (only) the latest trend  Scalability  Lively Community! 5/17/[email protected] Slide 8 Picking a framework for a platform rebuild
  • 9. • Simple Integration with existing API • HMVC (Hierarchical Model View Controller) stack • Decoupled Components • Dependency Injection • Good Template Engine • Extensible, Open, Reliable ;-) 5/17/[email protected] Slide 9 Prerequisites
  • 10. • Homebrew • Zeta Components • Zend Framework 2 • Symfony 2 5/17/[email protected] Slide 10 Candidates
  • 11. 5/17/[email protected] Slide 11 And the winner is… Title of presentation is a hint, really...
  • 13. 5/17/[email protected] Slide 13 This is eZ Publish 5! Standard Symfony2 App. (=app) +eZ Publish bundles (PHP & REST APIs + Legacy) vendor/ ezsystems/ ezpublish-kernel + Full-blown Back-office
  • 15. Product Management SCRUM Story: «As an existing user, I don’t want to be pissed off by a new #@!$% version!» 5/17/[email protected] Slide 15 Backwards compatibility (life sucks)
  • 16. Product Management SCRUM Story: «As an existing user, I don’t want to be pissed off by a new #@!$% version!» • 100% Data Compatible (same DB scheme) • Possibility to include legacy templates in the new ones • Routing fallback • Load legacy content templates with legacy rules • Settings • Access Symfony services from legacy modules 5/17/[email protected] Slide 16 Backwards compatibility: the objectives
  • 17. Product Management SCRUM Story: «As an existing user, I don’t want to be pissed off by a new #@!$% version!» • 100% Data Compatible (same DB scheme) • Possibility to include legacy templates in the new ones • Routing fallback • Load legacy content templates with legacy rules • Settings • Access Symfony services from legacy modules 5/17/[email protected] Slide 17 Backwards compatibility: the objectives
  • 19. Product Management SCRUM Story: «As an existing user, I don’t want to be pissed off by a new #@!$% version!» • 100% Data Compatible (same DB scheme) • Possibility to include legacy templates in the new ones • Routing fallback • Load legacy content templates with legacy rules • Settings • Access Symfony services from legacy modules Challenge Accepted 5/17/[email protected] Slide 19 BC: the challenge
  • 20. 5/17/[email protected] Slide 20 Dual-core architecture Where the magic is
  • 21. Legacy version still works perfectly standalone 5/17/[email protected] Slide 21 BC: icing on the cake
  • 23.  New Core: a standard Simfony app  Legacy stack isolated in a dedicated directory 5/17/[email protected] Slide 23 Refactoring: directory layout
  • 24. use SymfonyComponentHttpFoundationRequest; require_once __DIR__ . '/../ezpublish/autoload.php'; // set up class autoloading require_once __DIR__ . '/../ezpublish/EzPublishKernel.php'; $kernel = new EzPublishKernel( 'dev', true ); // extends the Sf Kernel class $kernel->loadClassCache(); // a method from parent class $request = Request::createFromGlobals(); $response = $kernel->handle( $request ); $response->send(); $kernel->terminate( $request, $response );  The Kernel class wraps the HTTPKernel  It adds a Service Container  It allows to register bundles via registerBundles() 5/17/[email protected] Slide 24 The new frontend controller Using Symfony HTTP Kernel
  • 25.  Sandbox legacy code in a closure  Index.php had to be refactored (from 1100 lines to 20)  Logic moved to a php class  Separated environment setup from execution and teardown  runCallback() sets up the global legacy environment 5/17/[email protected] Slide 25 Refactoring: bridging Legacy code
  • 26. The ChainRouter from the Sf CMF project is used 5/17/[email protected] Slide 26 Routing: seamless integration
  • 27.  eZ4 had an incomplete REST API  Only functionality available: reading content  Based on Zeta Components MVC component  A new API has been implemented  Full reading and writing of content is possible  All “dictionary” data is also available  Content-type for response can be JSON or XML (with an XSD!)  Fully restful  Usage of all HTTP verbs (and then some: PATCH)  Respect http headers of request (eg: “Accept”)  HATEOAS: use urls as resource ids  No separate request handling framework needed: pure Symfony routing  Bonus points: a client for the REST API, implements the same interfaces exposed by the local PHP API – network transparency!!! 5/17/[email protected] Slide 27 REST API
  • 29. 5/17/[email protected] Slide 29 Version 5.1 is around the corner
  • 30. Where to go from here
  • 31. There’s a few tickets left! Did I tell you it’s on the sea? Want to dive in? 5/17/[email protected] Slide 31
  • 32.  Sf2 book – jolly good looking docs: http://symfony.com/doc/current/book/index.html  eZ Publish:  Community: http://share.ez.no  Source code: https://github.com/ezsystems  API docs: http://pubsvn.ez.no/preview.html  Slides soon on Slideshare  Contact me: @gggeek, [email protected] THANK YOU 5/17/[email protected] Slide 32 The usual suspects
  • 33. 5/17/[email protected] Slide 33 And now for something completely different