PHP: Hypertext Preprocessor
description
Transcript of PHP: Hypertext Preprocessor
PHP: Hypertext PreprocessorStephen Corcoran
April 9, 2013
Overview
History Frameworks & Libraries Object-Oriented PHP Advance Techniques & Classes Future Demo Questions?
History
Rasmus Lerdorf
CGI Scripts in Perl
Rewritten in C for better performance
PHP/FI & PHPTools
1995 Release date
History
Andi Gutmans & Zeev Suraski
1997 PHP 3
1999 Zend Engine
2000 PHP 4
Frameworks
Yii
CodeIgniter
CakePHP
Zend
Symfony
Frameworks
http://phpassist.com/
http://fuelphp.com/
http://ucf.github.io/fuelphp-crash-course/
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
Object-Oriented
Variable declaration
Object Cloning
User-Level Overloading
Typecasting
Variables
Constants
Define
Global
Constants
Define
Global
Object Cloning
http://pastie.org/private/gtpmhllr0c3hw71x4d0ea
Object Cloning
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
Typecasting
settype() gettype()
Advanced Techniques & Classes
PHP CLI
SSH
Sessions & Cookies
PHP CLI
#!/usr/bin/php
Scheduled/ing tasks
Multithreading
Stdin, Stdout, stderr
PHP CLI
SSH
ssh2_connect() ssh2_execute() ssh2_fingerprint() ssh2_auth_password(), pubkey_file(),
none() ssh2_tunnel() ssh2_mkdir(), rmdir(), chmod(), unlink()
SSH
http://pastie.org/private/t3jbv3dqllqa0hjqyssdaw
mail($to, $subject, $message, $headers)
$to -> user@domain $subject -> ‘Subject’ $message -> ‘Message body’ $headers -> From, BCC, CC, Reply-To
Sessions
start_session()
session_destroy()
$_SESSION[]
Sessions
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)
Cookies
Databases & PDO
Oracle MySQL SQLite MS SQL More…
Databases & PDO
PDO -> PHP Data Object
› Data-access abstraction layer
› http://php.net/manual/en/book.pdo.php
Databases & PDO
Future
PHP 6› Unicode support
› Enhanced array indexing
› Performance
› Break to labels
Demos & Examples
http://cretz.github.com/dust-php/
http://www.razorflow.com/
http://www.php-compiler.net/
Questions?