SlideShare a Scribd company logo
1 of 41
Download to read offline
PHP Best Practices Bangalore PHP Users Meetup 31 st  October 2009 http://www.meetup.com/Bangalore-PHP-Users
Overview ,[object Object],[object Object],[object Object],[object Object],[object Object]
About this talk ,[object Object],[object Object],[object Object],[object Object],[object Object]
Use a Coding Standard
Why use coding standard? ,[object Object],[object Object],[object Object],[object Object]
Okay, I’LL Create one…
Learn from others ,[object Object],[object Object],[object Object]
What choices exist? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Some Zend Framework standards ,[object Object],[object Object],[object Object],[object Object],[object Object]
Some Zend Framework standards ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Some Zend Framework standards ,[object Object],[object Object],[object Object],[object Object],[object Object]
Example
Any tool to check coding standards? ,[object Object],[object Object],[object Object],[object Object],[object Object]
PHP_CodeSniffer Example Default uses PEAR style coding standard
PHP_CodeSniffer Example
Documentation
Documentation ,[object Object],[object Object],[object Object]
Documentation ,[object Object],[object Object],[object Object],[object Object],[object Object]
What choices exist? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Documentation ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Documentation ,[object Object]
Documentation ,[object Object]
Documentation
Documentation
Source Control
Why do I need it? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
What choices exist? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Please enter commit message
General Practices ,[object Object],[object Object],[object Object]
Set register_globals = Off
Set magic_quotes = Off  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Set error_reporting = E_ALL | E_STRICT ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Set short_open_tag = 0   ,[object Object],[object Object],[object Object],[object Object],[object Object]
No direct access to the php.ini ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
My Top Two PHP Security   Practices ,[object Object],[object Object],[object Object],[object Object],[object Object]
Filter Input ,[object Object],[object Object],[object Object],[object Object],[object Object]
Filter library examples ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],Escaping Output
Escaping Output ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Questions? ,[object Object]
Contact ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]

More Related Content

What's hot

An Introduction to Test Driven Development
An Introduction to Test Driven Development An Introduction to Test Driven Development
An Introduction to Test Driven Development CodeOps Technologies LLP
 
White Box Testing
White Box TestingWhite Box Testing
White Box TestingMade Aditya
 
Making Mobile Sites Faster
Making Mobile Sites FasterMaking Mobile Sites Faster
Making Mobile Sites FasterAndy Davies
 
Lecture 9 eigenvalues - 5-1 & 5-2
Lecture 9   eigenvalues -  5-1 & 5-2Lecture 9   eigenvalues -  5-1 & 5-2
Lecture 9 eigenvalues - 5-1 & 5-2njit-ronbrown
 
Interaksi Manusia Dan Komputer 6
Interaksi Manusia Dan Komputer 6Interaksi Manusia Dan Komputer 6
Interaksi Manusia Dan Komputer 6Hide Maru
 
16.modul melakukan deployment model (final) v1 1
16.modul melakukan deployment model (final) v1 116.modul melakukan deployment model (final) v1 1
16.modul melakukan deployment model (final) v1 1ArdianDwiPraba
 
Тема 4. Технології інтеграції даних.
Тема 4. Технології інтеграції даних.Тема 4. Технології інтеграції даних.
Тема 4. Технології інтеграції даних.Oleg Nazarevych
 
Perancangan Data Warehouse (Logical dan Physical)
Perancangan Data Warehouse (Logical dan Physical)Perancangan Data Warehouse (Logical dan Physical)
Perancangan Data Warehouse (Logical dan Physical)dedidarwis
 
Software Requirement Specification SRS
Software Requirement Specification SRSSoftware Requirement Specification SRS
Software Requirement Specification SRSSeptian Rico Hernawan
 

What's hot (14)

Kode etik profesi it
Kode etik profesi itKode etik profesi it
Kode etik profesi it
 
An Introduction to Test Driven Development
An Introduction to Test Driven Development An Introduction to Test Driven Development
An Introduction to Test Driven Development
 
White Box Testing
White Box TestingWhite Box Testing
White Box Testing
 
Making Mobile Sites Faster
Making Mobile Sites FasterMaking Mobile Sites Faster
Making Mobile Sites Faster
 
Buku grafkom
Buku grafkomBuku grafkom
Buku grafkom
 
Jest və mimika
Jest və mimikaJest və mimika
Jest və mimika
 
Lecture 9 eigenvalues - 5-1 & 5-2
Lecture 9   eigenvalues -  5-1 & 5-2Lecture 9   eigenvalues -  5-1 & 5-2
Lecture 9 eigenvalues - 5-1 & 5-2
 
Pmi code of ethics
Pmi code of ethicsPmi code of ethics
Pmi code of ethics
 
Interaksi Manusia Dan Komputer 6
Interaksi Manusia Dan Komputer 6Interaksi Manusia Dan Komputer 6
Interaksi Manusia Dan Komputer 6
 
Web Service
Web ServiceWeb Service
Web Service
 
16.modul melakukan deployment model (final) v1 1
16.modul melakukan deployment model (final) v1 116.modul melakukan deployment model (final) v1 1
16.modul melakukan deployment model (final) v1 1
 
Тема 4. Технології інтеграції даних.
Тема 4. Технології інтеграції даних.Тема 4. Технології інтеграції даних.
Тема 4. Технології інтеграції даних.
 
Perancangan Data Warehouse (Logical dan Physical)
Perancangan Data Warehouse (Logical dan Physical)Perancangan Data Warehouse (Logical dan Physical)
Perancangan Data Warehouse (Logical dan Physical)
 
Software Requirement Specification SRS
Software Requirement Specification SRSSoftware Requirement Specification SRS
Software Requirement Specification SRS
 

Viewers also liked

GermaniumWeb for Barcamp Singapore 5
GermaniumWeb for Barcamp Singapore 5GermaniumWeb for Barcamp Singapore 5
GermaniumWeb for Barcamp Singapore 5G Element Pte Ltd
 
จิณัฐตา 205
จิณัฐตา 205จิณัฐตา 205
จิณัฐตา 205jinutta
 
จิณัฐตา 205
จิณัฐตา 205จิณัฐตา 205
จิณัฐตา 205jinutta
 
Preso. Brecha Digital
Preso. Brecha DigitalPreso. Brecha Digital
Preso. Brecha Digitaljosebalde
 
とちぎRuby会議02
とちぎRuby会議02とちぎRuby会議02
とちぎRuby会議02akira yamada
 
Php Best Practices
Php Best PracticesPhp Best Practices
Php Best PracticesAnsar Ahmed
 
Ppt For Contractors 2009 97 To 2000 Version
Ppt For Contractors 2009 97 To 2000 VersionPpt For Contractors 2009 97 To 2000 Version
Ppt For Contractors 2009 97 To 2000 VersionBob Shepard
 
United Colors Of Benetton Presentation
United Colors Of Benetton PresentationUnited Colors Of Benetton Presentation
United Colors Of Benetton PresentationSwati Kaushik
 

Viewers also liked (13)

GermaniumWeb for Barcamp Singapore 5
GermaniumWeb for Barcamp Singapore 5GermaniumWeb for Barcamp Singapore 5
GermaniumWeb for Barcamp Singapore 5
 
TFI Rates
TFI RatesTFI Rates
TFI Rates
 
จิณัฐตา 205
จิณัฐตา 205จิณัฐตา 205
จิณัฐตา 205
 
Blogs2016
Blogs2016Blogs2016
Blogs2016
 
จิณัฐตา 205
จิณัฐตา 205จิณัฐตา 205
จิณัฐตา 205
 
Preso. Brecha Digital
Preso. Brecha DigitalPreso. Brecha Digital
Preso. Brecha Digital
 
Germanium CXA 2010 launch
Germanium CXA 2010 launchGermanium CXA 2010 launch
Germanium CXA 2010 launch
 
New Media
New MediaNew Media
New Media
 
とちぎRuby会議02
とちぎRuby会議02とちぎRuby会議02
とちぎRuby会議02
 
Php Best Practices
Php Best PracticesPhp Best Practices
Php Best Practices
 
Come sviluppare un progetto completo
Come sviluppare un progetto completo Come sviluppare un progetto completo
Come sviluppare un progetto completo
 
Ppt For Contractors 2009 97 To 2000 Version
Ppt For Contractors 2009 97 To 2000 VersionPpt For Contractors 2009 97 To 2000 Version
Ppt For Contractors 2009 97 To 2000 Version
 
United Colors Of Benetton Presentation
United Colors Of Benetton PresentationUnited Colors Of Benetton Presentation
United Colors Of Benetton Presentation
 

Similar to Php Best Practices

Joomla! Day Chicago 2011 Presentation - Steven Pignataro
Joomla! Day Chicago 2011 Presentation - Steven PignataroJoomla! Day Chicago 2011 Presentation - Steven Pignataro
Joomla! Day Chicago 2011 Presentation - Steven PignataroSteven Pignataro
 
Simplify your professional web development with symfony
Simplify your professional web development with symfonySimplify your professional web development with symfony
Simplify your professional web development with symfonyFrancois Zaninotto
 
Getting started with WordPress development
Getting started with WordPress developmentGetting started with WordPress development
Getting started with WordPress developmentSteve Mortiboy
 
Introduction to Google App Engine with Python
Introduction to Google App Engine with PythonIntroduction to Google App Engine with Python
Introduction to Google App Engine with PythonBrian Lyttle
 
Lecture2_IntroductionToPHP_Spring2023.pdf
Lecture2_IntroductionToPHP_Spring2023.pdfLecture2_IntroductionToPHP_Spring2023.pdf
Lecture2_IntroductionToPHP_Spring2023.pdfShaimaaMohamedGalal
 
Php i basic chapter 3 (afifah rosli's conflicted copy 2013-04-23)
Php i basic chapter 3 (afifah rosli's conflicted copy 2013-04-23)Php i basic chapter 3 (afifah rosli's conflicted copy 2013-04-23)
Php i basic chapter 3 (afifah rosli's conflicted copy 2013-04-23)Muhamad Al Imran
 
Php i basic chapter 3 (syahir chaer's conflicted copy 2013-04-22)
Php i basic chapter 3 (syahir chaer's conflicted copy 2013-04-22)Php i basic chapter 3 (syahir chaer's conflicted copy 2013-04-22)
Php i basic chapter 3 (syahir chaer's conflicted copy 2013-04-22)Muhamad Al Imran
 
Justmeans power point
Justmeans power pointJustmeans power point
Justmeans power pointjustmeanscsr
 
Justmeans power point
Justmeans power pointJustmeans power point
Justmeans power pointjustmeanscsr
 
Justmeans power point
Justmeans power pointJustmeans power point
Justmeans power pointjustmeanscsr
 
Justmeans power point
Justmeans power pointJustmeans power point
Justmeans power pointjustmeanscsr
 
Justmeans power point
Justmeans power pointJustmeans power point
Justmeans power pointjustmeanscsr
 
Justmeans power point
Justmeans power pointJustmeans power point
Justmeans power pointjustmeanscsr
 

Similar to Php Best Practices (20)

Php
PhpPhp
Php
 
Php Ppt
Php PptPhp Ppt
Php Ppt
 
Joomla! Day Chicago 2011 Presentation - Steven Pignataro
Joomla! Day Chicago 2011 Presentation - Steven PignataroJoomla! Day Chicago 2011 Presentation - Steven Pignataro
Joomla! Day Chicago 2011 Presentation - Steven Pignataro
 
Basics PHP
Basics PHPBasics PHP
Basics PHP
 
Simplify your professional web development with symfony
Simplify your professional web development with symfonySimplify your professional web development with symfony
Simplify your professional web development with symfony
 
Getting started with WordPress development
Getting started with WordPress developmentGetting started with WordPress development
Getting started with WordPress development
 
Php
PhpPhp
Php
 
Introduction to Google App Engine with Python
Introduction to Google App Engine with PythonIntroduction to Google App Engine with Python
Introduction to Google App Engine with Python
 
Xdebug
XdebugXdebug
Xdebug
 
Lecture2_IntroductionToPHP_Spring2023.pdf
Lecture2_IntroductionToPHP_Spring2023.pdfLecture2_IntroductionToPHP_Spring2023.pdf
Lecture2_IntroductionToPHP_Spring2023.pdf
 
Php i basic chapter 3 (afifah rosli's conflicted copy 2013-04-23)
Php i basic chapter 3 (afifah rosli's conflicted copy 2013-04-23)Php i basic chapter 3 (afifah rosli's conflicted copy 2013-04-23)
Php i basic chapter 3 (afifah rosli's conflicted copy 2013-04-23)
 
Php i basic chapter 3
Php i basic chapter 3Php i basic chapter 3
Php i basic chapter 3
 
Php i basic chapter 3 (syahir chaer's conflicted copy 2013-04-22)
Php i basic chapter 3 (syahir chaer's conflicted copy 2013-04-22)Php i basic chapter 3 (syahir chaer's conflicted copy 2013-04-22)
Php i basic chapter 3 (syahir chaer's conflicted copy 2013-04-22)
 
Php documentor
Php documentorPhp documentor
Php documentor
 
Justmeans power point
Justmeans power pointJustmeans power point
Justmeans power point
 
Justmeans power point
Justmeans power pointJustmeans power point
Justmeans power point
 
Justmeans power point
Justmeans power pointJustmeans power point
Justmeans power point
 
Justmeans power point
Justmeans power pointJustmeans power point
Justmeans power point
 
Justmeans power point
Justmeans power pointJustmeans power point
Justmeans power point
 
Justmeans power point
Justmeans power pointJustmeans power point
Justmeans power point
 

Recently uploaded

Automation Ops Series: Session 2 - Governance for UiPath projects
Automation Ops Series: Session 2 - Governance for UiPath projectsAutomation Ops Series: Session 2 - Governance for UiPath projects
Automation Ops Series: Session 2 - Governance for UiPath projectsDianaGray10
 
My key hands-on projects in Quantum, and QAI
My key hands-on projects in Quantum, and QAIMy key hands-on projects in Quantum, and QAI
My key hands-on projects in Quantum, and QAIVijayananda Mohire
 
2024.03.12 Cost drivers of cultivated meat production.pdf
2024.03.12 Cost drivers of cultivated meat production.pdf2024.03.12 Cost drivers of cultivated meat production.pdf
2024.03.12 Cost drivers of cultivated meat production.pdfThe Good Food Institute
 
EMEA What is ThousandEyes? Webinar
EMEA What is ThousandEyes? WebinarEMEA What is ThousandEyes? Webinar
EMEA What is ThousandEyes? WebinarThousandEyes
 
Emil Eifrem at GraphSummit Copenhagen 2024 - The Art of the Possible.pptx
Emil Eifrem at GraphSummit Copenhagen 2024 - The Art of the Possible.pptxEmil Eifrem at GraphSummit Copenhagen 2024 - The Art of the Possible.pptx
Emil Eifrem at GraphSummit Copenhagen 2024 - The Art of the Possible.pptxNeo4j
 
Explore the UiPath Community and ways you can benefit on your journey to auto...
Explore the UiPath Community and ways you can benefit on your journey to auto...Explore the UiPath Community and ways you can benefit on your journey to auto...
Explore the UiPath Community and ways you can benefit on your journey to auto...DianaGray10
 
March Patch Tuesday
March Patch TuesdayMarch Patch Tuesday
March Patch TuesdayIvanti
 
Q4 2023 Quarterly Investor Presentation - FINAL - v1.pdf
Q4 2023 Quarterly Investor Presentation - FINAL - v1.pdfQ4 2023 Quarterly Investor Presentation - FINAL - v1.pdf
Q4 2023 Quarterly Investor Presentation - FINAL - v1.pdfTejal81
 
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightSafe Software
 
Extra-120324-Visite-Entreprise-icare.pdf
Extra-120324-Visite-Entreprise-icare.pdfExtra-120324-Visite-Entreprise-icare.pdf
Extra-120324-Visite-Entreprise-icare.pdfInfopole1
 
Trailblazer Community - Flows Workshop (Session 2)
Trailblazer Community - Flows Workshop (Session 2)Trailblazer Community - Flows Workshop (Session 2)
Trailblazer Community - Flows Workshop (Session 2)Muhammad Tiham Siddiqui
 
TrustArc Webinar - How to Live in a Post Third-Party Cookie World
TrustArc Webinar - How to Live in a Post Third-Party Cookie WorldTrustArc Webinar - How to Live in a Post Third-Party Cookie World
TrustArc Webinar - How to Live in a Post Third-Party Cookie WorldTrustArc
 
Flow Control | Block Size | ST Min | First Frame
Flow Control | Block Size | ST Min | First FrameFlow Control | Block Size | ST Min | First Frame
Flow Control | Block Size | ST Min | First FrameKapil Thakar
 
Graphene Quantum Dots-Based Composites for Biomedical Applications
Graphene Quantum Dots-Based Composites for  Biomedical ApplicationsGraphene Quantum Dots-Based Composites for  Biomedical Applications
Graphene Quantum Dots-Based Composites for Biomedical Applicationsnooralam814309
 
.NET 8 ChatBot with Azure OpenAI Services.pptx
.NET 8 ChatBot with Azure OpenAI Services.pptx.NET 8 ChatBot with Azure OpenAI Services.pptx
.NET 8 ChatBot with Azure OpenAI Services.pptxHansamali Gamage
 
UiPath Studio Web workshop series - Day 4
UiPath Studio Web workshop series - Day 4UiPath Studio Web workshop series - Day 4
UiPath Studio Web workshop series - Day 4DianaGray10
 
From the origin to the future of Open Source model and business
From the origin to the future of  Open Source model and businessFrom the origin to the future of  Open Source model and business
From the origin to the future of Open Source model and businessFrancesco Corti
 
Design and Modeling for MySQL SCALE 21X Pasadena, CA Mar 2024
Design and Modeling for MySQL SCALE 21X Pasadena, CA Mar 2024Design and Modeling for MySQL SCALE 21X Pasadena, CA Mar 2024
Design and Modeling for MySQL SCALE 21X Pasadena, CA Mar 2024Alkin Tezuysal
 
Technical SEO for Improved Accessibility WTS FEST
Technical SEO for Improved Accessibility  WTS FESTTechnical SEO for Improved Accessibility  WTS FEST
Technical SEO for Improved Accessibility WTS FESTBillieHyde
 
CyberSecurity - Computers In Libraries 2024
CyberSecurity - Computers In Libraries 2024CyberSecurity - Computers In Libraries 2024
CyberSecurity - Computers In Libraries 2024Brian Pichman
 

Recently uploaded (20)

Automation Ops Series: Session 2 - Governance for UiPath projects
Automation Ops Series: Session 2 - Governance for UiPath projectsAutomation Ops Series: Session 2 - Governance for UiPath projects
Automation Ops Series: Session 2 - Governance for UiPath projects
 
My key hands-on projects in Quantum, and QAI
My key hands-on projects in Quantum, and QAIMy key hands-on projects in Quantum, and QAI
My key hands-on projects in Quantum, and QAI
 
2024.03.12 Cost drivers of cultivated meat production.pdf
2024.03.12 Cost drivers of cultivated meat production.pdf2024.03.12 Cost drivers of cultivated meat production.pdf
2024.03.12 Cost drivers of cultivated meat production.pdf
 
EMEA What is ThousandEyes? Webinar
EMEA What is ThousandEyes? WebinarEMEA What is ThousandEyes? Webinar
EMEA What is ThousandEyes? Webinar
 
Emil Eifrem at GraphSummit Copenhagen 2024 - The Art of the Possible.pptx
Emil Eifrem at GraphSummit Copenhagen 2024 - The Art of the Possible.pptxEmil Eifrem at GraphSummit Copenhagen 2024 - The Art of the Possible.pptx
Emil Eifrem at GraphSummit Copenhagen 2024 - The Art of the Possible.pptx
 
Explore the UiPath Community and ways you can benefit on your journey to auto...
Explore the UiPath Community and ways you can benefit on your journey to auto...Explore the UiPath Community and ways you can benefit on your journey to auto...
Explore the UiPath Community and ways you can benefit on your journey to auto...
 
March Patch Tuesday
March Patch TuesdayMarch Patch Tuesday
March Patch Tuesday
 
Q4 2023 Quarterly Investor Presentation - FINAL - v1.pdf
Q4 2023 Quarterly Investor Presentation - FINAL - v1.pdfQ4 2023 Quarterly Investor Presentation - FINAL - v1.pdf
Q4 2023 Quarterly Investor Presentation - FINAL - v1.pdf
 
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and Insight
 
Extra-120324-Visite-Entreprise-icare.pdf
Extra-120324-Visite-Entreprise-icare.pdfExtra-120324-Visite-Entreprise-icare.pdf
Extra-120324-Visite-Entreprise-icare.pdf
 
Trailblazer Community - Flows Workshop (Session 2)
Trailblazer Community - Flows Workshop (Session 2)Trailblazer Community - Flows Workshop (Session 2)
Trailblazer Community - Flows Workshop (Session 2)
 
TrustArc Webinar - How to Live in a Post Third-Party Cookie World
TrustArc Webinar - How to Live in a Post Third-Party Cookie WorldTrustArc Webinar - How to Live in a Post Third-Party Cookie World
TrustArc Webinar - How to Live in a Post Third-Party Cookie World
 
Flow Control | Block Size | ST Min | First Frame
Flow Control | Block Size | ST Min | First FrameFlow Control | Block Size | ST Min | First Frame
Flow Control | Block Size | ST Min | First Frame
 
Graphene Quantum Dots-Based Composites for Biomedical Applications
Graphene Quantum Dots-Based Composites for  Biomedical ApplicationsGraphene Quantum Dots-Based Composites for  Biomedical Applications
Graphene Quantum Dots-Based Composites for Biomedical Applications
 
.NET 8 ChatBot with Azure OpenAI Services.pptx
.NET 8 ChatBot with Azure OpenAI Services.pptx.NET 8 ChatBot with Azure OpenAI Services.pptx
.NET 8 ChatBot with Azure OpenAI Services.pptx
 
UiPath Studio Web workshop series - Day 4
UiPath Studio Web workshop series - Day 4UiPath Studio Web workshop series - Day 4
UiPath Studio Web workshop series - Day 4
 
From the origin to the future of Open Source model and business
From the origin to the future of  Open Source model and businessFrom the origin to the future of  Open Source model and business
From the origin to the future of Open Source model and business
 
Design and Modeling for MySQL SCALE 21X Pasadena, CA Mar 2024
Design and Modeling for MySQL SCALE 21X Pasadena, CA Mar 2024Design and Modeling for MySQL SCALE 21X Pasadena, CA Mar 2024
Design and Modeling for MySQL SCALE 21X Pasadena, CA Mar 2024
 
Technical SEO for Improved Accessibility WTS FEST
Technical SEO for Improved Accessibility  WTS FESTTechnical SEO for Improved Accessibility  WTS FEST
Technical SEO for Improved Accessibility WTS FEST
 
CyberSecurity - Computers In Libraries 2024
CyberSecurity - Computers In Libraries 2024CyberSecurity - Computers In Libraries 2024
CyberSecurity - Computers In Libraries 2024
 

Php Best Practices