SlideShare a Scribd company logo
Symfony4
A new way to develop web applications
Antonio Perić-Mažar, Locastic
Antonio Perić-Mažar
CEO @ Locastic
Co-Organizer @ BlockSplit Conference
Tinel Meetup
antonio@locastic.com
@antonioperic
@antonioperic
Locastic
● We help clients create amazing web and mobile
apps (since 2011)
○ mobile development
○ web development
○ UX/UI
○ Training and Consulting
● @locastic
● www.locastic.com
● Split, Croatia
@antonioperic
@antonioperic
Photo: Goran Leš
Text
@antonioperic
Text
@antonioperic
Text
@antonioperic
Text
@antonioperic
Text
@antonioperic
30.11.2017
@antonioperic
Fabien Potencier
We can do better
● Installing a Bundle is too cumbersome
● Remove a Bundle is too cumbersome
@antonioperic
We can do better
● Installing a Bundle is too cumbersome
● Remove a Bundle is too cumbersome
● The standard edition is not good enough
@antonioperic
We can do better
● Installing a Bundle is too cumbersome
● Remove a Bundle is too cumbersome
● The standard edition is not good enough
● You always have a lot of code that you are not using
but it is to hard to remove it
@antonioperic
@antonioperic
Fabien Potencier
Symfony4
● Starting as micro framework
● Compose your application / setup your stack
● Build API, console app, traditional web app or
whatever you want
@antonioperic
@antonioperic
Symfony Flex
● Composer plugin
● Auto-configuration via recipes
@antonioperic
Symfony Flex
● Composer plugin
● Auto-configuration via recipes
@antonioperic
Fabien Potencier
Symfony flex
@antonioperic
Symfony flex
@antonioperic
Mailer manifest.json
@antonioperic
Symfony flex recipies
● Two repositories
● symfony/recipies
○ maintained by Symfony Core Team and holds only recipies
for Symfony components and bundles ‘opinionated’ by them
○ Can use alias
● symfony/recipies-contrib
○ Anyone can contribute
○ Cannot use alias
@antonioperic
www.symfony.sh
@antonioperic
Directory structure
@antonioperic
Directory structure
@antonioperic
Directory structure
@antonioperic
we say goodby to app.php and
app_dev.php — this is now one
standard index.php file and
environment is set with
environmental variable APP_ENV
Directory structure
@antonioperic
Directory structure
@antonioperic
Directory structure
@antonioperic
Directory structure
@antonioperic
Flex keeps tracks of the recipes it installed in a
symfony.lock file, which must be committed to
your code repository.
Bundle-less applications
● Bundle vs no-bundle apps
● All in src folder
○ App/ namespace
○ You should separate, but no need for bundles
● Moving forward to standardisation
● It reduces the perceived complexity, also makes
your code feels more decoupled from symfony
● Bundle inheritance mechanisms are deprecated in
3.4 and were removed in 4.0
@antonioperic
Let’s call this a small demo
- Our task will be to create simple Symfony console
application, a web crawler
- Steps:
- Create new symfony application
- composer create-project symfony/skeleton my_project
- Add Console component
- Add Doctrine
- Add Symfony Crawler component
- Do some code (we will not do code, idea is just to see the
flow of working with Symfony4)
@antonioperic
Create new Symfony4 application
@antonioperic
Create new Symfony4 application
@antonioperic
Add components
● Composer req cli
● Composer req doctrine
● Composer req symfony/dom-crawler
@antonioperic
Autowiring
● Introduced in Symfony 3 version
● Autowiring allows you to manage services in the
container with minimal configuration
● It reads the type-hints on your constructor (or other
methods) and automatically passes the correct
services to each method.
● Symfony's autowiring is designed to be predictable:
if it is not absolutely clear which dependency should
be passed, you'll see an actionable exception. @antonioperic
Autowire
@antonioperic
Autowiring
@antonioperic
Symfony Webpack Encore
● Webpack encore is a simpler way to integrate
Webpack into your application
● Step forward after AsseticBundle
● composer require webpack-encore
● It can work outside of Symfony
@antonioperic
About me
Text
@antonioperic
DotEnv component
● The Dotenv Component parses .env files to make
environment variables stored in them accessible via
getenv(), $_ENV or $_SERVER.
● composer require symfony/dotenv
@antonioperic
DotEnv component
@antonioperic
Performance
Hello world test
@antonioperic
Fabien Potencier
Performance
@antonioperic
Performance
@antonioperic
Fabien Potencier
Updating to Symfony
● It is possible, not even to complex
● Need a little bit of time
● If you are using Symfony2.x, upgrade first to 3.4
@antonioperic
Symfony 4.1 improvements
● Made csrf_token() useable without forms
● Csv processor for env variables
● Display DotEnv variables in profiler
● Session improvements
● Console improvements
● Workflow improvements
● Messenger component
https://symfony.com/blog/symfony-4-1-curated-new-
features @antonioperic
Roadmap
@antonioperic
7 months later
● It is great feeling to works with Symfony4
● Seems that Fabien and core team are making great
progress moving Symfony forward
● I love Flex
● It is seems much more natural to navigate through
new code structure and DX is much better
● Symfony community is awesome
@antonioperic
7 months later
● Symfony is great as microframework
● With higher level of abstraction is more better for
prototyping and building things fast
● It will be much easier to start, but maybe even
harder to master for newbies (symfony2 wasn’t easy
to master)
@antonioperic
Thank you!
@antonioperic
Questions?
@antonioperic

More Related Content

What's hot

Bootstrapping your plugin
Bootstrapping your pluginBootstrapping your plugin
Bootstrapping your plugin
Marko Heijnen
 
Developing Rich Internet Applications with Perl and JavaScript
Developing Rich Internet Applications with Perl and JavaScriptDeveloping Rich Internet Applications with Perl and JavaScript
Developing Rich Internet Applications with Perl and JavaScript
nohuhu
 

What's hot (16)

Hybrid Apps in a Snap
Hybrid Apps in a SnapHybrid Apps in a Snap
Hybrid Apps in a Snap
 
Bootstrapping your plugin
Bootstrapping your pluginBootstrapping your plugin
Bootstrapping your plugin
 
Jumping in Jakarta Open Source Project Everything nobody tells you
Jumping in Jakarta Open Source Project  Everything nobody tells youJumping in Jakarta Open Source Project  Everything nobody tells you
Jumping in Jakarta Open Source Project Everything nobody tells you
 
Dmytro Dziubenko "Developer's toolchain"
Dmytro Dziubenko "Developer's toolchain"Dmytro Dziubenko "Developer's toolchain"
Dmytro Dziubenko "Developer's toolchain"
 
What is the Responsibility of Plugin Developers?
What is the Responsibility of Plugin Developers?What is the Responsibility of Plugin Developers?
What is the Responsibility of Plugin Developers?
 
Using Composer to create manageable WordPress websites
Using Composer to create manageable WordPress websitesUsing Composer to create manageable WordPress websites
Using Composer to create manageable WordPress websites
 
Modern Gentlemen's WordPress
Modern Gentlemen's WordPressModern Gentlemen's WordPress
Modern Gentlemen's WordPress
 
API All the Things!
API All the Things!API All the Things!
API All the Things!
 
Make web as webapp
Make web as webappMake web as webapp
Make web as webapp
 
Build & deploy PHP application (intro level)
Build & deploy PHP application (intro level)Build & deploy PHP application (intro level)
Build & deploy PHP application (intro level)
 
Create scalable and failure safe cluster MagentoCommerce using cloud hosting ...
Create scalable and failure safe cluster MagentoCommerce using cloud hosting ...Create scalable and failure safe cluster MagentoCommerce using cloud hosting ...
Create scalable and failure safe cluster MagentoCommerce using cloud hosting ...
 
Developing Rich Internet Applications with Perl and JavaScript
Developing Rich Internet Applications with Perl and JavaScriptDeveloping Rich Internet Applications with Perl and JavaScript
Developing Rich Internet Applications with Perl and JavaScript
 
Practical PHP Deployment with Jenkins
Practical PHP Deployment with JenkinsPractical PHP Deployment with Jenkins
Practical PHP Deployment with Jenkins
 
Developing FirefoxOS
Developing FirefoxOSDeveloping FirefoxOS
Developing FirefoxOS
 
Building Desktop RIAs with JavaScript and PHP - ZendCon09
Building Desktop RIAs with JavaScript and PHP - ZendCon09Building Desktop RIAs with JavaScript and PHP - ZendCon09
Building Desktop RIAs with JavaScript and PHP - ZendCon09
 
Ansible, Idempotency, and Jenkins
Ansible, Idempotency, and JenkinsAnsible, Idempotency, and Jenkins
Ansible, Idempotency, and Jenkins
 

Similar to Symfony4: A new way to develop applications | Antonio Peric | CODEiD

Extension developer secrets - How to make money with Joomla
Extension developer secrets - How to make money with JoomlaExtension developer secrets - How to make money with Joomla
Extension developer secrets - How to make money with Joomla
Tim Plummer
 
BP214 IBM Lotus Symphony : Finally, A Developer's Friend
BP214 IBM Lotus Symphony : Finally, A Developer's FriendBP214 IBM Lotus Symphony : Finally, A Developer's Friend
BP214 IBM Lotus Symphony : Finally, A Developer's Friend
John Head
 

Similar to Symfony4: A new way to develop applications | Antonio Peric | CODEiD (20)

Drupal8 for Symfony Developers
Drupal8 for Symfony DevelopersDrupal8 for Symfony Developers
Drupal8 for Symfony Developers
 
Symfony 4: A new way to develop applications #ipc19
Symfony 4: A new way to develop applications #ipc19Symfony 4: A new way to develop applications #ipc19
Symfony 4: A new way to develop applications #ipc19
 
Drupal8 for Symfony developers - Dutch PHP
Drupal8 for Symfony developers - Dutch PHPDrupal8 for Symfony developers - Dutch PHP
Drupal8 for Symfony developers - Dutch PHP
 
Extension developer secrets - How to make money with Joomla
Extension developer secrets - How to make money with JoomlaExtension developer secrets - How to make money with Joomla
Extension developer secrets - How to make money with Joomla
 
Symfony 4: A new way to develop applications #phpsrb
 Symfony 4: A new way to develop applications #phpsrb Symfony 4: A new way to develop applications #phpsrb
Symfony 4: A new way to develop applications #phpsrb
 
PyCourse - Self driving python course
PyCourse - Self driving python coursePyCourse - Self driving python course
PyCourse - Self driving python course
 
OpenOffice Application with Python
OpenOffice Application with PythonOpenOffice Application with Python
OpenOffice Application with Python
 
SharePoint Framework tips and tricks
SharePoint Framework tips and tricksSharePoint Framework tips and tricks
SharePoint Framework tips and tricks
 
Applying the Unix Philosophy to Django projects: a report from the real world
Applying the Unix Philosophy to Django projects: a report from the real worldApplying the Unix Philosophy to Django projects: a report from the real world
Applying the Unix Philosophy to Django projects: a report from the real world
 
Hands on iOS developments with Jenkins
Hands on iOS developments with JenkinsHands on iOS developments with Jenkins
Hands on iOS developments with Jenkins
 
Docker for business: How I stopped worrying about antipatterns
Docker for business: How I stopped worrying about antipatternsDocker for business: How I stopped worrying about antipatterns
Docker for business: How I stopped worrying about antipatterns
 
Enterprise PHP (Zend UK Business Conference)
Enterprise PHP (Zend UK Business Conference)Enterprise PHP (Zend UK Business Conference)
Enterprise PHP (Zend UK Business Conference)
 
Top 6 php framework
Top 6 php frameworkTop 6 php framework
Top 6 php framework
 
PHP - Programming language war, does it matter
PHP - Programming language war, does it matterPHP - Programming language war, does it matter
PHP - Programming language war, does it matter
 
Bootstrap4XPages
Bootstrap4XPagesBootstrap4XPages
Bootstrap4XPages
 
BP214 IBM Lotus Symphony : Finally, A Developer's Friend
BP214 IBM Lotus Symphony : Finally, A Developer's FriendBP214 IBM Lotus Symphony : Finally, A Developer's Friend
BP214 IBM Lotus Symphony : Finally, A Developer's Friend
 
Fun with Jenkins & Salesforce
Fun with Jenkins & SalesforceFun with Jenkins & Salesforce
Fun with Jenkins & Salesforce
 
Symfony, Oxid, Composer
Symfony, Oxid, ComposerSymfony, Oxid, Composer
Symfony, Oxid, Composer
 
Introducing ASP.NET vNext – The Future of .NET on the Server | FalafelCON 2014
Introducing ASP.NET vNext – The Future of .NET on the Server | FalafelCON 2014Introducing ASP.NET vNext – The Future of .NET on the Server | FalafelCON 2014
Introducing ASP.NET vNext – The Future of .NET on the Server | FalafelCON 2014
 
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
 

More from CODEiD PHP Community

Effective codereview | Dave Liddament | CODEiD
Effective codereview | Dave Liddament | CODEiDEffective codereview | Dave Liddament | CODEiD
Effective codereview | Dave Liddament | CODEiD
CODEiD PHP Community
 
Domain Driven Design | Артём Антоненко | CODEID |
Domain Driven Design | Артём Антоненко | CODEID |Domain Driven Design | Артём Антоненко | CODEID |
Domain Driven Design | Артём Антоненко | CODEID |
CODEiD PHP Community
 

More from CODEiD PHP Community (11)

GRASP - General Responsibility Assignment Software Principles
GRASP -  General Responsibility Assignment Software PrinciplesGRASP -  General Responsibility Assignment Software Principles
GRASP - General Responsibility Assignment Software Principles
 
The PHP developer stack for building chatbots | Christoph Rumpel | CODEiD
The PHP developer stack for building chatbots | Christoph Rumpel | CODEiDThe PHP developer stack for building chatbots | Christoph Rumpel | CODEiD
The PHP developer stack for building chatbots | Christoph Rumpel | CODEiD
 
Ioc container | Hannes Van De Vreken | CODEiD
Ioc container | Hannes Van De Vreken | CODEiDIoc container | Hannes Van De Vreken | CODEiD
Ioc container | Hannes Van De Vreken | CODEiD
 
Effective codereview | Dave Liddament | CODEiD
Effective codereview | Dave Liddament | CODEiDEffective codereview | Dave Liddament | CODEiD
Effective codereview | Dave Liddament | CODEiD
 
Contract testing | Евгений Кузьмин | CODEiD
Contract testing | Евгений Кузьмин | CODEiDContract testing | Евгений Кузьмин | CODEiD
Contract testing | Евгений Кузьмин | CODEiD
 
Running microservices successfully | Bastian Hofmann | CODEiD
Running microservices successfully | Bastian Hofmann | CODEiDRunning microservices successfully | Bastian Hofmann | CODEiD
Running microservices successfully | Bastian Hofmann | CODEiD
 
Graphql + Symfony | Александр Демченко | CODEiD
Graphql + Symfony | Александр Демченко | CODEiDGraphql + Symfony | Александр Демченко | CODEiD
Graphql + Symfony | Александр Демченко | CODEiD
 
Mastering message queues | Tobias Nyholm | CODEiD
Mastering message queues | Tobias Nyholm | CODEiDMastering message queues | Tobias Nyholm | CODEiD
Mastering message queues | Tobias Nyholm | CODEiD
 
Domain Driven Design | Артём Антоненко | CODEID |
Domain Driven Design | Артём Антоненко | CODEID |Domain Driven Design | Артём Антоненко | CODEID |
Domain Driven Design | Артём Антоненко | CODEID |
 
CodeID - PHP Odessa Conf: Сергей Тимошевский "Все пути ведут к микросервисам"
CodeID - PHP Odessa Conf: Сергей Тимошевский "Все пути ведут к микросервисам"CodeID - PHP Odessa Conf: Сергей Тимошевский "Все пути ведут к микросервисам"
CodeID - PHP Odessa Conf: Сергей Тимошевский "Все пути ведут к микросервисам"
 
CodeID - PHP Odessa Conf: Вячеслав Мозговой "Как сделать сайт быстрым и люб...
CodeID - PHP Odessa Conf: Вячеслав Мозговой "Как сделать сайт быстрым и люб...CodeID - PHP Odessa Conf: Вячеслав Мозговой "Как сделать сайт быстрым и люб...
CodeID - PHP Odessa Conf: Вячеслав Мозговой "Как сделать сайт быстрым и люб...
 

Recently uploaded

AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
Alluxio, Inc.
 

Recently uploaded (20)

Agnieszka Andrzejewska - BIM School Course in Kraków
Agnieszka Andrzejewska - BIM School Course in KrakówAgnieszka Andrzejewska - BIM School Course in Kraków
Agnieszka Andrzejewska - BIM School Course in Kraków
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
 
Designing for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web ServicesDesigning for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web Services
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
 
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBroker
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
 
Abortion ^Clinic ^%[+971588192166''] Abortion Pill Al Ain (?@?) Abortion Pill...
Abortion ^Clinic ^%[+971588192166''] Abortion Pill Al Ain (?@?) Abortion Pill...Abortion ^Clinic ^%[+971588192166''] Abortion Pill Al Ain (?@?) Abortion Pill...
Abortion ^Clinic ^%[+971588192166''] Abortion Pill Al Ain (?@?) Abortion Pill...
 
Advanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should KnowAdvanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should Know
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
 
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
 
Accelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with PlatformlessAccelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with Platformless
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
 

Symfony4: A new way to develop applications | Antonio Peric | CODEiD