1 / 33

PHP: Hypertext Preprocessor

This detailed overview covers the evolution of PHP from its inception by Rasmus Lerdorf in 1995 through major milestones like PHP 3 and the Zend Engine. Explore frameworks such as Yii, CodeIgniter, and Symfony, alongside libraries like PEAR. Learn about advanced concepts in object-oriented PHP, including user-level overloading, sessions, and cookies. With practical examples of PHP CLI, database interactions, and future developments like PHP 6 and Unicode support, this resource is perfect for both beginners and advanced developers seeking to enhance their PHP skills.

gen
Download Presentation

PHP: Hypertext Preprocessor

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. PHP: Hypertext Preprocessor Stephen Corcoran April 9, 2013

  2. Overview • History • Frameworks & Libraries • Object-Oriented PHP • Advance Techniques & Classes • Future • Demo • Questions?

  3. History • RasmusLerdorf • CGI Scripts in Perl • Rewritten in C for better performance • PHP/FI & PHPTools • 1995 Release date

  4. History • AndiGutmans & ZeevSuraski • 1997 PHP 3 • 1999 Zend Engine • 2000 PHP 4

  5. Frameworks • Yii • CodeIgniter • CakePHP • Zend • Symfony

  6. Frameworks • http://phpassist.com/ • http://fuelphp.com/ • http://ucf.github.io/fuelphp-crash-course/

  7. Package & Libraries • Pear • PHP Extension and Application Repository • http://pear.php.net/ • Web forms, form validation, xml parsers • cURL • Client URLs • libcurl (http://curl.haxx.se/libcurl/) • http, https, ftp, telnet, ldap

  8. Object-Oriented • Variable declaration • Object Cloning • User-Level Overloading • Typecasting

  9. Variables • Constants • Define • Global

  10. Constants

  11. Define

  12. Global

  13. Object Cloning • http://pastie.org/private/gtpmhllr0c3hw71x4d0ea

  14. Object Cloning

  15. User-level Overloading • __get() • Utilized for reading data from inaccessible properties • __set() • Utilized for writing data to inaccessible properties • __call() • __callStatic() • __construct() • __destruct() • http://php.net/manual/en/language.oop5.overloading.php

  16. Typecasting • settype() • gettype()

  17. Advanced Techniques & Classes • PHP CLI • SSH • Mail • Sessions & Cookies

  18. PHP CLI • #!/usr/bin/php • Scheduled/ing tasks • Multithreading • Stdin, Stdout, stderr

  19. PHP CLI

  20. SSH • ssh2_connect() • ssh2_execute() • ssh2_fingerprint() • ssh2_auth_password(), pubkey_file(), none() • ssh2_tunnel() • ssh2_mkdir(), rmdir(), chmod(), unlink()

  21. SSH • http://pastie.org/private/t3jbv3dqllqa0hjqyssdaw

  22. Mail • mail($to, $subject, $message, $headers) • $to -> user@domain • $subject -> ‘Subject’ • $message -> ‘Message body’ • $headers -> From, BCC, CC, Reply-To

  23. Mail

  24. Sessions • start_session() • session_destroy() • $_SESSION[]

  25. Sessions

  26. Cookies • setcookie( • name -> name of the cookie • value -> value of cookie ($_COOKIE[‘name’]) • expire -> when cookie expires • (time() + 60 * 60 * 24 * 30) • path -> path of where the cookie is available • domain -> The domain that the cookie is available to • secure -> true or false for https • httponly -> When true the cookie can only be accessed and used through http )

  27. Cookies

  28. Databases & PDO • Oracle • MySQL • SQLite • MS SQL • More…

  29. Databases & PDO • PDO -> PHP Data Object • Data-access abstraction layer • http://php.net/manual/en/book.pdo.php

  30. Databases & PDO

  31. Future • PHP 6 • Unicode support • Enhanced array indexing • Performance • Break to labels

  32. Demos & Examples • http://cretz.github.com/dust-php/ • http://www.razorflow.com/ • http://www.php-compiler.net/

  33. Questions?

More Related