1 / 23

Scripting The Web

Scripting The Web. Software Freedom Day 2007 14th September 2007 Asia Pacific Institute of Information Technology Colombo, Sri Lanka. Nazly Ahmed <me@nazly.net>. Agenda. What is PHP? History Getting Started Features Extensions Frameworks. What is PHP?. PHP : Hypertext Preprocessor

lee
Download Presentation

Scripting The Web

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Scripting The Web Software Freedom Day 2007 14th September 2007 Asia Pacific Institute of Information Technology Colombo, Sri Lanka. Nazly Ahmed <me@nazly.net>

  2. Agenda What is PHP? History Getting Started Features Extensions Frameworks

  3. What is PHP? PHP : Hypertext Preprocessor PHP is a Server-side Scripting Language which can be embedded into HTML Any PHP tag will be replaced by the Server before its sent back to the client browser Can be used to collect form data, generate dynamic page content, send and receive cookiesand much more It’s Open Source – Apache like BSD-style license

  4. Server-side

  5. If the PHP file contains Server-side What the end user would get

  6. History of PHP • Created by Rasmus Lerdorf in 1995 • Perl like syntax • Was able to connect with databases • Enabled users to develop simple Dynamic Web Applications • Code was released for everybody to see PHP/FI : Personal Home Page / Forms Interpreter

  7. History of PHP • Released in November 1997 • Several people contributing bits of code to this project but still a one-man project. • Several thousand users around the world • 50,000 domains reported to have been installed. PHP/FI 2.0

  8. History of PHP • Created by Andi Gutmans and Zeev Suraski in 1997 as a complete rewrite • Solid infrastructure for lots of different databases, protocols and APIs • Contains strong extensibility features • Object oriented syntax support • Powerful and consistent language syntax • It was named plain 'PHP', with the meaning being a recursive acronym - PHP: Hypertext Preprocessor • Officially released in June 1998 • Installed on 10% of the Web Servers on the Internet PHP 3.0

  9. History of PHP • Officially released in May 2000. • Rewrite of PHP's core to improve performance of complex applications, and improve the modularity of PHP's code base. • The new engine, named 'Zend Engine' • Support for many more Web servers, HTTP sessions, output buffering, more secure ways of handling user input and several new language constructs • Installed on 20% of the Web Servers on the Internet PHP 4.0

  10. History of PHP • Officially released in July 2004. • Mainly driven by its core, the Zend Engine 2.0 with a new object model and dozens of other new features • Allows the developers to use the full set of object-oriented features • Installed on 34% of the Web Servers on the Internet • PHP 5.2.4 is the latest stable release. PHP 5.0

  11. PHP Usage PHP: 20,016,421 domains, 1,208,663 IP addresses

  12. Who uses PHP?

  13. Projects Powered by PHP

  14. For Server-side Scripting • The PHP parser (CGI or server module) • A Web Server • A Web Browser • Supports all major Operating Systems Linux, many Unix variants (including HP-UX, Solaris and OpenBSD), Microsoft Windows, Mac OS X • Supports most of the Web Servers Apache, Microsoft IIS, Netscape and iPlanet servers, Oreilly Website Pro server, Caudium, Xitami, OmniHTTPd, and many others. • Download the latest stable release of PHP from http://www.php.net/downloads • Online Manual : http://www.php.net/manual/ Getting Started

  15. Long list of internal (built-in) functions • Full set of OOP features Allows the developers to use the full set of object-oriented features which lacked in PHP4. • Improved MySQL support MySQLi, the MySQL Improved extension offers prepared statements, bound parameters and SSL connections. It also takes advantage of PHP5's new object-oriented support to provide an object-oriented interface to MySQL. Features of PHP (5.0)

  16. Easy handling of XML with SimpleXML The SimpleXML extension provides a very simple and easily usable toolset to convert XML to an object which can be easily processed. • Sessions support Session support in PHP consists of a way to preserve certain data across subsequent accesses. • Bundled SQLite SQLite is a small C library that implements a self-contained, embeddable, zero-configuration SQL database engine Features of PHP (5.0)

  17. Error handling using exceptions PHP 5 offers a completely different model of error checking than what's available in PHP 4. It's called exception handling. With exceptions you can separate programming logic from error handling and place them in adjoining blocks of code • Streams and Filters A way of generalizing file, network, data compression, and other operations which share a common set of functions and uses A filter is a final piece of code which may perform operations on data as it is being read from or written to a stream. php:// http://, https://, ftp://, ftps:// compression.gzip://, compression.bz2:// php://filter Features of PHP (5.0)

  18. PEAR : PHP Extension and Application Repository Reusable PHP Components PEAR is a framework and distribution system for reusable PHP components. Consists reusable components for Database, Encryption, Images, Web Services, Authentication, Date and Time, Mail and much more. http://pear.php.net

  19. PECL : PHP Extension Community Library Extensions PECL is a repository for PHP Extensions, providing a directory of all known extensions and hosting facilities for downloading and development of PHP extensions. Consists extension for Database, Encryption, Images, Web Services, Authentication, Date and Time, Mail and much more. http://pecl.php.net

  20. A structured framework that enables PHP users at all levels to rapidly develop robust web applications, without any loss to flexibility. PHP Frameworks • Compatibility with PHP4 and PHP5 • Integrated CRUD for database • Interaction and simplified queries • Application Scaffolding • Model View Controller (MVC) Architecture • Custom URLs • Fast and flexible templating • View Helpers for AJAX, Javascript, HTML Forms and more http://www.cakephp.org/

  21. Few other PHP Frameworks that are available PHP Frameworks http://framework.zend.com/ http://www.symfony-project.com/ http://www.codeigniter.com/

  22. Resources PHP : http://www.php.net MySQL : http://www.mysql.com SQLite : http://www.sqlite.org PEAR : http://pear.php.net PECL : http://pecl.php.net

  23. Questions?

More Related