SlideShare ist ein Scribd-Unternehmen logo
1 von 33
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Was ist angesagt?

Lessons learned from a large scale OSGii web app - P Bakker & J de Vreede
Lessons learned from a large scale OSGii web app - P Bakker & J de VreedeLessons learned from a large scale OSGii web app - P Bakker & J de Vreede
Lessons learned from a large scale OSGii web app - P Bakker & J de Vreede
mfrancis
 
Combining HTML5 with MVC framework to simplify realtime collaboration for we...
Combining HTML5 with MVC framework to simplify  realtime collaboration for we...Combining HTML5 with MVC framework to simplify  realtime collaboration for we...
Combining HTML5 with MVC framework to simplify realtime collaboration for we...
Gopikrishnan Sasikumar
 
Implementing WebServices with Camel and CXF in ServiceMix
Implementing WebServices with Camel and CXF in ServiceMixImplementing WebServices with Camel and CXF in ServiceMix
Implementing WebServices with Camel and CXF in ServiceMix
Adrian Trenaman
 
Messaging for Web and Mobile with Apache ActiveMQ
Messaging for Web and Mobile with Apache ActiveMQMessaging for Web and Mobile with Apache ActiveMQ
Messaging for Web and Mobile with Apache ActiveMQ
dejanb
 

Was ist angesagt? (20)

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

Ähnlich wie eZPublish meets Simfony2 - phpDay2013

Symfony HTTP Kernel for refactoring legacy apps: the eZ Publish case study - ...
Symfony HTTP Kernel for refactoring legacy apps: the eZ Publish case study - ...Symfony HTTP Kernel for refactoring legacy apps: the eZ Publish case study - ...
Symfony HTTP Kernel for refactoring legacy apps: the eZ Publish case study - ...
Gaetano Giunta
 
Technology Stack Discussion
Technology Stack DiscussionTechnology Stack Discussion
Technology Stack Discussion
Zaiyang Li
 

Ähnlich wie eZPublish meets Simfony2 - phpDay2013 (20)

Symfony HTTP Kernel for refactoring legacy apps: the eZ Publish case study - ...
Symfony HTTP Kernel for refactoring legacy apps: the eZ Publish case study - ...Symfony HTTP Kernel for refactoring legacy apps: the eZ Publish case study - ...
Symfony HTTP Kernel for refactoring legacy apps: the eZ Publish case study - ...
 
Building Restful Web App Rapidly in CakePHP
Building Restful Web App Rapidly in CakePHPBuilding Restful Web App Rapidly in CakePHP
Building Restful Web App Rapidly in CakePHP
 
Rapid Development With CakePHP
Rapid Development With CakePHPRapid Development With CakePHP
Rapid Development With CakePHP
 
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
 
SilverStripe Meetup 03/03/2011
SilverStripe Meetup 03/03/2011SilverStripe Meetup 03/03/2011
SilverStripe Meetup 03/03/2011
 
SilverStripe Meetup Presentation 03/03/2011
SilverStripe Meetup Presentation 03/03/2011SilverStripe Meetup Presentation 03/03/2011
SilverStripe Meetup Presentation 03/03/2011
 
AtoZ about TYPO3 v8 CMS
AtoZ about TYPO3 v8 CMSAtoZ about TYPO3 v8 CMS
AtoZ about TYPO3 v8 CMS
 
Normalizing x pages web development
Normalizing x pages web development Normalizing x pages web development
Normalizing x pages web development
 
Php Frameworks
Php FrameworksPhp Frameworks
Php Frameworks
 
Contract-Based Web Services API Deep Dive
Contract-Based Web Services API Deep DiveContract-Based Web Services API Deep Dive
Contract-Based Web Services API Deep Dive
 
Aurelia intro
Aurelia introAurelia intro
Aurelia intro
 
OSCon - Performance vs Scalability
OSCon - Performance vs ScalabilityOSCon - Performance vs Scalability
OSCon - Performance vs Scalability
 
Technology Stack Discussion
Technology Stack DiscussionTechnology Stack Discussion
Technology Stack Discussion
 
Intro to Salesforce Lightning Web Components (LWC)
Intro to Salesforce Lightning Web Components (LWC)Intro to Salesforce Lightning Web Components (LWC)
Intro to Salesforce Lightning Web Components (LWC)
 
ZZ BC#7.5 asp.net mvc practice and guideline refresh!
ZZ BC#7.5 asp.net mvc practice  and guideline refresh! ZZ BC#7.5 asp.net mvc practice  and guideline refresh!
ZZ BC#7.5 asp.net mvc practice and guideline refresh!
 
Frankenstein's IDE: NetBeans and OSGi
Frankenstein's IDE: NetBeans and OSGiFrankenstein's IDE: NetBeans and OSGi
Frankenstein's IDE: NetBeans and OSGi
 
Fighting legacy with hexagonal architecture and frameworkless php
Fighting legacy with hexagonal architecture and frameworkless phpFighting legacy with hexagonal architecture and frameworkless php
Fighting legacy with hexagonal architecture and frameworkless php
 
Challenges of angular in production (Tasos Bekos) - GreeceJS #17
Challenges of angular in production (Tasos Bekos) - GreeceJS #17Challenges of angular in production (Tasos Bekos) - GreeceJS #17
Challenges of angular in production (Tasos Bekos) - GreeceJS #17
 
They why behind php frameworks
They why behind php frameworksThey why behind php frameworks
They why behind php frameworks
 
Unleash your Symfony projects with eZ Platform
Unleash your Symfony projects with eZ PlatformUnleash your Symfony projects with eZ Platform
Unleash your Symfony projects with eZ Platform
 

Mehr von Gaetano Giunta

Making Symfony Services async with RabbitMq (and more Symfony)
Making Symfony Services async with RabbitMq (and more Symfony)Making Symfony Services async with RabbitMq (and more Symfony)
Making Symfony Services async with RabbitMq (and more Symfony)
Gaetano Giunta
 
EzPerformancelogger & Graphite
EzPerformancelogger & GraphiteEzPerformancelogger & Graphite
EzPerformancelogger & Graphite
Gaetano Giunta
 
Ez Content Staging for the rest of us
Ez Content Staging for the rest of usEz Content Staging for the rest of us
Ez Content Staging for the rest of us
Gaetano Giunta
 
An eZ Publish Craftsman's toolchest
An eZ Publish Craftsman's toolchestAn eZ Publish Craftsman's toolchest
An eZ Publish Craftsman's toolchest
Gaetano Giunta
 

Mehr von Gaetano Giunta (15)

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

Kürzlich hochgeladen

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Kürzlich hochgeladen (20)

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 

eZPublish meets Simfony2 - phpDay2013

  • 1. eZPublish meets Symfony Gaetano Giunta | phpDay 2013 | 17.5.2013
  • 2. 5/17/2013gg@ez.no Slide 2 Not your grandpa’s CMS
  • 3. This is not eZ Publish ANYMORE 5/17/2013gg@ez.no Slide 3 Not your grandpa’s CMS
  • 5. 5/17/2013gg@ez.no 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/2013gg@ez.no 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/2013gg@ez.no 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/2013gg@ez.no 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/2013gg@ez.no Slide 9 Prerequisites
  • 10. • Homebrew • Zeta Components • Zend Framework 2 • Symfony 2 5/17/2013gg@ez.no Slide 10 Candidates
  • 11. 5/17/2013gg@ez.no Slide 11 And the winner is… Title of presentation is a hint, really...
  • 12. 5/17/2013gg@ez.no Slide 12 And the winner is…
  • 13. 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
  • 15. 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)
  • 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/2013gg@ez.no 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/2013gg@ez.no 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/2013gg@ez.no Slide 19 BC: the challenge
  • 20. 5/17/2013gg@ez.no Slide 20 Dual-core architecture Where the magic is
  • 21. Legacy version still works perfectly standalone 5/17/2013gg@ez.no Slide 21 BC: icing on the cake
  • 23.  New Core: a standard Simfony app  Legacy stack isolated in a dedicated directory 5/17/2013gg@ez.no 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/2013gg@ez.no 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/2013gg@ez.no Slide 25 Refactoring: bridging Legacy code
  • 26. The ChainRouter from the Sf CMF project is used 5/17/2013gg@ez.no 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/2013gg@ez.no Slide 27 REST API
  • 29. 5/17/2013gg@ez.no 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/2013gg@ez.no 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, gaetano.giunta@ez.no THANK YOU 5/17/2013gg@ez.no Slide 32 The usual suspects
  • 33. 5/17/2013gg@ez.no Slide 33 And now for something completely different