cvs: presentations / oscon05.xml /slides/keynotes Base.inc andrei.jpg cake.jpg christian.jpg derick_chris.jpg dev1.xml dev2.xml georg.jpg hartmut.jpg
ilia_george_terry_marcus.jpg jani.jpg marcus.jpg mysqli.xml oop.xml pdo.xml phpcarl.jpg pierre.jpg qa.xml speed.xml sterling.jpg sterling2.jpg
sterling3.jpg tempvar.xml thies.jpg unicode.xml wez.jpg xml.xml zak.jpg zeev_andi.jpg
| From: | Rasmus Lerdorf | Date: | Wed, 03 Aug 2005 22:52:11 +0000 |
| Subject: | cvs: presentations / oscon05.xml /slides/keynotes Base.inc andrei.jpg cake.jpg christian.jpg derick_chris.jpg dev1.xml dev2.xml georg.jpg hartmut.jpg ilia_george_terry_marcus.jpg jani.jpg marcus.jpg mysqli.xml oop.xml pdo.xml phpcarl.jpg pierre.jpg qa.xml speed.xml sterling.jpg sterling2.jpg sterling3.jpg tempvar.xml thies.jpg unicode.xml wez.jpg xml.xml zak.jpg zeev_andi.jpg |
||
| Groups: | php.pres | ||
| Request: | Send a blank email to pres+get-1173@lists.php.net to get a copy of this message | ||
rasmus Wed Aug 3 18:52:11 2005 EDT
Added files:
/presentations oscon05.xml
/presentations/slides/keynotes Base.inc andrei.jpg cake.jpg
christian.jpg derick_chris.jpg
dev1.xml dev2.xml georg.jpg
hartmut.jpg
ilia_george_terry_marcus.jpg
jani.jpg marcus.jpg mysqli.xml
oop.xml pdo.xml phpcarl.jpg
pierre.jpg qa.xml speed.xml
sterling.jpg sterling2.jpg
sterling3.jpg tempvar.xml thies.jpg
unicode.xml wez.jpg xml.xml zak.jpg
zeev_andi.jpg
Log:
OSCON Talk
http://cvs.php.net/co.php/presentations/oscon05.xml?r=1.1&p=1 Index: presentations/oscon05.xml +++ presentations/oscon05.xml <presentation template="php2" titlecolor="#1111aa" navbarbackground="url(images/trans-ffffff.png)" logo1="images/php-med-trans-light.gif" titlesize="2em" navbarheight="4.1em" > <!-- 45 Minutes Take a fun romp through the current happenings and characters that make up PHP. Other topics likely to be covered are: - New features in PHP 5.1 - An overview of some cool new PECL extensions - PHP 5.2 preview - Unicode support - A general solution to input filtering and data validation --> <topic>PHP</topic> <title>State of PHP</title> <date>Aug.3, 2005</date> <speaker>Rasmus Lerdorf</speaker> <url>http://talks.php.net/oscon05</url> <chapter title="Introduction"> <slide>slides/titlepage.xml</slide> <slide>slides/keynotes/dev1.xml</slide> <slide>slides/keynotes/dev2.xml</slide> <slide>slides/keynotes/tempvar.xml</slide> <slide>slides/keynotes/xml.xml</slide> <slide>slides/keynotes/oop.xml</slide> <slide>slides/keynotes/pdo.xml</slide> <slide>slides/keynotes/mysqli.xml</slide> <slide>slides/keynotes/speed.xml</slide> <slide>slides/keynotes/unicode.xml</slide> <slide>slides/keynotes/qa.xml</slide> </chapter> </presentation> http://cvs.php.net/co.php/presentations/slides/keynotes/Base.inc?r=1.1&p=1 Index: presentations/slides/keynotes/Base.inc +++ presentations/slides/keynotes/Base.inc <?php abstract class Base { public function __toString() { return '<pre>'.print_r($this,TRUE).'</pre>'; } } ?> http://cvs.php.net/co.php/presentations/slides/keynotes/dev1.xml?r=1.1&p=1 Index: presentations/slides/keynotes/dev1.xml +++ presentations/slides/keynotes/dev1.xml <slide title="The Dev Team"> <break lines="4"/> <image filename="christian.jpg" marginright="3em" align="right"/> <list fontsize="5em"> <bullet> 1008 CVS Accounts</bullet> <bullet> 208,315 CVS commits (3 yrs)</bullet> <bullet> by 463 different committers</bullet> <bullet> docs: 83,407 by 260</bullet> <bullet> pear: 50,348 by 186</bullet> <bullet> src: 42,651 by 134</bullet> <bullet> pecl: 6,298 by 73</bullet> <bullet> smarty: 11,984 by 16</bullet> <bullet> php-gtk: 2,726 by 20</bullet> </list> </slide> http://cvs.php.net/co.php/presentations/slides/keynotes/dev2.xml?r=1.1&p=1 Index: presentations/slides/keynotes/dev2.xml +++ presentations/slides/keynotes/dev2.xml <slide title="Bugs!"> <break lines="4"/> <image filename="jani.jpg" marginright="3em" align="right"/> <list fontsize="5em"> <bullet> 33,657 bugs</bullet> <bullet> 18,319 closed</bullet> <bullet> 10,729 bogus</bullet> <bullet> 2,403 feature requests</bullet> <bullet> 916 unresolved</bullet> <bullet> 740 are feature requests</bullet> <bullet> 70 website problems</bullet> <bullet> 33 doc problems</bullet> <bullet> Fastest: 15 seconds</bullet> <bullet> Median: 5 days 2 hours 9 minutes 10 seconds</bullet> <bullet> Slowest: 2546 days 10 hours 16 minutes 9 seconds</bullet> </list> </slide> http://cvs.php.net/co.php/presentations/slides/keynotes/mysqli.xml?r=1.1&p=1 Index: presentations/slides/keynotes/mysqli.xml +++ presentations/slides/keynotes/mysqli.xml <slide title="MySQLi"> <break lines="2"/> <image filename="georg.jpg" marginright="1em" align="right"/> <blurb fontsize="4em"> For accessing MySQL 4.1 and up. </blurb> <example fontsize="1.1em" marginleft="2em" marginright="25em"><![CDATA[<?php $link = mysqli_connect("localhost", "my_user", "psswd", "world"); if (mysqli_connect_errno()) { echo "Connect failed: ".mysqli_connect_error(); exit(); } if ($result = mysqli_query($link,"SELECT Name FROM City LIMIT 10")) { printf("Select returned %d rows.\n", mysqli_num_rows($result)); while ($row = mysqli_fetch_row($result)) { echo $row[0]; } } mysqli_close($link); ?>]]></example> <break lines="4" /> <blurb fontsize="4em">OO Style</blurb> <image filename="zak.jpg" marginright="1em" align="right"/> <example fontsize="1.1em" marginleft="2em" marginright="26em"><![CDATA[<?php $mysqli = new mysqli("localhost", "my_user", "psswd", "world"); if (mysqli_connect_errno()) { echo "Connect failed: ".mysqli_connect_error(); exit(); } if ($result = $mysqli->query("SELECT Name FROM City LIMIT 10")) { printf("Select returned %d rows.\n", $result->num_rows); while ($row = $result->fetch_row()) { printf ("%s (%s)\n", $row[0], $row[1]); } } $mysqli->close(); ?>]]></example> <break lines="1" /> <example fontsize="1.5em" examplebackground="#ffaabb" marginleft="1em" marginright="26em">An Introduction to mysqli: Using MySQL 5 with PHP 5 Date: Thursday, August 4th, 2005 Time: 4:30pm - 5:15pm Location: E141</example> </slide> http://cvs.php.net/co.php/presentations/slides/keynotes/oop.xml?r=1.1&p=1 Index: presentations/slides/keynotes/oop.xml +++ presentations/slides/keynotes/oop.xml <slide title="OOP"> <break lines="1" /> <image filename="marcus.jpg" marginright="2em" align="right"/> <example title="Objects Are References" result="0" marginright="30em"><![CDATA[<?php $a = new my_class; $b = clone $a; ?>]]></example> <example title="New constructor/destructor naming" result="0" marginright="30em"><![CDATA[<?php class my_class { function __construct() { echo "Constructor"; } function __destruct() { echo "Destructor"; } } ?>]]></example> <example title="PPP" result="0" marginright="30em"><![CDATA[<?php class my_class { public $a; protected $b; private $c; } ?>]]></example> <example title="Overloaded Properties and Methods" result="0"><![CDATA[<?php class my_class { function __set($name, $value) { } function __get($name) { } function __call($name, $args) { } } ?>]]></example> <example title="Object type hinting"><![CDATA[<?php class the_class { public $var = 'foo'; } class my_other_class { public function __construct(the_class $obj) { echo $obj->var; } } $a = new the_class; $b = new my_other_class($a); $c = new my_other_class($b); ?>]]></example> <example hide="1" result="1"><![CDATA[foo<br /> Fatal error: Argument 1 must be an instance of the_class in script.php on line 6]]></example> <example title="Interfaces" result="1"><![CDATA[<?php interface abc { public function setVariable($name, $var); public function getVariable($name); } class my_abc implements abc { private $vars = array(); public function setVariable($name, $var) { $this->vars[$name] = $var; } public function getVariable($name) { return $this->vars[$name]; } } $test = new my_abc; $test->setVariable('foo','bar'); echo $test->getVariable('foo'); ?>]]></example> <example title="Bad Interface" result="0"><![CDATA[<?php class my_other_class implements abc { public function setVariable($name, $var) { $this->vars[$name] = $var; } } ?>]]></example> <example hide="1" result="1">Fatal error: Class my_other_class contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (abc::getVariable) script.php on line 2</example> <example title="final"><![CDATA[<?php class my_main_class { public function foo() { } final public function bar() { } } class my_other_class extends my_main_class { public function foo() { } public function bar() { } } ?>]]></example> <example hide="1" result="1">Fatal error: Cannot override final method my_main_class::bar() in script.php on line 9</example> <example title="Base.inc"><![CDATA[<?php abstract class Base { public function __toString() { return '<pre>'.print_r($this,TRUE).'</pre>'; } } ?>]]></example> <example title="Autoload" result="1"><![CDATA[<?php function __autoload($class) { echo "autoload called for $class\n"; require "presentations/slides/keynotes/$class.inc"; } class my_class2 extends Base { function __construct($arg) { $this->prop = $arg; } } $test = new my_class2('foo'); echo $test; ?>]]></example> <example title="Exceptions" result="0"><![CDATA[<?php try { mysql_connect('localhost'); mysql_select_db('game'); $r = mysql_query('SELECT * FROM news'); } catch (Exception $e) { /* Do recovery */ exit(); } ?>]]></example> <blurb fontsize="5em">And more... Reflection, Iteration, Comparison.</blurb> <blurb fontsize="5em">Go read http://php.net/oop5</blurb> </slide> http://cvs.php.net/co.php/presentations/slides/keynotes/pdo.xml?r=1.1&p=1 Index: presentations/slides/keynotes/pdo.xml +++ presentations/slides/keynotes/pdo.xml <slide title="PDO"> <break lines="2"/> <image filename="wez.jpg" marginright="1em" align="right"/> <break lines="1" /> <blurb fontsize="4em" marginleft="0.5em"> A lightweight, consistent interface for writing database extensions and accessing databases in PHP </blurb> <example fontsize="1.3em" marginleft="2em" marginright="23em"><![CDATA[<?php $dbh = new PDO('odbc:sample', 'db2inst1', 'ibmdb2'); $cnt = $dbh->exec("DELETE FROM fruit WHERE colour = 'red'"); echo "Deleted $cnt rows."; ?>]]></example> <break lines="8" /> <example fontsize="2.5em" examplebackground="#ffaabb" marginleft="20em">PDO: PHP Data Objects Date: Thursday, August 4th, 2005 Time: 10:45am - 11:30am Location: E141</example> </slide> http://cvs.php.net/co.php/presentations/slides/keynotes/qa.xml?r=1.1&p=1 Index: presentations/slides/keynotes/qa.xml +++ presentations/slides/keynotes/qa.xml <slide title="Questions"> <image filename="ilia_george_terry_marcus.jpg"/> <image filename="thies.jpg"/> <image filename="phpcarl.jpg"/> <image filename="cake.jpg"/> <image filename="hartmut.jpg"/> </slide> http://cvs.php.net/co.php/presentations/slides/keynotes/speed.xml?r=1.1&p=1 Index: presentations/slides/keynotes/speed.xml +++ presentations/slides/keynotes/speed.xml <slide title="Performance"> <image filename="zeev_andi.jpg" marginright="1em" align="right"/> <table title="Realworld benchmark" columns="4" border="0" width="50%" fontsize="2em"> <cell> </cell><cell>FudForum 2.6.15</cell><cell>Gallery v1.5.1-RC2-cvs-b6</cell><cell></cell> <cell> </cell><cell>Message Thread(*)</cell><cell>Album View (9 thumbs)</cell><cell></cell> <cell>PHP 4.4 Base</cell><cell align="right" bgcolor="#ccddcc">51.5</cell><cell align="right" bgcolor="#ccddcc">9.4</cell><cell></cell> <cell>PHP 5.0</cell><cell align="right" bgcolor="#ccccdd">42.1</cell><cell align="right" bgcolor="#ccccdd">8.2</cell><cell></cell> <cell>PHP 5.1</cell><cell align="right" bgcolor="#ccccdd">45.5</cell><cell align="right" bgcolor="#ccccdd">9.2</cell><cell></cell> <cell></cell> <cell></cell> <cell></cell> <cell></cell> <cell>PHP 4.4 APC 3.0.6</cell><cell align="right" bgcolor="#ccddcc">145.0</cell><cell align="right" bgcolor="#ccccdd">23.4</cell><cell></cell> <cell>PHP 5.0 APC 3.0.6</cell><cell align="right" bgcolor="#ccccdd">140.0</cell><cell align="right" bgcolor="#ccccdd">26.2</cell><cell></cell> <cell>PHP 5.1 APC 3.0.6</cell><cell align="right" bgcolor="#ccccdd">142.6</cell><cell align="right" bgcolor="#ccddcc">29.8</cell><cell></cell> </table> <break lines="14"/> <example title="Benchmark details" fontsize="1.1em" marginright="0em" marginleft="1em"> (*) Cleared fud26_ses table between each test Client: OS-X 10.4.2 1.5GHz PPC-G4 1G RAM running http_load -parallel 5 Server: Ubuntu Linux kernel 2.6.10, 1.8GHz AMD Athlon, 1G RAM, cpu bound during test Network: 100baseT crossover, no other traffic Apache 1.3.33 PHP 4.4 Configure Line../configure --with-gd --with-jpeg-dir=/usr --with-freetype-dir=/usr --enable-gd-native-ttf \ --with-freetype-dir=/usr --enable-gd-imgstrttf --with-jpeg-dir=/usr --with-png-dir=/usr \ --enable-mbstring --with-xpm-dir=/usr/X11R6 --enable-exif --with-config-file-path=/etc \ --with-mysql=/usr --with-zlib --with-zlib-dir=/usr --with-expat=/usr --with-imap \ --with-gettext --with-kerberos --with-imap-ssl --with-mcrypt=/usr/local --with-iconv \ --enable-sockets --with-openssl --with-dom --with-dom-xslt --with-dom-exslt \ --without-pic --enable-ftp --with-mime-magic --with-snmp --with-apxs=/usr/bin/apxs PHP 5.0/5.1 Configure Line../configure --with-pdflib=/usr/local --with-gd --with-jpeg-dir=/usr --with-freetype-dir=/usr \ --enable-gd-native-ttf --with-freetype-dir=/usr --enable-gd-imgstrttf --with-jpeg-dir=/usr \ --with-png-dir=/usr --with-xpm-dir=/usr/X11R6 --enable-exif --with-config-file-path=/etc/php5 \ --with-mysql=/usr --with-zlib --with-zlib-dir=/usr --with-expat=/usr --with-imap \ --with-gettext --with-kerberos --with-imap-ssl --with-mcrypt=/usr/local --with-iconv \ --enable-sockets --with-openssl --with-apxs=/usr/bin/apxs --without-pic --disable-pdo \ --enable-soap --with-xmlreader --with-xsl --enable-ftp --with-curl --prefix=/usr/local/php5 </example> </slide> http://cvs.php.net/co.php/presentations/slides/keynotes/tempvar.xml?r=1.1&p=1 Index: presentations/slides/keynotes/tempvar.xml +++ presentations/slides/keynotes/tempvar.xml <slide title="PHP 4.4"> <image filename="derick_chris.jpg" marginright="3em" align="right"/> <blurb title="It's all about Temp Vars"> </blurb> <example title="Temp Var Example" result="0" marginright="30em"><![CDATA[<?php function foo() { $a = "abc"; return $a; } $b = foo(); ?>]]></example> <example title="Spot the problem" result="0" marginright="30em"><![CDATA[<?php function foo() { return 3; } function bar(&$arg) { $arg = "banana"; } bar(foo()); ?>]]></example> <example title="In PHP5 this now gives" hide="1" result="1"> Fatal error: Only variables can be passed by reference in foo.php on line 8</example> <example title="And here too" result="1"><![CDATA[<?php function & blah($arg) { if(strlen($arg)) { return $arg.'d'; } else return null; } $foo = "abc"; $a = blah($foo); echo $a; ?>]]></example> </slide> http://cvs.php.net/co.php/presentations/slides/keynotes/unicode.xml?r=1.1&p=1 Index: presentations/slides/keynotes/unicode.xml +++ presentations/slides/keynotes/unicode.xml <slide title="PHP and Unicode?"> <break lines="1"/> <image filename="andrei.jpg" marginright="1em" align="right"/> <blurb fontsize="2.5em"> New string types: IS_BINARY, IS_STRING and IS_UNICODE </blurb> <example title="Indexing Operator" fontsize="1.6em" marginleft="1em" marginright="28em"><![CDATA[<?php $str = "大å¦"; //bytes are e5 a4 a7 e5 ad a6 echo $str{1}; //result is å¦ $str{0} = 'ãµ'; // string is now ãµå¦ // bytes are e3 82 b5 e5 ad a6 ]]></example> <example title="Unicode Identifiers" fontsize="1.6em" marginleft="1em" marginright="28em"><![CDATA[<?php class ã³ã³ãã¼ãã³ã {    function ã³ããã {  .. } } $ãããã¤ã = array(); $ãããã¤ã[âרַעְ××××Ö¼×Ö· ש×Ö¸× Ö¸×â] = new ã³ã³ãã¼ãã³ã(); ]]></example> <break lines="1" /> <example fontsize="2em" examplebackground="#ffaabb" marginleft="20em">PHP and Unicode: A Love At Fifth Sight Date: Thursday, August 4th, 2005 Time: 5:20pm - 6:05pm Location: E141</example> </slide> http://cvs.php.net/co.php/presentations/slides/keynotes/xml.xml?r=1.1&p=1 Index: presentations/slides/keynotes/xml.xml +++ presentations/slides/keynotes/xml.xml <slide title="XML"> <break lines="1" /> <image filename="sterling3.jpg" marginright="1em" align="right"/> <example title="All XML handling based on libxml2" marginleft="2em" marginright="30em" result="0"><![CDATA[<?php $dom = new domDocument; $dom->load('data.xml'); ?>]]></example> <example title="XSL" result="0" marginleft="2em" marginright="30em" fontsize="1.5em"><![CDATA[<?php $domxsl = domDocument::load('stylesheet.xsl'); $proc = new xsltProcessor; $proc->importStyleSheet($domxsl); echo $proc->transformToXML($dom); ?>]]></example> <example title="XPath" result="0" fontsize="1.5em" marginleft="2em" marginright="0em"><![CDATA[<?php $ctx = new domXPath($dom); $result = $ctx->query('/breakfast_menu/food[@itemno > 3]/price/text()'); foreach($result as $node) { echo $node->nodeValue."<br />\n"; } ?>]]></example> <example title="menu.xml" result="1" marginleft="2em" marginright="0em" fontsize="1.75em" rfontsize="1.5em"><![CDATA[<?php class entities_filter extends php_user_filter { function filter($in, $out, &$consumed, $closing) { while ($bucket = stream_bucket_make_writeable($in)) { $bucket->data = htmlentities($bucket->data); $consumed += $bucket->datalen; stream_bucket_append($out, $bucket); } return PSFS_PASS_ON; } } stream_filter_register("entities", "entities_filter"); echo "<pre>"; readfile("php://filter/read=entities/resource=menu.xml"); echo "</pre>"; ?>]]></example> <example title="SimpleXML" result="1" marginleft="2em"><![CDATA[<?php $menu = simplexml_load_file('menu.xml'); foreach ($menu->food as $item) { echo "{$item->price}\t{$item->name}<br />\n"; } ?>]]></example> </slide>
http://cvs.php.net/co.php/presentations/oscon05.xml?r=1.1&p=1 Index: presentations/oscon05.xml +++ presentations/oscon05.xml <presentation template="php2" titlecolor="#1111aa" navbarbackground="url(images/trans-ffffff.png)" logo1="images/php-med-trans-light.gif" titlesize="2em" navbarheight="4.1em" > <!-- 45 Minutes Take a fun romp through the current happenings and characters that make up PHP. Other topics likely to be covered are: - New features in PHP 5.1 - An overview of some cool new PECL extensions - PHP 5.2 preview - Unicode support - A general solution to input filtering and data validation --> <topic>PHP</topic> <title>State of PHP</title> <date>Aug.3, 2005</date> <speaker>Rasmus Lerdorf</speaker> <url>http://talks.php.net/oscon05</url> <chapter title="Introduction"> <slide>slides/titlepage.xml</slide> <slide>slides/keynotes/dev1.xml</slide> <slide>slides/keynotes/dev2.xml</slide> <slide>slides/keynotes/tempvar.xml</slide> <slide>slides/keynotes/xml.xml</slide> <slide>slides/keynotes/oop.xml</slide> <slide>slides/keynotes/pdo.xml</slide> <slide>slides/keynotes/mysqli.xml</slide> <slide>slides/keynotes/speed.xml</slide> <slide>slides/keynotes/unicode.xml</slide> <slide>slides/keynotes/qa.xml</slide> </chapter> </presentation> http://cvs.php.net/co.php/presentations/slides/keynotes/Base.inc?r=1.1&p=1 Index: presentations/slides/keynotes/Base.inc +++ presentations/slides/keynotes/Base.inc <?php abstract class Base { public function __toString() { return '<pre>'.print_r($this,TRUE).'</pre>'; } } ?> http://cvs.php.net/co.php/presentations/slides/keynotes/dev1.xml?r=1.1&p=1 Index: presentations/slides/keynotes/dev1.xml +++ presentations/slides/keynotes/dev1.xml <slide title="The Dev Team"> <break lines="4"/> <image filename="christian.jpg" marginright="3em" align="right"/> <list fontsize="5em"> <bullet> 1008 CVS Accounts</bullet> <bullet> 208,315 CVS commits (3 yrs)</bullet> <bullet> by 463 different committers</bullet> <bullet> docs: 83,407 by 260</bullet> <bullet> pear: 50,348 by 186</bullet> <bullet> src: 42,651 by 134</bullet> <bullet> pecl: 6,298 by 73</bullet> <bullet> smarty: 11,984 by 16</bullet> <bullet> php-gtk: 2,726 by 20</bullet> </list> </slide> http://cvs.php.net/co.php/presentations/slides/keynotes/dev2.xml?r=1.1&p=1 Index: presentations/slides/keynotes/dev2.xml +++ presentations/slides/keynotes/dev2.xml <slide title="Bugs!"> <break lines="4"/> <image filename="jani.jpg" marginright="3em" align="right"/> <list fontsize="5em"> <bullet> 33,657 bugs</bullet> <bullet> 18,319 closed</bullet> <bullet> 10,729 bogus</bullet> <bullet> 2,403 feature requests</bullet> <bullet> 916 unresolved</bullet> <bullet> 740 are feature requests</bullet> <bullet> 70 website problems</bullet> <bullet> 33 doc problems</bullet> <bullet> Fastest: 15 seconds</bullet> <bullet> Median: 5 days 2 hours 9 minutes 10 seconds</bullet> <bullet> Slowest: 2546 days 10 hours 16 minutes 9 seconds</bullet> </list> </slide> http://cvs.php.net/co.php/presentations/slides/keynotes/mysqli.xml?r=1.1&p=1 Index: presentations/slides/keynotes/mysqli.xml +++ presentations/slides/keynotes/mysqli.xml <slide title="MySQLi"> <break lines="2"/> <image filename="georg.jpg" marginright="1em" align="right"/> <blurb fontsize="4em"> For accessing MySQL 4.1 and up. </blurb> <example fontsize="1.1em" marginleft="2em" marginright="25em"><![CDATA[<?php $link = mysqli_connect("localhost", "my_user", "psswd", "world"); if (mysqli_connect_errno()) { echo "Connect failed: ".mysqli_connect_error(); exit(); } if ($result = mysqli_query($link,"SELECT Name FROM City LIMIT 10")) { printf("Select returned %d rows.\n", mysqli_num_rows($result)); while ($row = mysqli_fetch_row($result)) { echo $row[0]; } } mysqli_close($link); ?>]]></example> <break lines="4" /> <blurb fontsize="4em">OO Style</blurb> <image filename="zak.jpg" marginright="1em" align="right"/> <example fontsize="1.1em" marginleft="2em" marginright="26em"><![CDATA[<?php $mysqli = new mysqli("localhost", "my_user", "psswd", "world"); if (mysqli_connect_errno()) { echo "Connect failed: ".mysqli_connect_error(); exit(); } if ($result = $mysqli->query("SELECT Name FROM City LIMIT 10")) { printf("Select returned %d rows.\n", $result->num_rows); while ($row = $result->fetch_row()) { printf ("%s (%s)\n", $row[0], $row[1]); } } $mysqli->close(); ?>]]></example> <break lines="1" /> <example fontsize="1.5em" examplebackground="#ffaabb" marginleft="1em" marginright="26em">An Introduction to mysqli: Using MySQL 5 with PHP 5 Date: Thursday, August 4th, 2005 Time: 4:30pm - 5:15pm Location: E141</example> </slide> http://cvs.php.net/co.php/presentations/slides/keynotes/oop.xml?r=1.1&p=1 Index: presentations/slides/keynotes/oop.xml +++ presentations/slides/keynotes/oop.xml <slide title="OOP"> <break lines="1" /> <image filename="marcus.jpg" marginright="2em" align="right"/> <example title="Objects Are References" result="0" marginright="30em"><![CDATA[<?php $a = new my_class; $b = clone $a; ?>]]></example> <example title="New constructor/destructor naming" result="0" marginright="30em"><![CDATA[<?php class my_class { function __construct() { echo "Constructor"; } function __destruct() { echo "Destructor"; } } ?>]]></example> <example title="PPP" result="0" marginright="30em"><![CDATA[<?php class my_class { public $a; protected $b; private $c; } ?>]]></example> <example title="Overloaded Properties and Methods" result="0"><![CDATA[<?php class my_class { function __set($name, $value) { } function __get($name) { } function __call($name, $args) { } } ?>]]></example> <example title="Object type hinting"><![CDATA[<?php class the_class { public $var = 'foo'; } class my_other_class { public function __construct(the_class $obj) { echo $obj->var; } } $a = new the_class; $b = new my_other_class($a); $c = new my_other_class($b); ?>]]></example> <example hide="1" result="1"><![CDATA[foo<br /> Fatal error: Argument 1 must be an instance of the_class in script.php on line 6]]></example> <example title="Interfaces" result="1"><![CDATA[<?php interface abc { public function setVariable($name, $var); public function getVariable($name); } class my_abc implements abc { private $vars = array(); public function setVariable($name, $var) { $this->vars[$name] = $var; } public function getVariable($name) { return $this->vars[$name]; } } $test = new my_abc; $test->setVariable('foo','bar'); echo $test->getVariable('foo'); ?>]]></example> <example title="Bad Interface" result="0"><![CDATA[<?php class my_other_class implements abc { public function setVariable($name, $var) { $this->vars[$name] = $var; } } ?>]]></example> <example hide="1" result="1">Fatal error: Class my_other_class contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (abc::getVariable) script.php on line 2</example> <example title="final"><![CDATA[<?php class my_main_class { public function foo() { } final public function bar() { } } class my_other_class extends my_main_class { public function foo() { } public function bar() { } } ?>]]></example> <example hide="1" result="1">Fatal error: Cannot override final method my_main_class::bar() in script.php on line 9</example> <example title="Base.inc"><![CDATA[<?php abstract class Base { public function __toString() { return '<pre>'.print_r($this,TRUE).'</pre>'; } } ?>]]></example> <example title="Autoload" result="1"><![CDATA[<?php function __autoload($class) { echo "autoload called for $class\n"; require "presentations/slides/keynotes/$class.inc"; } class my_class2 extends Base { function __construct($arg) { $this->prop = $arg; } } $test = new my_class2('foo'); echo $test; ?>]]></example> <example title="Exceptions" result="0"><![CDATA[<?php try { mysql_connect('localhost'); mysql_select_db('game'); $r = mysql_query('SELECT * FROM news'); } catch (Exception $e) { /* Do recovery */ exit(); } ?>]]></example> <blurb fontsize="5em">And more... Reflection, Iteration, Comparison.</blurb> <blurb fontsize="5em">Go read http://php.net/oop5</blurb> </slide> http://cvs.php.net/co.php/presentations/slides/keynotes/pdo.xml?r=1.1&p=1 Index: presentations/slides/keynotes/pdo.xml +++ presentations/slides/keynotes/pdo.xml <slide title="PDO"> <break lines="2"/> <image filename="wez.jpg" marginright="1em" align="right"/> <break lines="1" /> <blurb fontsize="4em" marginleft="0.5em"> A lightweight, consistent interface for writing database extensions and accessing databases in PHP </blurb> <example fontsize="1.3em" marginleft="2em" marginright="23em"><![CDATA[<?php $dbh = new PDO('odbc:sample', 'db2inst1', 'ibmdb2'); $cnt = $dbh->exec("DELETE FROM fruit WHERE colour = 'red'"); echo "Deleted $cnt rows."; ?>]]></example> <break lines="8" /> <example fontsize="2.5em" examplebackground="#ffaabb" marginleft="20em">PDO: PHP Data Objects Date: Thursday, August 4th, 2005 Time: 10:45am - 11:30am Location: E141</example> </slide> http://cvs.php.net/co.php/presentations/slides/keynotes/qa.xml?r=1.1&p=1 Index: presentations/slides/keynotes/qa.xml +++ presentations/slides/keynotes/qa.xml <slide title="Questions"> <image filename="ilia_george_terry_marcus.jpg"/> <image filename="thies.jpg"/> <image filename="phpcarl.jpg"/> <image filename="cake.jpg"/> <image filename="hartmut.jpg"/> </slide> http://cvs.php.net/co.php/presentations/slides/keynotes/speed.xml?r=1.1&p=1 Index: presentations/slides/keynotes/speed.xml +++ presentations/slides/keynotes/speed.xml <slide title="Performance"> <image filename="zeev_andi.jpg" marginright="1em" align="right"/> <table title="Realworld benchmark" columns="4" border="0" width="50%" fontsize="2em"> <cell> </cell><cell>FudForum 2.6.15</cell><cell>Gallery v1.5.1-RC2-cvs-b6</cell><cell></cell> <cell> </cell><cell>Message Thread(*)</cell><cell>Album View (9 thumbs)</cell><cell></cell> <cell>PHP 4.4 Base</cell><cell align="right" bgcolor="#ccddcc">51.5</cell><cell align="right" bgcolor="#ccddcc">9.4</cell><cell></cell> <cell>PHP 5.0</cell><cell align="right" bgcolor="#ccccdd">42.1</cell><cell align="right" bgcolor="#ccccdd">8.2</cell><cell></cell> <cell>PHP 5.1</cell><cell align="right" bgcolor="#ccccdd">45.5</cell><cell align="right" bgcolor="#ccccdd">9.2</cell><cell></cell> <cell></cell> <cell></cell> <cell></cell> <cell></cell> <cell>PHP 4.4 APC 3.0.6</cell><cell align="right" bgcolor="#ccddcc">145.0</cell><cell align="right" bgcolor="#ccccdd">23.4</cell><cell></cell> <cell>PHP 5.0 APC 3.0.6</cell><cell align="right" bgcolor="#ccccdd">140.0</cell><cell align="right" bgcolor="#ccccdd">26.2</cell><cell></cell> <cell>PHP 5.1 APC 3.0.6</cell><cell align="right" bgcolor="#ccccdd">142.6</cell><cell align="right" bgcolor="#ccddcc">29.8</cell><cell></cell> </table> <break lines="14"/> <example title="Benchmark details" fontsize="1.1em" marginright="0em" marginleft="1em"> (*) Cleared fud26_ses table between each test Client: OS-X 10.4.2 1.5GHz PPC-G4 1G RAM running http_load -parallel 5 Server: Ubuntu Linux kernel 2.6.10, 1.8GHz AMD Athlon, 1G RAM, cpu bound during test Network: 100baseT crossover, no other traffic Apache 1.3.33 PHP 4.4 Configure Line../configure --with-gd --with-jpeg-dir=/usr --with-freetype-dir=/usr --enable-gd-native-ttf \ --with-freetype-dir=/usr --enable-gd-imgstrttf --with-jpeg-dir=/usr --with-png-dir=/usr \ --enable-mbstring --with-xpm-dir=/usr/X11R6 --enable-exif --with-config-file-path=/etc \ --with-mysql=/usr --with-zlib --with-zlib-dir=/usr --with-expat=/usr --with-imap \ --with-gettext --with-kerberos --with-imap-ssl --with-mcrypt=/usr/local --with-iconv \ --enable-sockets --with-openssl --with-dom --with-dom-xslt --with-dom-exslt \ --without-pic --enable-ftp --with-mime-magic --with-snmp --with-apxs=/usr/bin/apxs PHP 5.0/5.1 Configure Line../configure --with-pdflib=/usr/local --with-gd --with-jpeg-dir=/usr --with-freetype-dir=/usr \ --enable-gd-native-ttf --with-freetype-dir=/usr --enable-gd-imgstrttf --with-jpeg-dir=/usr \ --with-png-dir=/usr --with-xpm-dir=/usr/X11R6 --enable-exif --with-config-file-path=/etc/php5 \ --with-mysql=/usr --with-zlib --with-zlib-dir=/usr --with-expat=/usr --with-imap \ --with-gettext --with-kerberos --with-imap-ssl --with-mcrypt=/usr/local --with-iconv \ --enable-sockets --with-openssl --with-apxs=/usr/bin/apxs --without-pic --disable-pdo \ --enable-soap --with-xmlreader --with-xsl --enable-ftp --with-curl --prefix=/usr/local/php5 </example> </slide> http://cvs.php.net/co.php/presentations/slides/keynotes/tempvar.xml?r=1.1&p=1 Index: presentations/slides/keynotes/tempvar.xml +++ presentations/slides/keynotes/tempvar.xml <slide title="PHP 4.4"> <image filename="derick_chris.jpg" marginright="3em" align="right"/> <blurb title="It's all about Temp Vars"> </blurb> <example title="Temp Var Example" result="0" marginright="30em"><![CDATA[<?php function foo() { $a = "abc"; return $a; } $b = foo(); ?>]]></example> <example title="Spot the problem" result="0" marginright="30em"><![CDATA[<?php function foo() { return 3; } function bar(&$arg) { $arg = "banana"; } bar(foo()); ?>]]></example> <example title="In PHP5 this now gives" hide="1" result="1"> Fatal error: Only variables can be passed by reference in foo.php on line 8</example> <example title="And here too" result="1"><![CDATA[<?php function & blah($arg) { if(strlen($arg)) { return $arg.'d'; } else return null; } $foo = "abc"; $a = blah($foo); echo $a; ?>]]></example> </slide> http://cvs.php.net/co.php/presentations/slides/keynotes/unicode.xml?r=1.1&p=1 Index: presentations/slides/keynotes/unicode.xml +++ presentations/slides/keynotes/unicode.xml <slide title="PHP and Unicode?"> <break lines="1"/> <image filename="andrei.jpg" marginright="1em" align="right"/> <blurb fontsize="2.5em"> New string types: IS_BINARY, IS_STRING and IS_UNICODE </blurb> <example title="Indexing Operator" fontsize="1.6em" marginleft="1em" marginright="28em"><![CDATA[<?php $str = "大å¦"; //bytes are e5 a4 a7 e5 ad a6 echo $str{1}; //result is å¦ $str{0} = 'ãµ'; // string is now ãµå¦ // bytes are e3 82 b5 e5 ad a6 ]]></example> <example title="Unicode Identifiers" fontsize="1.6em" marginleft="1em" marginright="28em"><![CDATA[<?php class ã³ã³ãã¼ãã³ã {    function ã³ããã {  .. } } $ãããã¤ã = array(); $ãããã¤ã[âרַעְ××××Ö¼×Ö· ש×Ö¸× Ö¸×â] = new ã³ã³ãã¼ãã³ã(); ]]></example> <break lines="1" /> <example fontsize="2em" examplebackground="#ffaabb" marginleft="20em">PHP and Unicode: A Love At Fifth Sight Date: Thursday, August 4th, 2005 Time: 5:20pm - 6:05pm Location: E141</example> </slide> http://cvs.php.net/co.php/presentations/slides/keynotes/xml.xml?r=1.1&p=1 Index: presentations/slides/keynotes/xml.xml +++ presentations/slides/keynotes/xml.xml <slide title="XML"> <break lines="1" /> <image filename="sterling3.jpg" marginright="1em" align="right"/> <example title="All XML handling based on libxml2" marginleft="2em" marginright="30em" result="0"><![CDATA[<?php $dom = new domDocument; $dom->load('data.xml'); ?>]]></example> <example title="XSL" result="0" marginleft="2em" marginright="30em" fontsize="1.5em"><![CDATA[<?php $domxsl = domDocument::load('stylesheet.xsl'); $proc = new xsltProcessor; $proc->importStyleSheet($domxsl); echo $proc->transformToXML($dom); ?>]]></example> <example title="XPath" result="0" fontsize="1.5em" marginleft="2em" marginright="0em"><![CDATA[<?php $ctx = new domXPath($dom); $result = $ctx->query('/breakfast_menu/food[@itemno > 3]/price/text()'); foreach($result as $node) { echo $node->nodeValue."<br />\n"; } ?>]]></example> <example title="menu.xml" result="1" marginleft="2em" marginright="0em" fontsize="1.75em" rfontsize="1.5em"><![CDATA[<?php class entities_filter extends php_user_filter { function filter($in, $out, &$consumed, $closing) { while ($bucket = stream_bucket_make_writeable($in)) { $bucket->data = htmlentities($bucket->data); $consumed += $bucket->datalen; stream_bucket_append($out, $bucket); } return PSFS_PASS_ON; } } stream_filter_register("entities", "entities_filter"); echo "<pre>"; readfile("php://filter/read=entities/resource=menu.xml"); echo "</pre>"; ?>]]></example> <example title="SimpleXML" result="1" marginleft="2em"><![CDATA[<?php $menu = simplexml_load_file('menu.xml'); foreach ($menu->food as $item) { echo "{$item->price}\t{$item->name}<br />\n"; } ?>]]></example> </slide>