Web development with PHP. Kore Nordmann, Tobias Schlitt, Jakob Westhoff Dortmund

Similar documents
Index. Note: Boldface numbers indicate code and illustrations; an italic t indicates a table.

COMS 469: Interactive Media II

Give Your Site a Boost With memcached. Ben Ramsey

PHP Hypertext Preprocessor: Tools for Webpage Management. Michael Watson ICTN

PHP6 AND MYSQL BIBLE BY STEVE SUEHRING, TIM CONVERSE, JOYCE PARK

RAD Studio XE Datasheet

Princess Nourah bint Abdulrahman University. Computer Sciences Department

Java EE,.NET and PHP

Give Your Site a Boost With memcached. Ben Ramsey

Optimizing LAMP Development with PHP5

DATABASE SYSTEMS. Introduction to web programming. Database Systems Course, 2016

Improve Web Application Performance with Zend Platform

CS50 Quiz Review. November 13, 2017

Let's Play... Try to name the databases described on the following slides...

SINGLE NODE SETUP APACHE HADOOP

Real Life Web Development. Joseph Paul Cohen

Servlet Performance and Apache JServ

How To Install Pear Db In Xampp Windows 7 64 Bit >>>CLICK HERE<<<

Zend PHP 5 Certification Webinar

Agenda. 1. Brief History of PHP. 2. Getting started. 3. Examples

Zend Technologies and System i

Give Your Site A Boost With Memcache. Ben Ramsey September 25, 2009

INTRODUCTION TO ZEND FRAMEWORK

Real World Web Scalability. Ask Bjørn Hansen Develooper LLC

PHP. MIT 6.470, IAP 2010 Yafim Landa

DATABASE SYSTEMS. Introduction to MySQL. Database System Course, 2016

But before understanding the Selenium WebDriver concept, we need to know about the Selenium first.

Full Stack Web Developer

DATABASE SYSTEMS. Database programming in a web environment. Database System Course, 2016

(p t y) lt d. 1995/04149/07. Course List 2018

PHP 5 and Databases. Marcus Börger Sterling Hughes. International PHP2003 conference

OSSW ICOSST 2009, Al-Khawarizmi Institute of Computer Science University of Engineering and Technology, Lahore

Web Application Development (WAD) V th Sem BBAITM(Unit-1) By: Binit Patel

Expert Guidance on Migrating from Magento 1 to Magento 2

Beginning PHP. and MySQL. Fourth Edition. From Novice to Professional. W. Jason Gilmore. mmm

Epub Books Programming PHP

Leveraging the Open Source Applications Ecosystem with IBM i

Take a Load Off with U2 RESTful Web Services. Nik Kesic, Lead Technical Support for Rocket U2

Review. Fundamentals of Website Development. Web Extensions Server side & Where is your JOB? The Department of Computer Science 11/30/2015

Tutorial Point Servlets Pdf

ORACLE APPLICATION EXPRESS, ORACLE REST DATA SERVICES, & WEBLOGIC 12C AUTHOR: BRAD GIBSON SENIOR SOLUTIONS ARCHITECT ADVIZEX

Instructor s Notes Web Data Management Web Client/Server Concepts. Web Data Management Web Client/Server Concepts

Copyright 2014 Blue Net Corporation. All rights reserved

CNIT 129S: Securing Web Applications. Ch 3: Web Application Technologies

UFCEKG Lecture 4 Server Side Scripting & PHP

CLOUD COMPUTING It's about the data. Dr. Jim Baty Distinguished Engineer Chief Architect, VP / CTO Global Sales & Services, Sun Microsystems

N different strategies to automate OWASP ZAP

Improve WordPress performance with caching and deferred execution of code. Danilo Ercoli Software Engineer

Java Servlet Programming Download Free (EPUB, PDF)

The Z-Files: Field reports from the world of business critical PHP applications

Data Access and Analysis with Distributed, Federated Data Servers in climateprediction.net

Seminar in Programming Languages

Programming: C ++ Programming : Programming Language For Beginners: LEARN IN A DAY! (Swift, Apps, Javascript, PHP, Python, Sql, HTML) By Os Swift

AJAX: From the Client-side with JavaScript, Back to the Server

Monitoring MySQL with Prometheus & Grafana

Architecting C++ apps

Common Optimization Mistakes

PHP for PL/SQL Developers. Lewis Cunningham JP Morgan Chase

JavaScript and PHP. JavaScript and PHP. DD1335 (Lecture 8) Basic Internet Programming Spring / 26

Speech 2 Part 2 Transcript: The role of DB2 in Web 2.0 and in the IOD World

Varargs Training & Software Development Centre Private Limited, Module: HTML5, CSS3 & JavaScript

Delphi XE. Delphi XE Datasheet

Getting. Started with. smash. IBM WebSphere. Ron Lynn, Karl Bishop, Brett King

intl me this, intl me that Andrei Zmievski Chief Architect Outspark

Eric Farrar Product Manager

DATABASE SYSTEMS. Introduction to MySQL. Database System Course, 2016

Common Optimization Mistakes

Hands-On Perl Scripting and CGI Programming

SERVICE-ORIENTED COMPUTING

Architecture Proposal for an Internet Services Charging Platform

FILE - JAVA WEB SERVICE TUTORIAL

Web technologies. Web. basic components. embellishments in browser. DOM (document object model)

PHP & MySQL For Dummies, 4th Edition PDF

PHP 6 & The PHP Collaboration Project Present & Future. Zeev Suraski Co-founder & CTO, Zend Technologies Co-architect of PHP

E : Web Application Servers. Architecture and Design

Preventing Injection Vulnerabilities through Context-Sensitive String Evaluation (CSSE)

DOC // JAVA TOMCAT WEB SERVICES TUTORIAL EBOOK

Developer Internship Opportunity at I-CC

Excerpts of Web Application Security focusing on Data Validation. adapted for F.I.S.T. 2004, Frankfurt

COS 333: Advanced Programming Techniques

PHP. Lab. de Bases de Dados e Aplicações Web MIEIC, FEUP 2010/11. Sérgio Nunes

Part 3: Online Social Networks

DATABASE SYSTEMS. Database programming in a web environment. Database System Course,

PHP and MySQL Programming

Databases on the web

13. Databases on the Web

Inside COM+: Base Services (Microsoft Programming Series) Ebooks Free

Javascript Coding Interview Questions And Answers In C++ Pdfs >>>CLICK HERE<<<

COS 333: Advanced Programming Techniques. Robert M. Dondero, Ph.D. Princeton University

JAVA TM SERVER AND SERVLETS BUILDING PORTABLE WEB APPLICATIONS

The User in the Loop Extensibility, Guile, and GNU GNU Hackers Meeting 2011 Andy Wingo

What is REST? ; Erik Wilde ; UC Berkeley School of Information

Part I. Web Technologies for Interactive Multimedia

Using JavaScript on Client and Server with Project Phobos

Using XMLSERVICE with.net

"Charting the Course... Intermediate PHP & MySQL Course Summary

Installer Apache Manually Win7 7 Php Mysql Survey

ReST 2000 Roy Fielding W3C

COS 333: Advanced Programming Techniques. Copyright 2017 by Robert M. Dondero, Ph.D. Princeton University

Building a Scalable Architecture for Web Apps - Part I (Lessons Directi)

Transcription:

Web development with PHP Kore Nordmann, Tobias Schlitt, Jakob Westhoff Dortmund 29.06.09

Speaker Jakob Westhoff <jakob@php.net> Kore Nordmann <kore@php.net> Tobias Schlitt <toby@php.net> Active in various PHP related open source projects PHPUnit ez Components PEAR PHP itself Speaker on various webtechnology related conferences International PHP Conference Dynamic Languages World FrOSCon Regular authors in various magzines PHP Magazine Linux Magazine 2

Agenda History Architecture The easy way Object orientation Database access Templating Security Common infrastructure 3

General Please ask! Whenever a question occurs How stupid you think the question might be Slides will be online later today on http://udo.edu/.../php.zip 4

What is PHP? Most important programming language in the web Fourth popular language (TIOBE) Easy to learn Web-centric, but not web-only CLI GTK Embedded Portable 5

Who uses PHP? Do you? What do you do with PHP? Do you like / hate PHP? Did you already use PHP 4 (maybe even 3)? In the real world: Yahoo, Facebook, StudiVZ, Wikipedia,... Siemens, T-Online,... Add $bigcompany here 6

Use Case: StudiVZ 550 High-End-Server 2,200 Processor Cores 7,000 GB RAM Peek 4,300 Mbit / sec. Peek 150,000 database queries / sec. Statistics estimated in June 2009 7

Open Source Vital Open Source community Professionals Zend (Zend Engine 2) IBM (Project Zero) Yahoo! (APC) ez Systems (Xdebug) Volunteers Extension developers Testers Documentors (12 languages) User-space libraries (PEAR, Zend Framework, ez Components,...) 8

Agenda History The past The present The future Architecture The easy way Object orientation Database access Templating Security Common infrastructure 9

The past PHP/FI (Personal Homepage Tools / Form Interpreter) Collection of Perl scripts from Rasmus Lerdorf Converted to C a bit later PHP 3 (PHP Hypertext Precessor) Rewrite by Andi Gutmans and Zeev Suraski Zend develops the Zend Engine 1 PHP 4 Merges parts of PHPlib (Sessions) Very simple object orientation 10

The present PHP 5 / Zend Engine 2 Real object orientation Important features (currently 5.2.9) Better XML handling Database abstraction layer Speed improvements PHP 5 has actually been released four years ago. Support for PHP 4 has officially been dropped end 2007. 11

The future PHP 5.3 (right ahead, today?) Namespaces Late static binding Closures / lambda functions Goto (sic!) PHP 6 (no promises!) Native Unicode support Traits Cleanup of deprecated features Register globals Safe mode... 12

Agenda History Architecture Language properties Share nothing Installation Documentation The easy way Object orientation Database access Templating Security Common infrastructure 13

Tim Bray (Sun) 2006: 14

Language properties (1/2) Typing: Dynamic (similar to Python, Perl) Weak (similar to JavaScript, Python, Ruby) Paradigms Imperative Procedural Object oriented Functional Structured (Aspect oriented) Freedom vs. Clarity 15

Language properties (2/2) Libraries PHP uses C/C++ libraries as extensions Several core extensions Standard Array... Optional extensions shipped with the core Additional extensions installable via PECL 16

Share nothing Designed for HTTP Stateless Resources are freed at the end of a request Environment reinitilisation No application server Persistent states in shared memory RAM memcache / APC /... File systems Databases Threadsafe environment No threading in language 17

Installation Normally used inside a web server Apache Lighttpd Standalone applications possible Interfacing through: mod_php FCGI (clustering) CGI http://www.php.net/manual/en/install.php 18

PEAR Installer Unified installation infrastructure for PHP Manage PHP code packages C-Extensions to PHP Channel support Provide your own code via PEAR Installer Application setup facilities Pre- / post install scripts Shipped with PHP since 4.3.0 19

Documentation http://docs.php.net/(extension function class) Good coverage of core functions / classes English version very up to date Translations sometimes outdated Books Many many books... Magazines PHP Magazin (http://it-republik.de/php/) php architect (http://www.phparch.com/) 20

Agenda History Architecture The easy way Request / response handling PHP by example Object orientation Database access Templating Security Common infrastructure 21

Request handling Request data is available in superglobal arrays $_ GET $_POST $_COOKIE $_FILES ($_SERVER / $_ENV) Live example: Simple form 22

Session handling Session data in superglobal array $_SESSION Data stored serialized in: File system (standard) User extendable Memcache (-server) Database Session-user-association: Trans-ID Cookie Live example: Simple extended form 23

Agenda History Architecture The easy way Object orientation Example Specialities Database access Templating Security Common infrastructure 24

OOP Features Classes Methods Attributes Constants Ctor / Dtor Scopes Interfaces Abstract classes Static 25

Live example OOP in PHP 26

Specialities Autoloading Type hints Interceptors 27

Agenda History Architecture The easy way Database access Templating Security Common infrastructure 28

Supported databases Mysql Oracle PostgreSQL Sqlite Firebird MSSQL DB2... 29

PDO PDO = PHP Data Objects Object oriented interface Standardised API (kind of) No SQL abstraction No automatic data persistence 30

Database abstraction Abstraction layers written in PHP instead of C SQL abstraction ez Database PEAR MDB2 Active record -like implementations PEAR DB_DataObject (PHP 4) ez PersistentObject (PHP 5) Zend ActiveRecord 31

Agenda History Architecture The easy way Database access Templating Security Common infrastructure 32

PHP is a templating language Original idea for PHP Problems PHP got too powerful User provided templates (security!) No automatic output escaping (security) Designers don't want to write real code 33

Template languages Restricted functionality Automatic output escaping Simple syntax Highly specialized template languages written in PHP Smarty ez Template PHPTAL... 34

Agenda History Architecture The easy way Database access Templating Security Common infrastructure 35

Is PHP an unsafe language? Security problems are not language specific There are bugs in all language interpreters / virtual machines The web environment is an easy target ext/filter for general input filtering Global prefiltering 36

Agenda History Architecture Easy as in... Database access Templating Security Common infrastructure 37

Related technology (1/2) Bytecode caches APC (open source) Zend Performance Suite (commercial) XML 4 different APIs JSON Integrated Webservices XML-RPC SOAP REST 38

Related technology (2/2) Development tools IDEs Standalone Debuggers Testing Unit Testing (PHPUnit) Acceptance testing (Selenium) 39

Conclusion PHP is easy and fast to hack Beginners might publish (unsecure) apps C-like syntax Object orientation Re-usable components Good web architecture still not easy PHP gives you freedom PHP scales Development wise Performance wise Customer wise 40

Thank you for listening Any questions? Kore Nordmann <kore@php.net> Tobias Schlitt <toby@php.net> Jakob Westhoff <jakob@php.net> We hope you enjoyed the session If you like PHP and Open Source in general Free and Open Source Conference (FrOSCon) 2009-08-22 / 23 St. Augustin (Bonn) Original Linuxtag -like atmosphere (and better) http://froscon.de 41