cvs: presentations / migrating-lt2005.xml /slides/i18nl10n cyrillic.xml /slides/migrating abstract-final.jpg abstract-final.xml autoload.jpg
autoload.xml benchmark-5.1.png benchmark.xml cast.gif change.jpg clone.jpg compare.jpg constant.gif constant.xml ctor-dtor.jpg ctor-dtor.xml
datetime.jpg datetime.xml except-police.jpg exceptions.xml future.jpg future.xml incompat-casting.xml incompat-cloning.xml incompat-comparing.xml
incompat-functions.xml interfaces.jpg interfaces.xml light.jpg newobjectmodel.xml newoo.png old-noref.png oldobjectmodel2.xml overload.jpg
overload.xml pdo.xml ppp.xml simple.jpg simplexml.xml soap.jpg soap.xml spl.xml sqlite.xml static.jpg static.xml /slides/php5_intro obj_const.php
soap_client.php
| From: | Derick Rethans | Date: | Mon, 20 Jun 2005 15:35:59 +0000 |
| Subject: | cvs: presentations / migrating-lt2005.xml /slides/i18nl10n cyrillic.xml /slides/migrating abstract-final.jpg abstract-final.xml autoload.jpg autoload.xml benchmark-5.1.png benchmark.xml cast.gif change.jpg clone.jpg compare.jpg constant.gif constant.xml ctor-dtor.jpg ctor-dtor.xml datetime.jpg datetime.xml except-police.jpg exceptions.xml future.jpg future.xml incompat-casting.xml incompat-cloning.xml incompat-comparing.xml incompat-functions.xml interfaces.jpg interfaces.xml light.jpg newobjectmodel.xml newoo.png old-noref.png oldobjectmodel2.xml overload.jpg overload.xml pdo.xml ppp.xml simple.jpg simplexml.xml soap.jpg soap.xml spl.xml sqlite.xml static.jpg static.xml /slides/php5_intro obj_const.php soap_client.php |
||
| Groups: | php.pres | ||
| Request: | Send a blank email to pres+get-1155@lists.php.net to get a copy of this message | ||
derick Mon Jun 20 11:35:59 2005 EDT
Added files:
/presentations migrating-lt2005.xml
/presentations/slides/migrating abstract-final.jpg
abstract-final.xml autoload.jpg
autoload.xml benchmark-5.1.png
benchmark.xml cast.gif change.jpg
clone.jpg compare.jpg constant.gif
constant.xml ctor-dtor.jpg
ctor-dtor.xml datetime.jpg
datetime.xml except-police.jpg
exceptions.xml future.jpg
future.xml incompat-casting.xml
incompat-cloning.xml
incompat-comparing.xml
incompat-functions.xml
interfaces.jpg interfaces.xml
light.jpg newobjectmodel.xml
oldobjectmodel2.xml overload.jpg
overload.xml pdo.xml ppp.xml
simple.jpg simplexml.xml soap.jpg
soap.xml spl.xml sqlite.xml
static.jpg static.xml
Modified files:
/presentations/slides/i18nl10n cyrillic.xml
/presentations/slides/migrating newoo.png old-noref.png
/presentations/slides/php5_intro obj_const.php soap_client.php
Log:
- Added LinuxTag talk.
http://cvs.php.net/diff.php/presentations/slides/i18nl10n/cyrillic.xml?r1=1.2&r2=1.3&ty=u Index: presentations/slides/i18nl10n/cyrillic.xml diff -u presentations/slides/i18nl10n/cyrillic.xml:1.2 presentations/slides/i18nl10n/cyrillic.xml:1.3 --- presentations/slides/i18nl10n/cyrillic.xml:1.2 Wed Mar 23 07:36:10 2005 +++ presentations/slides/i18nl10n/cyrillic.xml Mon Jun 20 11:35:58 2005 @@ -5,7 +5,7 @@ <example class="bit_larger" result="1"><![CDATA[<?php $string = <<<END -След малко Ñе запÑÑвам ÑÑм авÑобÑÑнаÑа ÑпиÑка, Ð¾Ñ Ñам на +След малко Ñе запÑÑвам кÑм авÑобÑÑнаÑа ÑпиÑка, Ð¾Ñ Ñам на леÑиÑеÑо, поÑле пак на леÑиÑеÑо и пак на авÑобÑÑнаÑа ÑпиÑка и в Ðловдив. ÐозаÑока. END; http://cvs.php.net/diff.php/presentations/slides/migrating/newoo.png?r1=1.1&r2=1.2&ty=u Index: presentations/slides/migrating/newoo.png http://cvs.php.net/diff.php/presentations/slides/migrating/old-noref.png?r1=1.1&r2=1.2&ty=u Index: presentations/slides/migrating/old-noref.png http://cvs.php.net/diff.php/presentations/slides/php5_intro/obj_const.php?r1=1.1&r2=1.2&ty=u Index: presentations/slides/php5_intro/obj_const.php diff -u presentations/slides/php5_intro/obj_const.php:1.1 presentations/slides/php5_intro/obj_const.php:1.2 --- presentations/slides/php5_intro/obj_const.php:1.1 Wed Oct 13 10:53:35 2004 +++ presentations/slides/php5_intro/obj_const.php Mon Jun 20 11:35:58 2005 @@ -3,5 +3,6 @@ const file_name = __FILE__; } -echo foo::file_name; // will print current file name -?> \ No newline at end of file +// will print current file name +echo foo::file_name; +?> http://cvs.php.net/diff.php/presentations/slides/php5_intro/soap_client.php?r1=1.1&r2=1.2&ty=u Index: presentations/slides/php5_intro/soap_client.php diff -u presentations/slides/php5_intro/soap_client.php:1.1 presentations/slides/php5_intro/soap_client.php:1.2 --- presentations/slides/php5_intro/soap_client.php:1.1 Wed Oct 13 10:53:39 2004 +++ presentations/slides/php5_intro/soap_client.php Mon Jun 20 11:35:58 2005 @@ -1,5 +1,6 @@ <?php - // instantiate SOAP client object - $client = new SoapObject("http://example.com/soap_server.php", "urn:Object"); - echo $client->version(); // call version() method -?> \ No newline at end of file +// instantiate SOAP client object +$client = + new SoapObject("http://example.com/soap_server.php", "urn:Object"); +echo $client->version(); // call version() method +?> http://cvs.php.net/co.php/presentations/migrating-lt2005.xml?r=1.1&p=1 Index: presentations/migrating-lt2005.xml +++ presentations/migrating-lt2005.xml <?xml version="1.0" encoding="iso-8859-1"?> <presentation template="css" navmode="html" navbarbackground="#4373b4" navbartopiclinks="0" navColor="#f1fbff" logo1="" stylesheet="presentations/slides/perf/ezp.css" backgroundfixed="1" > <topic>PHP 5</topic> <title>Migrating from PHP 4 to PHP 5</title> <event>LinuxTag</event> <location>Karlsruhe, Germany</location> <date>Jun 23, 2005</date> <speaker>Derick Rethans</speaker> <email>dr@ez.no</email> <slide>slides/migrating/title.xml</slide> <!-- NEW STUFF --> <slide>slides/migrating/oldobjectmodel2.xml</slide> <slide>slides/migrating/newobjectmodel.xml</slide> <slide>slides/migrating/ppp.xml</slide> <slide>slides/migrating/ctor-dtor.xml</slide> <slide>slides/migrating/exceptions.xml</slide> <slide>slides/migrating/overload.xml</slide> <slide>slides/migrating/static.xml</slide> <slide>slides/migrating/constant.xml</slide> <slide>slides/migrating/abstract-final.xml</slide> <slide>slides/migrating/interfaces.xml</slide> <slide>slides/migrating/autoload.xml</slide> <slide>slides/migrating/e_strict.xml</slide> <slide>slides/migrating/this.xml</slide> <slide>slides/migrating/incompat-casting.xml</slide> <slide>slides/migrating/incompat-comparing.xml</slide> <slide>slides/migrating/incompat-cloning.xml</slide> <slide>slides/migrating/incompat-functions.xml</slide> <slide>slides/migrating/simplexml.xml</slide> <slide>slides/migrating/sqlite.xml</slide> <slide>slides/migrating/soap.xml</slide> <slide>slides/migrating/spl.xml</slide> <slide>slides/migrating/pdo.xml</slide> <slide>slides/migrating/benchmark.xml</slide> <slide>slides/migrating/datetime.xml</slide> <slide>slides/migrating/future.xml</slide> <slide>slides/xdebug/questions.xml</slide> <slide>slides/migrating/resources.xml</slide> </presentation> http://cvs.php.net/co.php/presentations/slides/migrating/abstract-final.xml?r=1.1&p=1 Index: presentations/slides/migrating/abstract-final.xml +++ presentations/slides/migrating/abstract-final.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>Abstract and Final</title> <image align="right" marginright="1em" filename="abstract-final.jpg"/> <example><![CDATA[<?php class baz { final function foo() {} function bar() {} } // Works: class foo2 extends baz { function bar() {} } // Won't work: class foo3 extends baz { function foo() {} } // Implementing class must implement all methods // specified in the abstract class abstract class ab { abstract public function test(); } class imp_ab extends ab { public function test() { echo "implemented class was called"; } } ?>]]></example> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/autoload.xml?r=1.1&p=1 Index: presentations/slides/migrating/autoload.xml +++ presentations/slides/migrating/autoload.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>Autoload</title> <image align="right" marginright="1em" filename="autoload.jpg"/> <example result="1"><![CDATA[<?php function __autoload($class) { $fname = str_replace('_', '/', $class); $fname = str_replace('eZ/', '', $fname); $fname = strtolower($fname); $fname .= '.php'; echo "Loading $fname...<br/>"; @include_once($fname); } $class = new eZ_Content_Object_Treenode; ?>]]></example> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/benchmark.xml?r=1.1&p=1 Index: presentations/slides/migrating/benchmark.xml +++ presentations/slides/migrating/benchmark.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>Upcoming Goodies in PHP 5.1</title> <subtitle>New Executor</subtitle> <image align="center" filename="benchmark-5.1.png" pdf-scale="1"/> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/constant.xml?r=1.1&p=1 Index: presentations/slides/migrating/constant.xml +++ presentations/slides/migrating/constant.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>Class Constants</title> <image align="right" marginright="1em" filename="constant.gif"/> <example><![CDATA[<?php class foo { const file_name = __FILE__; } // will print current file name echo foo::file_name; ?>]]></example> <break lines="2"/> <blurb>Can not be modified (obviously)</blurb> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/ctor-dtor.xml?r=1.1&p=1 Index: presentations/slides/migrating/ctor-dtor.xml +++ presentations/slides/migrating/ctor-dtor.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>Constructors and Destructors</title> <image align="right" marginright="1em" filename="ctor-dtor.jpg"/> <blurb>Constructors:</blurb> <list> <bullet>Preferred name is ~__construct()~</bullet> <bullet>Old naming style still works</bullet> </list> <break lines="3"/> <blurb>Destructors:</blurb> <list> <bullet>~__destruct()~</bullet> <bullet>Are called when there are no more references to the object's handle</bullet> <bullet>Beware for shut-down order</bullet> </list> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/datetime.xml?r=1.1&p=1 Index: presentations/slides/migrating/datetime.xml +++ presentations/slides/migrating/datetime.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>Upcoming Goodies in PHP 5.1</title> <subtitle>New Date/Time support</subtitle> <image align="right" marginright="1em" filename="datetime.jpg"/> <list> <bullet>64 bit timestamps (more than Sun's life)</bullet> <bullet>~strtotime()~ has been rewritten</bullet> <bullet>Nothing is Operating System dependent</bullet> <bullet>Full support for timezones, DST, date modifications</bullet> </list> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/exceptions.xml?r=1.1&p=1 Index: presentations/slides/migrating/exceptions.xml +++ presentations/slides/migrating/exceptions.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>Exceptions</title> <image align="right" marginright="1em" filename="except-police.jpg"/> <blurb>Exception handling is intended to facilitate use of reasonable mechanisms for handling erroneous or exceptional situations that arise in programs. They are *not* meant for control of code-flow.</blurb> <break lines="3"/> <example><![CDATA[<?php try { /* begin exception block */ $fp = fopen(__FILE__, "r"); if (!$fp) { /* throw exception, error occurred */ throw new Exception('no such file', 9); } } catch (Exception $e) { echo $e->getCode(); // error code echo $e->getFile(); // file where exception was thrown echo $e->getLine(); // line on which exception was thrown echo $e->getMessage(); // error message print_r($e->getTrace()); // print backtrace } ?>]]></example> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/future.xml?r=1.1&p=1 Index: presentations/slides/migrating/future.xml +++ presentations/slides/migrating/future.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>Upcoming Goodies in PHP 5.5/6.0</title> <subtitle>Unicode support</subtitle> <image align="right" marginright="1em" filename="future.jpg"/> <list> <bullet>Native Unicode string type</bullet> <bullet>Updated language semantics</bullet> <bullet>Relevant functions understand Unicode</bullet> <bullet>ICU: IBM Components for Unicode</bullet> <bullet>Backwards compatible</bullet> </list> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/incompat-casting.xml?r=1.1&p=1 Index: presentations/slides/migrating/incompat-casting.xml +++ presentations/slides/migrating/incompat-casting.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>Incompabilities</title> <subtitle>Casting objects</subtitle> <image align="right" marginright="1em" filename="cast.gif"/> <example><![CDATA[<?php class Country { function set_name($name) { $this->name = $name; } } $jurop = new Country; $dutchieland = new Country; $dutchieland->set_name('The Netherlands'); echo (int) $jurop, "\n"; echo (int) $dutchieland, "\n"; ?>]]></example> <break/> <blurb>In PHP 4 *(int) $object* results in:</blurb> <list> <bullet marginleft="2em">"0" when there are no properties set</bullet> <bullet marginleft="2em">"1" when there are properties set</bullet> </list> <break/> <blurb>In PHP 5 *(int) $object* results in:</blurb> <list> <bullet marginleft="2em">"Object id #" + Object ID</bullet> <bullet marginleft="2em">unless *zend.ze1_compatibility_mode = 1*</bullet> </list> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/incompat-cloning.xml?r=1.1&p=1 Index: presentations/slides/migrating/incompat-cloning.xml +++ presentations/slides/migrating/incompat-cloning.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>Incompabilities</title> <subtitle>Cloning objects</subtitle> <image align="right" marginright="1em" filename="clone.jpg"/> <example><![CDATA[<?php class OS { var $name; function OS($name) { $this->name = $name; } } function changeName($obj, $name) { $obj->name = $name; } $linux = new OS('linux'); $win = clone $linux; changeName($win, 'windows'); echo $linux->name, "\n", $win->name; ?>]]></example> <break/> <blurb>In PHP 4 *$object2 = $object1* creates a copy of the object.</blurb> <break/> <blurb>In PHP 5 *$object2 = $object1* creates a reference to the object unless %*clone*% is used or *zend.ze1_compatibility_mode = 1*.</blurb> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/incompat-comparing.xml?r=1.1&p=1 Index: presentations/slides/migrating/incompat-comparing.xml +++ presentations/slides/migrating/incompat-comparing.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>Incompabilities</title> <subtitle>Comparing objects</subtitle> <image align="right" marginright="1em" filename="compare.jpg"/> <example><![CDATA[<?php class Country { var $area; function Country($area) { $this->area = $area; } } $deutschland = new Country('West Europe'); $die_schweiz = new Country('West Europe'); if ($deutschland == $die_schweiz) echo "Deutschland ist die Schweiz.\n"; if ($deutschland === $die_schweiz) echo "Deutschland ist die Schweiz.\n"; ?>]]></example> <break/> <blurb>In PHP 4 *$obj1 ==(=) $obj2* result in *true* when the object's properties are the same</blurb> <break lines="3"/> <blurb>In PHP 5 *$obj1 == $obj2* results in *true* when the object's properties are the same</blurb> <break/> <blurb>In PHP 5 *$obj1 === $obj2* results in *true* when the object's *handles* are the same</blurb> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/incompat-functions.xml?r=1.1&p=1 Index: presentations/slides/migrating/incompat-functions.xml +++ presentations/slides/migrating/incompat-functions.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>Incompabilities</title> <subtitle>Changes in functions</subtitle> <image align="right" marginright="1em" filename="change.jpg"/> <blurb fontsize="4em"> *array_merge()* no longer accepts non-array parameters to merge. </blurb> <break/> <example fontsize="1.3em"><![CDATA[<?php $scandinavia = array('Denmark', 'Norway', 'Finland'); $uk = "The UK"; $europe = array_merge($scandinavia, $uk); var_dump($europe); ?>]]></example> <break lines="2"/> <blurb fontsize="4em"> *strr(i)pos()* now searches the full needle inside the haystack, and not only the first character of it. </blurb> <break/> <example fontsize="1.3em"><![CDATA[<?php $haystack = "There are now ten more countries in Europe"; $needle = "The Netherlands"; $pos = strrpos($haystack, $needle); var_dump($pos); ?>]]></example> <break lines="2"/> <blurb fontsize="2.5em">PHP 4: *0*</blurb> <blurb fontsize="2.5em">PHP 5: *bool(false)*</blurb> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/interfaces.xml?r=1.1&p=1 Index: presentations/slides/migrating/interfaces.xml +++ presentations/slides/migrating/interfaces.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>Interfaces</title> <image align="right" marginright="1em" filename="interfaces.jpg"/> <example><![CDATA[<?php interface read_file { function open($file_name); function read($bytes); function close(); } class rf implements read_file { private $fp; function open($file_name) { $this->fp = fopen($file_name, "r"); } function read($bytes) { return fread($this->fp, $bytes); } function close() { fclose($this->fp); } } $f = new rf(); /* ensure that object inside $ implements read_file interface */ if ($f instanceof read_file) { $f->open(__FILE__); echo $f->read(4); $f->close(); } ?>]]></example> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/newobjectmodel.xml?r=1.1&p=1 Index: presentations/slides/migrating/newobjectmodel.xml +++ presentations/slides/migrating/newobjectmodel.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>Objectmodel in PHP 5</title> <image align="center" filename="newoo.png" pdf-scale="1"/> <list marginleft="2em" fontsize="3.5em"> <bullet>Pass by reference</bullet> <bullet>Objects are referenced by a handle.</bullet> </list> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/oldobjectmodel2.xml?r=1.1&p=1 Index: presentations/slides/migrating/oldobjectmodel2.xml +++ presentations/slides/migrating/oldobjectmodel2.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>Objectmodel in PHP 4</title> <image align="center" filename="old-noref.png" pdf-scale="1"/> <list marginleft="3em" fontsize="3.5em"> <bullet>Pass by value</bullet> <bullet>Use of references needed almost everywhere...</bullet> <bullet marginleft="5em" type="none">at call time, and even during instantiation.</bullet> </list> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/overload.xml?r=1.1&p=1 Index: presentations/slides/migrating/overload.xml +++ presentations/slides/migrating/overload.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>Overloading</title> <subtitle>__get(), __set() and __call()</subtitle> <image align="right" marginright="1em" filename="overload.jpg"/> <example><![CDATA[<?php class foo { private $int_data = array(); function __get($var_name) { return $this->int_data[$var_name]; } function __set($var_name, $value) { $this->int_data[$var_name] = urlencode($value); } function __call($name, $args) { switch ($name) { case 'add': return array_sum($args); } } $a = new foo(); $a->bar = "random value"; echo $a->bar; // will print random+value echo $a->add(1,2); // will print 3 ?>]]></example> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/pdo.xml?r=1.1&p=1 Index: presentations/slides/migrating/pdo.xml +++ presentations/slides/migrating/pdo.xml <slide fontsize="6em"> <title>Upcoming Goodies in PHP 5.1</title> <subtitle>PDO</subtitle> <blurb> The PHP Data Objects (PDO) extension defines a lightweight, consistent interface for accessing databases in PHP. Each database driver that implements the PDO interface can expose database-specific features as regular extension functions. </blurb> <break/> <blurb>Supported databases:</blurb> <list> <bullet>DB2</bullet> <bullet>Firebird/Interbase</bullet> <bullet>MS SQL</bullet> <bullet>MySQL</bullet> <bullet>Oracle</bullet> <bullet>ODBC</bullet> <bullet>PostgreSQL</bullet> <bullet>SQLite</bullet> </list> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/ppp.xml?r=1.1&p=1 Index: presentations/slides/migrating/ppp.xml +++ presentations/slides/migrating/ppp.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>PPP</title> <subtitle>var--, (public, private, protected)++</subtitle> <blurb>PHP 4:</blurb> <list> <bullet>~var~: all scopes can access it</bullet> </list> <blurb>Only for properties</blurb> <break lines="5"/> <blurb>PHP 5:</blurb> <list> <bullet>~public~: all scopes can access it</bullet> <bullet>~protected~: local and derived objects can access it</bullet> <bullet>~private~: only local object access it</bullet> </list> <blurb>For properties and methods</blurb> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/simplexml.xml?r=1.1&p=1 Index: presentations/slides/migrating/simplexml.xml +++ presentations/slides/migrating/simplexml.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>New Tools</title> <subtitle>SimpleXML</subtitle> <image align="right" marginright="1em" filename="simple.jpg"/> <blurb> SimpleXML provides a simple way to parse XML documents that is natively available in PHP. </blurb> <example><![CDATA[<?php $xml = '<articles> <article id="1"> <title>Something Happened</title> <author>Random Person</author> </article> <article id="2"> <title>Something Else Happened</title> <author>Different Person</author> </article> </articles>'; /* load & parse XML string */ $art = simplexml_load_string($xml); foreach ($art as $article) { echo 'Id: ' . $article['id']; echo 'Title: ' . $article->title; echo 'Author: ' . $article->author; } ?>]]></example> <break/> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/soap.xml?r=1.1&p=1 Index: presentations/slides/migrating/soap.xml +++ presentations/slides/migrating/soap.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>New Tools</title> <subtitle>SOAP</subtitle> <image align="right" marginright="1em" filename="soap.jpg"/> <blurb> The %SOAP% extension is a fast and fairly complete interface for creating and working with SOAP web-services. </blurb> <break lines="2"/> <example><![CDATA[<?php // instantiate SOAP client object $client = new SoapObject( "http://example.com/soap_server.php", "urn:Object"); echo $client->version(); // call version() method ?>]]></example> <break/> <list title="Capabilities"> <bullet>WSDL Code Generation improved</bullet> <bullet>Schema Code Generation added!</bullet> <bullet>Smaller code base, easier to extend</bullet> <bullet>Streams API support</bullet> <bullet>Uses DOM</bullet> <bullet>Cleaner code, better organized</bullet> <bullet>Makes use of new OO support in PHP 5</bullet> </list> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/spl.xml?r=1.1&p=1 Index: presentations/slides/migrating/spl.xml +++ presentations/slides/migrating/spl.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>New Tools</title> <subtitle>SPL</subtitle> <blurb> %SPL% is a collection of interfaces and classes that are meant to solve standard problems. </blurb> <list> <bullet>Directory iterator</bullet> <bullet>Recursive directory iterator</bullet> <bullet>SimpleXML iterator</bullet> <bullet>Ability to extend existing iterators</bullet> </list> <example><![CDATA[<?php // Create directory iterator based on current directory $dir = new DirectoryIterator(dirname(__FILE__)); // While there are valid entries while ($dir->valid()) { // Check if we are dealing with a file if ($dir->isFile()) { // print file name & its size echo 'Name: ', $dir->getFilename(), ', ', 'Size: ', $dir->getSize(), '<br />'; } // move to next entry $dir->next(); } ?>]]></example> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/sqlite.xml?r=1.1&p=1 Index: presentations/slides/migrating/sqlite.xml +++ presentations/slides/migrating/sqlite.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>New Tools</title> <subtitle>SQLite</subtitle> <image align="right" marginright="1em" filename="light.jpg"/> <blurb> </blurb> <example><![CDATA[<?php /* open connection to memory database */ $db = new SQLiteDatabase(":memory:"); /* execute a regular query */ $db->query("CREATE TABLE test(a,b)"); $db->query("INSERT INTO test VALUES('1','2')"); /* retrieve data using an unbuffered query */ $r = $db->unbufferedQuery("SELECT * FROM test", SQLITE_ASSOC); /* use object iterators to retrieve the data */ foreach ($r as $row) { var_dump($row); } ?>]]></example> <break/> <list type="Features"> <bullet>Bundled with PHP 5 (including library)</bullet> <bullet>Fast and easy interface to 'flatfiles'</bullet> <bullet>Implements most of SQL92</bullet> <bullet>Supports both OO and procedural API</bullet> <bullet>No daemon required</bullet> <bullet>Can use PHP to extend SQL language</bullet> </list> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/static.xml?r=1.1&p=1 Index: presentations/slides/migrating/static.xml +++ presentations/slides/migrating/static.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>Static</title> <image align="right" marginright="1em" filename="static.jpg"/> <example><![CDATA[<?php class foo { static $bar = 123; static function baz() { return 456; } } echo foo::$bar; // will print 123 echo foo::baz(); // will print 456 ?>]]></example> <break lines="2"/> <blurb>Incompatible:</blurb> <list> <bullet>In PHP 5 $this will never be available when a method is defined as static, not even the $this from the scope where a static method was called from.</bullet> </list> </slide>
http://cvs.php.net/diff.php/presentations/slides/i18nl10n/cyrillic.xml?r1=1.2&r2=1.3&ty=u Index: presentations/slides/i18nl10n/cyrillic.xml diff -u presentations/slides/i18nl10n/cyrillic.xml:1.2 presentations/slides/i18nl10n/cyrillic.xml:1.3 --- presentations/slides/i18nl10n/cyrillic.xml:1.2 Wed Mar 23 07:36:10 2005 +++ presentations/slides/i18nl10n/cyrillic.xml Mon Jun 20 11:35:58 2005 @@ -5,7 +5,7 @@ <example class="bit_larger" result="1"><![CDATA[<?php $string = <<<END -След малко Ñе запÑÑвам ÑÑм авÑобÑÑнаÑа ÑпиÑка, Ð¾Ñ Ñам на +След малко Ñе запÑÑвам кÑм авÑобÑÑнаÑа ÑпиÑка, Ð¾Ñ Ñам на леÑиÑеÑо, поÑле пак на леÑиÑеÑо и пак на авÑобÑÑнаÑа ÑпиÑка и в Ðловдив. ÐозаÑока. END; http://cvs.php.net/diff.php/presentations/slides/migrating/newoo.png?r1=1.1&r2=1.2&ty=u Index: presentations/slides/migrating/newoo.png http://cvs.php.net/diff.php/presentations/slides/migrating/old-noref.png?r1=1.1&r2=1.2&ty=u Index: presentations/slides/migrating/old-noref.png http://cvs.php.net/diff.php/presentations/slides/php5_intro/obj_const.php?r1=1.1&r2=1.2&ty=u Index: presentations/slides/php5_intro/obj_const.php diff -u presentations/slides/php5_intro/obj_const.php:1.1 presentations/slides/php5_intro/obj_const.php:1.2 --- presentations/slides/php5_intro/obj_const.php:1.1 Wed Oct 13 10:53:35 2004 +++ presentations/slides/php5_intro/obj_const.php Mon Jun 20 11:35:58 2005 @@ -3,5 +3,6 @@ const file_name = __FILE__; } -echo foo::file_name; // will print current file name -?> \ No newline at end of file +// will print current file name +echo foo::file_name; +?> http://cvs.php.net/diff.php/presentations/slides/php5_intro/soap_client.php?r1=1.1&r2=1.2&ty=u Index: presentations/slides/php5_intro/soap_client.php diff -u presentations/slides/php5_intro/soap_client.php:1.1 presentations/slides/php5_intro/soap_client.php:1.2 --- presentations/slides/php5_intro/soap_client.php:1.1 Wed Oct 13 10:53:39 2004 +++ presentations/slides/php5_intro/soap_client.php Mon Jun 20 11:35:58 2005 @@ -1,5 +1,6 @@ <?php - // instantiate SOAP client object - $client = new SoapObject("http://example.com/soap_server.php", "urn:Object"); - echo $client->version(); // call version() method -?> \ No newline at end of file +// instantiate SOAP client object +$client = + new SoapObject("http://example.com/soap_server.php", "urn:Object"); +echo $client->version(); // call version() method +?> http://cvs.php.net/co.php/presentations/migrating-lt2005.xml?r=1.1&p=1 Index: presentations/migrating-lt2005.xml +++ presentations/migrating-lt2005.xml <?xml version="1.0" encoding="iso-8859-1"?> <presentation template="css" navmode="html" navbarbackground="#4373b4" navbartopiclinks="0" navColor="#f1fbff" logo1="" stylesheet="presentations/slides/perf/ezp.css" backgroundfixed="1" > <topic>PHP 5</topic> <title>Migrating from PHP 4 to PHP 5</title> <event>LinuxTag</event> <location>Karlsruhe, Germany</location> <date>Jun 23, 2005</date> <speaker>Derick Rethans</speaker> <email>dr@ez.no</email> <slide>slides/migrating/title.xml</slide> <!-- NEW STUFF --> <slide>slides/migrating/oldobjectmodel2.xml</slide> <slide>slides/migrating/newobjectmodel.xml</slide> <slide>slides/migrating/ppp.xml</slide> <slide>slides/migrating/ctor-dtor.xml</slide> <slide>slides/migrating/exceptions.xml</slide> <slide>slides/migrating/overload.xml</slide> <slide>slides/migrating/static.xml</slide> <slide>slides/migrating/constant.xml</slide> <slide>slides/migrating/abstract-final.xml</slide> <slide>slides/migrating/interfaces.xml</slide> <slide>slides/migrating/autoload.xml</slide> <slide>slides/migrating/e_strict.xml</slide> <slide>slides/migrating/this.xml</slide> <slide>slides/migrating/incompat-casting.xml</slide> <slide>slides/migrating/incompat-comparing.xml</slide> <slide>slides/migrating/incompat-cloning.xml</slide> <slide>slides/migrating/incompat-functions.xml</slide> <slide>slides/migrating/simplexml.xml</slide> <slide>slides/migrating/sqlite.xml</slide> <slide>slides/migrating/soap.xml</slide> <slide>slides/migrating/spl.xml</slide> <slide>slides/migrating/pdo.xml</slide> <slide>slides/migrating/benchmark.xml</slide> <slide>slides/migrating/datetime.xml</slide> <slide>slides/migrating/future.xml</slide> <slide>slides/xdebug/questions.xml</slide> <slide>slides/migrating/resources.xml</slide> </presentation> http://cvs.php.net/co.php/presentations/slides/migrating/abstract-final.xml?r=1.1&p=1 Index: presentations/slides/migrating/abstract-final.xml +++ presentations/slides/migrating/abstract-final.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>Abstract and Final</title> <image align="right" marginright="1em" filename="abstract-final.jpg"/> <example><![CDATA[<?php class baz { final function foo() {} function bar() {} } // Works: class foo2 extends baz { function bar() {} } // Won't work: class foo3 extends baz { function foo() {} } // Implementing class must implement all methods // specified in the abstract class abstract class ab { abstract public function test(); } class imp_ab extends ab { public function test() { echo "implemented class was called"; } } ?>]]></example> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/autoload.xml?r=1.1&p=1 Index: presentations/slides/migrating/autoload.xml +++ presentations/slides/migrating/autoload.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>Autoload</title> <image align="right" marginright="1em" filename="autoload.jpg"/> <example result="1"><![CDATA[<?php function __autoload($class) { $fname = str_replace('_', '/', $class); $fname = str_replace('eZ/', '', $fname); $fname = strtolower($fname); $fname .= '.php'; echo "Loading $fname...<br/>"; @include_once($fname); } $class = new eZ_Content_Object_Treenode; ?>]]></example> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/benchmark.xml?r=1.1&p=1 Index: presentations/slides/migrating/benchmark.xml +++ presentations/slides/migrating/benchmark.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>Upcoming Goodies in PHP 5.1</title> <subtitle>New Executor</subtitle> <image align="center" filename="benchmark-5.1.png" pdf-scale="1"/> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/constant.xml?r=1.1&p=1 Index: presentations/slides/migrating/constant.xml +++ presentations/slides/migrating/constant.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>Class Constants</title> <image align="right" marginright="1em" filename="constant.gif"/> <example><![CDATA[<?php class foo { const file_name = __FILE__; } // will print current file name echo foo::file_name; ?>]]></example> <break lines="2"/> <blurb>Can not be modified (obviously)</blurb> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/ctor-dtor.xml?r=1.1&p=1 Index: presentations/slides/migrating/ctor-dtor.xml +++ presentations/slides/migrating/ctor-dtor.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>Constructors and Destructors</title> <image align="right" marginright="1em" filename="ctor-dtor.jpg"/> <blurb>Constructors:</blurb> <list> <bullet>Preferred name is ~__construct()~</bullet> <bullet>Old naming style still works</bullet> </list> <break lines="3"/> <blurb>Destructors:</blurb> <list> <bullet>~__destruct()~</bullet> <bullet>Are called when there are no more references to the object's handle</bullet> <bullet>Beware for shut-down order</bullet> </list> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/datetime.xml?r=1.1&p=1 Index: presentations/slides/migrating/datetime.xml +++ presentations/slides/migrating/datetime.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>Upcoming Goodies in PHP 5.1</title> <subtitle>New Date/Time support</subtitle> <image align="right" marginright="1em" filename="datetime.jpg"/> <list> <bullet>64 bit timestamps (more than Sun's life)</bullet> <bullet>~strtotime()~ has been rewritten</bullet> <bullet>Nothing is Operating System dependent</bullet> <bullet>Full support for timezones, DST, date modifications</bullet> </list> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/exceptions.xml?r=1.1&p=1 Index: presentations/slides/migrating/exceptions.xml +++ presentations/slides/migrating/exceptions.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>Exceptions</title> <image align="right" marginright="1em" filename="except-police.jpg"/> <blurb>Exception handling is intended to facilitate use of reasonable mechanisms for handling erroneous or exceptional situations that arise in programs. They are *not* meant for control of code-flow.</blurb> <break lines="3"/> <example><![CDATA[<?php try { /* begin exception block */ $fp = fopen(__FILE__, "r"); if (!$fp) { /* throw exception, error occurred */ throw new Exception('no such file', 9); } } catch (Exception $e) { echo $e->getCode(); // error code echo $e->getFile(); // file where exception was thrown echo $e->getLine(); // line on which exception was thrown echo $e->getMessage(); // error message print_r($e->getTrace()); // print backtrace } ?>]]></example> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/future.xml?r=1.1&p=1 Index: presentations/slides/migrating/future.xml +++ presentations/slides/migrating/future.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>Upcoming Goodies in PHP 5.5/6.0</title> <subtitle>Unicode support</subtitle> <image align="right" marginright="1em" filename="future.jpg"/> <list> <bullet>Native Unicode string type</bullet> <bullet>Updated language semantics</bullet> <bullet>Relevant functions understand Unicode</bullet> <bullet>ICU: IBM Components for Unicode</bullet> <bullet>Backwards compatible</bullet> </list> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/incompat-casting.xml?r=1.1&p=1 Index: presentations/slides/migrating/incompat-casting.xml +++ presentations/slides/migrating/incompat-casting.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>Incompabilities</title> <subtitle>Casting objects</subtitle> <image align="right" marginright="1em" filename="cast.gif"/> <example><![CDATA[<?php class Country { function set_name($name) { $this->name = $name; } } $jurop = new Country; $dutchieland = new Country; $dutchieland->set_name('The Netherlands'); echo (int) $jurop, "\n"; echo (int) $dutchieland, "\n"; ?>]]></example> <break/> <blurb>In PHP 4 *(int) $object* results in:</blurb> <list> <bullet marginleft="2em">"0" when there are no properties set</bullet> <bullet marginleft="2em">"1" when there are properties set</bullet> </list> <break/> <blurb>In PHP 5 *(int) $object* results in:</blurb> <list> <bullet marginleft="2em">"Object id #" + Object ID</bullet> <bullet marginleft="2em">unless *zend.ze1_compatibility_mode = 1*</bullet> </list> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/incompat-cloning.xml?r=1.1&p=1 Index: presentations/slides/migrating/incompat-cloning.xml +++ presentations/slides/migrating/incompat-cloning.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>Incompabilities</title> <subtitle>Cloning objects</subtitle> <image align="right" marginright="1em" filename="clone.jpg"/> <example><![CDATA[<?php class OS { var $name; function OS($name) { $this->name = $name; } } function changeName($obj, $name) { $obj->name = $name; } $linux = new OS('linux'); $win = clone $linux; changeName($win, 'windows'); echo $linux->name, "\n", $win->name; ?>]]></example> <break/> <blurb>In PHP 4 *$object2 = $object1* creates a copy of the object.</blurb> <break/> <blurb>In PHP 5 *$object2 = $object1* creates a reference to the object unless %*clone*% is used or *zend.ze1_compatibility_mode = 1*.</blurb> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/incompat-comparing.xml?r=1.1&p=1 Index: presentations/slides/migrating/incompat-comparing.xml +++ presentations/slides/migrating/incompat-comparing.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>Incompabilities</title> <subtitle>Comparing objects</subtitle> <image align="right" marginright="1em" filename="compare.jpg"/> <example><![CDATA[<?php class Country { var $area; function Country($area) { $this->area = $area; } } $deutschland = new Country('West Europe'); $die_schweiz = new Country('West Europe'); if ($deutschland == $die_schweiz) echo "Deutschland ist die Schweiz.\n"; if ($deutschland === $die_schweiz) echo "Deutschland ist die Schweiz.\n"; ?>]]></example> <break/> <blurb>In PHP 4 *$obj1 ==(=) $obj2* result in *true* when the object's properties are the same</blurb> <break lines="3"/> <blurb>In PHP 5 *$obj1 == $obj2* results in *true* when the object's properties are the same</blurb> <break/> <blurb>In PHP 5 *$obj1 === $obj2* results in *true* when the object's *handles* are the same</blurb> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/incompat-functions.xml?r=1.1&p=1 Index: presentations/slides/migrating/incompat-functions.xml +++ presentations/slides/migrating/incompat-functions.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>Incompabilities</title> <subtitle>Changes in functions</subtitle> <image align="right" marginright="1em" filename="change.jpg"/> <blurb fontsize="4em"> *array_merge()* no longer accepts non-array parameters to merge. </blurb> <break/> <example fontsize="1.3em"><![CDATA[<?php $scandinavia = array('Denmark', 'Norway', 'Finland'); $uk = "The UK"; $europe = array_merge($scandinavia, $uk); var_dump($europe); ?>]]></example> <break lines="2"/> <blurb fontsize="4em"> *strr(i)pos()* now searches the full needle inside the haystack, and not only the first character of it. </blurb> <break/> <example fontsize="1.3em"><![CDATA[<?php $haystack = "There are now ten more countries in Europe"; $needle = "The Netherlands"; $pos = strrpos($haystack, $needle); var_dump($pos); ?>]]></example> <break lines="2"/> <blurb fontsize="2.5em">PHP 4: *0*</blurb> <blurb fontsize="2.5em">PHP 5: *bool(false)*</blurb> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/interfaces.xml?r=1.1&p=1 Index: presentations/slides/migrating/interfaces.xml +++ presentations/slides/migrating/interfaces.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>Interfaces</title> <image align="right" marginright="1em" filename="interfaces.jpg"/> <example><![CDATA[<?php interface read_file { function open($file_name); function read($bytes); function close(); } class rf implements read_file { private $fp; function open($file_name) { $this->fp = fopen($file_name, "r"); } function read($bytes) { return fread($this->fp, $bytes); } function close() { fclose($this->fp); } } $f = new rf(); /* ensure that object inside $ implements read_file interface */ if ($f instanceof read_file) { $f->open(__FILE__); echo $f->read(4); $f->close(); } ?>]]></example> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/newobjectmodel.xml?r=1.1&p=1 Index: presentations/slides/migrating/newobjectmodel.xml +++ presentations/slides/migrating/newobjectmodel.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>Objectmodel in PHP 5</title> <image align="center" filename="newoo.png" pdf-scale="1"/> <list marginleft="2em" fontsize="3.5em"> <bullet>Pass by reference</bullet> <bullet>Objects are referenced by a handle.</bullet> </list> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/oldobjectmodel2.xml?r=1.1&p=1 Index: presentations/slides/migrating/oldobjectmodel2.xml +++ presentations/slides/migrating/oldobjectmodel2.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>Objectmodel in PHP 4</title> <image align="center" filename="old-noref.png" pdf-scale="1"/> <list marginleft="3em" fontsize="3.5em"> <bullet>Pass by value</bullet> <bullet>Use of references needed almost everywhere...</bullet> <bullet marginleft="5em" type="none">at call time, and even during instantiation.</bullet> </list> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/overload.xml?r=1.1&p=1 Index: presentations/slides/migrating/overload.xml +++ presentations/slides/migrating/overload.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>Overloading</title> <subtitle>__get(), __set() and __call()</subtitle> <image align="right" marginright="1em" filename="overload.jpg"/> <example><![CDATA[<?php class foo { private $int_data = array(); function __get($var_name) { return $this->int_data[$var_name]; } function __set($var_name, $value) { $this->int_data[$var_name] = urlencode($value); } function __call($name, $args) { switch ($name) { case 'add': return array_sum($args); } } $a = new foo(); $a->bar = "random value"; echo $a->bar; // will print random+value echo $a->add(1,2); // will print 3 ?>]]></example> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/pdo.xml?r=1.1&p=1 Index: presentations/slides/migrating/pdo.xml +++ presentations/slides/migrating/pdo.xml <slide fontsize="6em"> <title>Upcoming Goodies in PHP 5.1</title> <subtitle>PDO</subtitle> <blurb> The PHP Data Objects (PDO) extension defines a lightweight, consistent interface for accessing databases in PHP. Each database driver that implements the PDO interface can expose database-specific features as regular extension functions. </blurb> <break/> <blurb>Supported databases:</blurb> <list> <bullet>DB2</bullet> <bullet>Firebird/Interbase</bullet> <bullet>MS SQL</bullet> <bullet>MySQL</bullet> <bullet>Oracle</bullet> <bullet>ODBC</bullet> <bullet>PostgreSQL</bullet> <bullet>SQLite</bullet> </list> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/ppp.xml?r=1.1&p=1 Index: presentations/slides/migrating/ppp.xml +++ presentations/slides/migrating/ppp.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>PPP</title> <subtitle>var--, (public, private, protected)++</subtitle> <blurb>PHP 4:</blurb> <list> <bullet>~var~: all scopes can access it</bullet> </list> <blurb>Only for properties</blurb> <break lines="5"/> <blurb>PHP 5:</blurb> <list> <bullet>~public~: all scopes can access it</bullet> <bullet>~protected~: local and derived objects can access it</bullet> <bullet>~private~: only local object access it</bullet> </list> <blurb>For properties and methods</blurb> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/simplexml.xml?r=1.1&p=1 Index: presentations/slides/migrating/simplexml.xml +++ presentations/slides/migrating/simplexml.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>New Tools</title> <subtitle>SimpleXML</subtitle> <image align="right" marginright="1em" filename="simple.jpg"/> <blurb> SimpleXML provides a simple way to parse XML documents that is natively available in PHP. </blurb> <example><![CDATA[<?php $xml = '<articles> <article id="1"> <title>Something Happened</title> <author>Random Person</author> </article> <article id="2"> <title>Something Else Happened</title> <author>Different Person</author> </article> </articles>'; /* load & parse XML string */ $art = simplexml_load_string($xml); foreach ($art as $article) { echo 'Id: ' . $article['id']; echo 'Title: ' . $article->title; echo 'Author: ' . $article->author; } ?>]]></example> <break/> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/soap.xml?r=1.1&p=1 Index: presentations/slides/migrating/soap.xml +++ presentations/slides/migrating/soap.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>New Tools</title> <subtitle>SOAP</subtitle> <image align="right" marginright="1em" filename="soap.jpg"/> <blurb> The %SOAP% extension is a fast and fairly complete interface for creating and working with SOAP web-services. </blurb> <break lines="2"/> <example><![CDATA[<?php // instantiate SOAP client object $client = new SoapObject( "http://example.com/soap_server.php", "urn:Object"); echo $client->version(); // call version() method ?>]]></example> <break/> <list title="Capabilities"> <bullet>WSDL Code Generation improved</bullet> <bullet>Schema Code Generation added!</bullet> <bullet>Smaller code base, easier to extend</bullet> <bullet>Streams API support</bullet> <bullet>Uses DOM</bullet> <bullet>Cleaner code, better organized</bullet> <bullet>Makes use of new OO support in PHP 5</bullet> </list> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/spl.xml?r=1.1&p=1 Index: presentations/slides/migrating/spl.xml +++ presentations/slides/migrating/spl.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>New Tools</title> <subtitle>SPL</subtitle> <blurb> %SPL% is a collection of interfaces and classes that are meant to solve standard problems. </blurb> <list> <bullet>Directory iterator</bullet> <bullet>Recursive directory iterator</bullet> <bullet>SimpleXML iterator</bullet> <bullet>Ability to extend existing iterators</bullet> </list> <example><![CDATA[<?php // Create directory iterator based on current directory $dir = new DirectoryIterator(dirname(__FILE__)); // While there are valid entries while ($dir->valid()) { // Check if we are dealing with a file if ($dir->isFile()) { // print file name & its size echo 'Name: ', $dir->getFilename(), ', ', 'Size: ', $dir->getSize(), '<br />'; } // move to next entry $dir->next(); } ?>]]></example> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/sqlite.xml?r=1.1&p=1 Index: presentations/slides/migrating/sqlite.xml +++ presentations/slides/migrating/sqlite.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>New Tools</title> <subtitle>SQLite</subtitle> <image align="right" marginright="1em" filename="light.jpg"/> <blurb> </blurb> <example><![CDATA[<?php /* open connection to memory database */ $db = new SQLiteDatabase(":memory:"); /* execute a regular query */ $db->query("CREATE TABLE test(a,b)"); $db->query("INSERT INTO test VALUES('1','2')"); /* retrieve data using an unbuffered query */ $r = $db->unbufferedQuery("SELECT * FROM test", SQLITE_ASSOC); /* use object iterators to retrieve the data */ foreach ($r as $row) { var_dump($row); } ?>]]></example> <break/> <list type="Features"> <bullet>Bundled with PHP 5 (including library)</bullet> <bullet>Fast and easy interface to 'flatfiles'</bullet> <bullet>Implements most of SQL92</bullet> <bullet>Supports both OO and procedural API</bullet> <bullet>No daemon required</bullet> <bullet>Can use PHP to extend SQL language</bullet> </list> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/static.xml?r=1.1&p=1 Index: presentations/slides/migrating/static.xml +++ presentations/slides/migrating/static.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>Static</title> <image align="right" marginright="1em" filename="static.jpg"/> <example><![CDATA[<?php class foo { static $bar = 123; static function baz() { return 456; } } echo foo::$bar; // will print 123 echo foo::baz(); // will print 456 ?>]]></example> <break lines="2"/> <blurb>Incompatible:</blurb> <list> <bullet>In PHP 5 $this will never be available when a method is defined as static, not even the $this from the scope where a static method was called from.</bullet> </list> </slide>