SlideShare a Scribd company logo
1 of 28
There are plenty of other
frameworks in the sea PHP + Symfony

FINDOLOGIC GMBH
GEORG M. SORST
G.SORST@FINDOLOGIC.COM
WebDev Meetup 20.11.2013
FINDOLOGIC

◼
◼

◼
◼

Search for online stores
>100M queries / month
A dozen servers
One of Salzburg’s most successful startups
Business
LAN
BBQ
Trachty Friday
We’re hiring

DEVELOPERS DEVELOPERS DEVELOPERS!
History

◼
◼

◼
◼

Born in the web 20 years ago
Form interpreter to replace perl
Core is backed by a company (Zend)
1M to 100M hostnames in 10 years
Stack Overflow tags

Source: http://hewgill.com/~greg/stackoverflow/stack_overflow/tags/
W3Techs

Source: http://w3techs.com/technologies/overview/programming_language/all
Usage

◼ eCommerce: osCommerce, Zen Cart,
Magento, PrestaShop, OpenCart, Oxid,
xtCommerce, Shopware
◼ CMS: Wordpress, Joomla, Drupal
◼ Other: Wikipedia, Digg, Facebook
The good

◼

◼
◼

Dead simple: <?php echo “Hello
world”;
Runs everywhere
Documentation, Community, Extensions
The good

◼

◼

Image processing, databases, mails,
character encoding, XML built-in
Few keywords and operators, high
readability
The bad

◼
◼

◼

◼

Spaghetti code
Very loose typing: null == false ==
"" == 0 == "0" == array()
Inconsistent code base: strpos(),
str_rot13(), library not OO
Arbitrary filesystem structure
The getting better

◼
◼

◼

OO; Closures, Iterators, Generators
Standard PHP Library (SPL): queues,
stacks, lists, iterators
Tools: PHPUnit, PHPDocumentor, Mess
Detector, Checkstyle
Example

$numbers = array(1, 2, 3, 4, 5);
$divisor = 3;
Old school

$numbers = array(1, 2, 3, 4, 5);
$divisor = 3;

$filtered = array();
foreach ($numbers as $number) {
if ($number % $divisor == 0) {
$filtered[] = $number;
}
}
Middle school

$numbers = array(1, 2, 3, 4, 5);
$divisor = 3;

$filter = create_function('$number', “return
($number % $divisor == 0);”);
$filtered = array_filter($numbers, $filter);
New school

$numbers = array(1, 2, 3, 4, 5);
$divisor = 3;

$filter = function($number) use ($divisor) {
return ($number % $divisor == 0);
};
$filtered = array_filter($numbers, $filter);
Questions?
PHP Frameworks

◼
◼

◼
◼
◼

MVC
OO
ORM
Templates
...
Symfony

◼
◼

◼

MVC, OO
Created by Sensio labs
Documentation, Community, Events
Symfony

◼
◼

◼
◼
◼

URL Conventions
CRUD generators
Doctrine ORM, Twig templates
Loosely coupled components
Dependency injection
Demo Time
Summary

“PHP is the Nickelback of programming
languages”
- Jeff Atwood, Stack Exchange
Summary

“The only conclusion I can draw is that
building a compelling application is far
more important than choice of language”
- Jeff Atwood, Stack Exchange
Thanks!
Backup: Install instructions
1.
2.
3.
4.
5.
6.

Change user: sudo su - www-data -s /bin/bash
Download Symfony 2.3 Standard Edition (without Vendors): http://symfony.com/download
Setup git repository: http://symfony.com/doc/current/cookbook/workflow/new_project_git.html
Install composer: curl -sS https://getcomposer.org/installer | php
Install libraries: php composer.phar install
Configure: http://localhost/~georg/webdev/web/config.php
a.
b.

7.
8.
9.
10.
11.
12.
13.
14.
15.

16.
17.

pdo_sqlite
db path: %kernel.root_dir%/data/example.db

c. no password
Generate bundle: php app/console generate:bundle
Generate entity: php app/console generate:doctrine:entity
Drop the old DB schema: php app/console doctrine:schema:drop --force
Generate DB schema: php app/console doctrine:schema:create
Generate CRUD: php app/console generate:doctrine:crud
http://localhost/~georg/webdev/web/app_dev.php/post/
Add pretty CRUD bundle: https://github.com/jordillonch/CrudGeneratorBundle
Install new bundle: php composer.phar update
Delete the old CRUD: rm -fr src/FINDOLOGIC/ExampleBundle/Resources/views/Post/
src/FINDOLOGIC/ExampleBundle/Controller/PostController.php
src/FINDOLOGIC/ExampleBundle/Form/PostType.php
src/FINDOLOGIC/ExampleBundle/Tests/Controller/PostControllerTest.php
Generate new CRUD: php app/console jordillonch:generate:crud
Fill created_at automatically: http://stackoverflow.com/questions/17321893/automatic-values-for-updated-atcreated-at-in-doctrine

a. Remove created_at from src/FINDOLOGIC/ExampleBundle/Form/PostType.php
18. http://localhost/~georg/webdev/web/app_dev.php/post/

More Related Content

What's hot

The Windows 10 tips you wished you knew last week
The Windows 10 tips you wished you knew last weekThe Windows 10 tips you wished you knew last week
The Windows 10 tips you wished you knew last weekOlav Tvedt
 
Presentation of JSConf.eu
Presentation of JSConf.euPresentation of JSConf.eu
Presentation of JSConf.euFredrik Wendt
 
ModemFrontEndops
ModemFrontEndopsModemFrontEndops
ModemFrontEndopsmicrobean
 
Laporan setting dns
Laporan setting dnsLaporan setting dns
Laporan setting dnsSeptian Adi
 
Plone Conference 2008 Lightning Talk Static Zope Rpx
Plone Conference 2008 Lightning Talk Static Zope RpxPlone Conference 2008 Lightning Talk Static Zope Rpx
Plone Conference 2008 Lightning Talk Static Zope RpxParis, France
 
A practical 10m intro to PHP on Heroku
A practical 10m intro to PHP on HerokuA practical 10m intro to PHP on Heroku
A practical 10m intro to PHP on HerokuOlivier Garcia
 

What's hot (7)

The Windows 10 tips you wished you knew last week
The Windows 10 tips you wished you knew last weekThe Windows 10 tips you wished you knew last week
The Windows 10 tips you wished you knew last week
 
Presentation of JSConf.eu
Presentation of JSConf.euPresentation of JSConf.eu
Presentation of JSConf.eu
 
ModemFrontEndops
ModemFrontEndopsModemFrontEndops
ModemFrontEndops
 
Laporan setting dns
Laporan setting dnsLaporan setting dns
Laporan setting dns
 
Plone Conference 2008 Lightning Talk Static Zope Rpx
Plone Conference 2008 Lightning Talk Static Zope RpxPlone Conference 2008 Lightning Talk Static Zope Rpx
Plone Conference 2008 Lightning Talk Static Zope Rpx
 
Plone pwns
Plone pwnsPlone pwns
Plone pwns
 
A practical 10m intro to PHP on Heroku
A practical 10m intro to PHP on HerokuA practical 10m intro to PHP on Heroku
A practical 10m intro to PHP on Heroku
 

Similar to Salzburg WebDev Meetup PHP Symfony

Ran Mizrahi - Symfony2 meets Drupal8
Ran Mizrahi - Symfony2 meets Drupal8Ran Mizrahi - Symfony2 meets Drupal8
Ran Mizrahi - Symfony2 meets Drupal8Ran Mizrahi
 
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 PlatformSébastien Morel
 
DevNet @TAG - Spark & Tropo APIs - Milan/Rome May 2016
DevNet @TAG - Spark & Tropo APIs - Milan/Rome May 2016DevNet @TAG - Spark & Tropo APIs - Milan/Rome May 2016
DevNet @TAG - Spark & Tropo APIs - Milan/Rome May 2016Cisco DevNet
 
Introduction to PHP - SDPHP
Introduction to PHP - SDPHPIntroduction to PHP - SDPHP
Introduction to PHP - SDPHPEric Johnson
 
Web scraping 101 with goutte
Web scraping 101 with goutteWeb scraping 101 with goutte
Web scraping 101 with goutteJoshua Copeland
 
Information Retrieval and Extraction
Information Retrieval and ExtractionInformation Retrieval and Extraction
Information Retrieval and ExtractionChristopher Frenz
 
N2Y4 Mobile Challenge May 2009 San Jose
N2Y4 Mobile Challenge May 2009   San JoseN2Y4 Mobile Challenge May 2009   San Jose
N2Y4 Mobile Challenge May 2009 San JoseAdhearsion Foundation
 
Get Ahead with HTML5 on Moible
Get Ahead with HTML5 on MoibleGet Ahead with HTML5 on Moible
Get Ahead with HTML5 on Moiblemarkuskobler
 
HTML5 vs Silverlight
HTML5 vs SilverlightHTML5 vs Silverlight
HTML5 vs SilverlightMatt Casto
 
Php mysql training-in-mumbai
Php mysql training-in-mumbaiPhp mysql training-in-mumbai
Php mysql training-in-mumbaivibrantuser
 
What Web Framework To Use?
What Web Framework To Use?What Web Framework To Use?
What Web Framework To Use?Kasra Khosravi
 
Amplify your stack - Jsfoo pune 2012
Amplify your stack - Jsfoo pune 2012Amplify your stack - Jsfoo pune 2012
Amplify your stack - Jsfoo pune 2012threepointone
 
Open source-secret-sauce-rit-2010
Open source-secret-sauce-rit-2010Open source-secret-sauce-rit-2010
Open source-secret-sauce-rit-2010Ted Husted
 

Similar to Salzburg WebDev Meetup PHP Symfony (20)

Ran Mizrahi - Symfony2 meets Drupal8
Ran Mizrahi - Symfony2 meets Drupal8Ran Mizrahi - Symfony2 meets Drupal8
Ran Mizrahi - Symfony2 meets Drupal8
 
Current state-of-php
Current state-of-phpCurrent state-of-php
Current state-of-php
 
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
 
DevNet @TAG - Spark & Tropo APIs - Milan/Rome May 2016
DevNet @TAG - Spark & Tropo APIs - Milan/Rome May 2016DevNet @TAG - Spark & Tropo APIs - Milan/Rome May 2016
DevNet @TAG - Spark & Tropo APIs - Milan/Rome May 2016
 
Becoming A Php Ninja
Becoming A Php NinjaBecoming A Php Ninja
Becoming A Php Ninja
 
Introduction to PHP - SDPHP
Introduction to PHP - SDPHPIntroduction to PHP - SDPHP
Introduction to PHP - SDPHP
 
Meteor for IT weekend
Meteor for IT weekendMeteor for IT weekend
Meteor for IT weekend
 
Meteor
MeteorMeteor
Meteor
 
Meteor
MeteorMeteor
Meteor
 
Web scraping 101 with goutte
Web scraping 101 with goutteWeb scraping 101 with goutte
Web scraping 101 with goutte
 
Information Retrieval and Extraction
Information Retrieval and ExtractionInformation Retrieval and Extraction
Information Retrieval and Extraction
 
N2Y4 Mobile Challenge May 2009 San Jose
N2Y4 Mobile Challenge May 2009   San JoseN2Y4 Mobile Challenge May 2009   San Jose
N2Y4 Mobile Challenge May 2009 San Jose
 
Dean4j@Njug5
Dean4j@Njug5Dean4j@Njug5
Dean4j@Njug5
 
Get Ahead with HTML5 on Moible
Get Ahead with HTML5 on MoibleGet Ahead with HTML5 on Moible
Get Ahead with HTML5 on Moible
 
HTML5 vs Silverlight
HTML5 vs SilverlightHTML5 vs Silverlight
HTML5 vs Silverlight
 
Php mysql training-in-mumbai
Php mysql training-in-mumbaiPhp mysql training-in-mumbai
Php mysql training-in-mumbai
 
What Web Framework To Use?
What Web Framework To Use?What Web Framework To Use?
What Web Framework To Use?
 
Amplify your stack - Jsfoo pune 2012
Amplify your stack - Jsfoo pune 2012Amplify your stack - Jsfoo pune 2012
Amplify your stack - Jsfoo pune 2012
 
Open source-secret-sauce-rit-2010
Open source-secret-sauce-rit-2010Open source-secret-sauce-rit-2010
Open source-secret-sauce-rit-2010
 
Scalable talk notes
Scalable talk notesScalable talk notes
Scalable talk notes
 

More from Georg Sorst

Psychological safety how to become a team that learns
Psychological safety   how to become a team that learnsPsychological safety   how to become a team that learns
Psychological safety how to become a team that learnsGeorg Sorst
 
Interactive Data Science Notebooks with Apache Zeppelin
Interactive Data Science Notebooks with Apache ZeppelinInteractive Data Science Notebooks with Apache Zeppelin
Interactive Data Science Notebooks with Apache ZeppelinGeorg Sorst
 
JS Error Logging with Sentry
JS Error Logging with SentryJS Error Logging with Sentry
JS Error Logging with SentryGeorg Sorst
 
Infrastructure = Code
Infrastructure = CodeInfrastructure = Code
Infrastructure = CodeGeorg Sorst
 
Das bedingungslose Grundeinkommen
Das bedingungslose GrundeinkommenDas bedingungslose Grundeinkommen
Das bedingungslose GrundeinkommenGeorg Sorst
 
ELK Stack - Turn boring logfiles into sexy dashboard
ELK Stack - Turn boring logfiles into sexy dashboardELK Stack - Turn boring logfiles into sexy dashboard
ELK Stack - Turn boring logfiles into sexy dashboardGeorg Sorst
 
Der FINDOLOGIC Entwicklungsprozess
Der FINDOLOGIC EntwicklungsprozessDer FINDOLOGIC Entwicklungsprozess
Der FINDOLOGIC EntwicklungsprozessGeorg Sorst
 

More from Georg Sorst (7)

Psychological safety how to become a team that learns
Psychological safety   how to become a team that learnsPsychological safety   how to become a team that learns
Psychological safety how to become a team that learns
 
Interactive Data Science Notebooks with Apache Zeppelin
Interactive Data Science Notebooks with Apache ZeppelinInteractive Data Science Notebooks with Apache Zeppelin
Interactive Data Science Notebooks with Apache Zeppelin
 
JS Error Logging with Sentry
JS Error Logging with SentryJS Error Logging with Sentry
JS Error Logging with Sentry
 
Infrastructure = Code
Infrastructure = CodeInfrastructure = Code
Infrastructure = Code
 
Das bedingungslose Grundeinkommen
Das bedingungslose GrundeinkommenDas bedingungslose Grundeinkommen
Das bedingungslose Grundeinkommen
 
ELK Stack - Turn boring logfiles into sexy dashboard
ELK Stack - Turn boring logfiles into sexy dashboardELK Stack - Turn boring logfiles into sexy dashboard
ELK Stack - Turn boring logfiles into sexy dashboard
 
Der FINDOLOGIC Entwicklungsprozess
Der FINDOLOGIC EntwicklungsprozessDer FINDOLOGIC Entwicklungsprozess
Der FINDOLOGIC Entwicklungsprozess
 

Recently uploaded

"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
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...DianaGray10
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
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 businesspanagenda
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfOverkill Security
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKJago de Vreede
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
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, Adobeapidays
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 

Recently uploaded (20)

"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
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...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
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
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
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
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 

Salzburg WebDev Meetup PHP Symfony

  • 1. There are plenty of other frameworks in the sea PHP + Symfony FINDOLOGIC GMBH GEORG M. SORST G.SORST@FINDOLOGIC.COM WebDev Meetup 20.11.2013
  • 2. FINDOLOGIC ◼ ◼ ◼ ◼ Search for online stores >100M queries / month A dozen servers One of Salzburg’s most successful startups
  • 4. LAN
  • 5. BBQ
  • 8. History ◼ ◼ ◼ ◼ Born in the web 20 years ago Form interpreter to replace perl Core is backed by a company (Zend) 1M to 100M hostnames in 10 years
  • 9. Stack Overflow tags Source: http://hewgill.com/~greg/stackoverflow/stack_overflow/tags/
  • 11. Usage ◼ eCommerce: osCommerce, Zen Cart, Magento, PrestaShop, OpenCart, Oxid, xtCommerce, Shopware ◼ CMS: Wordpress, Joomla, Drupal ◼ Other: Wikipedia, Digg, Facebook
  • 12. The good ◼ ◼ ◼ Dead simple: <?php echo “Hello world”; Runs everywhere Documentation, Community, Extensions
  • 13. The good ◼ ◼ Image processing, databases, mails, character encoding, XML built-in Few keywords and operators, high readability
  • 14. The bad ◼ ◼ ◼ ◼ Spaghetti code Very loose typing: null == false == "" == 0 == "0" == array() Inconsistent code base: strpos(), str_rot13(), library not OO Arbitrary filesystem structure
  • 15. The getting better ◼ ◼ ◼ OO; Closures, Iterators, Generators Standard PHP Library (SPL): queues, stacks, lists, iterators Tools: PHPUnit, PHPDocumentor, Mess Detector, Checkstyle
  • 16. Example $numbers = array(1, 2, 3, 4, 5); $divisor = 3;
  • 17. Old school $numbers = array(1, 2, 3, 4, 5); $divisor = 3; $filtered = array(); foreach ($numbers as $number) { if ($number % $divisor == 0) { $filtered[] = $number; } }
  • 18. Middle school $numbers = array(1, 2, 3, 4, 5); $divisor = 3; $filter = create_function('$number', “return ($number % $divisor == 0);”); $filtered = array_filter($numbers, $filter);
  • 19. New school $numbers = array(1, 2, 3, 4, 5); $divisor = 3; $filter = function($number) use ($divisor) { return ($number % $divisor == 0); }; $filtered = array_filter($numbers, $filter);
  • 22. Symfony ◼ ◼ ◼ MVC, OO Created by Sensio labs Documentation, Community, Events
  • 23. Symfony ◼ ◼ ◼ ◼ ◼ URL Conventions CRUD generators Doctrine ORM, Twig templates Loosely coupled components Dependency injection
  • 25. Summary “PHP is the Nickelback of programming languages” - Jeff Atwood, Stack Exchange
  • 26. Summary “The only conclusion I can draw is that building a compelling application is far more important than choice of language” - Jeff Atwood, Stack Exchange
  • 28. Backup: Install instructions 1. 2. 3. 4. 5. 6. Change user: sudo su - www-data -s /bin/bash Download Symfony 2.3 Standard Edition (without Vendors): http://symfony.com/download Setup git repository: http://symfony.com/doc/current/cookbook/workflow/new_project_git.html Install composer: curl -sS https://getcomposer.org/installer | php Install libraries: php composer.phar install Configure: http://localhost/~georg/webdev/web/config.php a. b. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. pdo_sqlite db path: %kernel.root_dir%/data/example.db c. no password Generate bundle: php app/console generate:bundle Generate entity: php app/console generate:doctrine:entity Drop the old DB schema: php app/console doctrine:schema:drop --force Generate DB schema: php app/console doctrine:schema:create Generate CRUD: php app/console generate:doctrine:crud http://localhost/~georg/webdev/web/app_dev.php/post/ Add pretty CRUD bundle: https://github.com/jordillonch/CrudGeneratorBundle Install new bundle: php composer.phar update Delete the old CRUD: rm -fr src/FINDOLOGIC/ExampleBundle/Resources/views/Post/ src/FINDOLOGIC/ExampleBundle/Controller/PostController.php src/FINDOLOGIC/ExampleBundle/Form/PostType.php src/FINDOLOGIC/ExampleBundle/Tests/Controller/PostControllerTest.php Generate new CRUD: php app/console jordillonch:generate:crud Fill created_at automatically: http://stackoverflow.com/questions/17321893/automatic-values-for-updated-atcreated-at-in-doctrine a. Remove created_at from src/FINDOLOGIC/ExampleBundle/Form/PostType.php 18. http://localhost/~georg/webdev/web/app_dev.php/post/