cvs: presentations / migrating-ffm.xml /slides/migrating array_merge.xml automagic_objects.xml casting4.xml casting5.xml cli.xml clone-compat.xml
clone.xml comparing4.xml comparing5.xml compat-mode.xml e_strict.xml get_class.xml mysql.xml questions.xml resources.xml signatures.xml strrpos.xml
this.xml title.xml var_vs_public.xml versions.png /slides/php5intro/nl newobjectmodel.xml newoo.png old-noref.png old-ref.png oldobjectmodel2.xml
| From: | Derick Rethans | Date: | Sat, 01 May 2004 19:29:51 +0000 |
| Subject: | cvs: presentations / migrating-ffm.xml /slides/migrating array_merge.xml automagic_objects.xml casting4.xml casting5.xml cli.xml clone-compat.xml clone.xml comparing4.xml comparing5.xml compat-mode.xml e_strict.xml get_class.xml mysql.xml questions.xml resources.xml signatures.xml strrpos.xml this.xml title.xml var_vs_public.xml versions.png /slides/php5intro/nl newobjectmodel.xml newoo.png old-noref.png old-ref.png oldobjectmodel2.xml |
||
| Groups: | php.pres | ||
| Request: | Send a blank email to pres+get-985@lists.php.net to get a copy of this message | ||
derick Sat May 1 15:29:51 2004 EDT
Added files:
/presentations migrating-ffm.xml
/presentations/slides/migrating array_merge.xml
automagic_objects.xml casting4.xml
casting5.xml cli.xml
clone-compat.xml clone.xml
comparing4.xml comparing5.xml
compat-mode.xml e_strict.xml
get_class.xml mysql.xml
questions.xml resources.xml
signatures.xml strrpos.xml this.xml
title.xml var_vs_public.xml
versions.png
Modified files:
/presentations/slides/php5intro/nl newobjectmodel.xml newoo.png
old-noref.png old-ref.png
oldobjectmodel2.xml
Log:
- Added migrating presentation
http://cvs.php.net/diff.php/presentations/slides/php5intro/nl/newobjectmodel.xml?r1=1.2&r2=1.3&ty=u Index: presentations/slides/php5intro/nl/newobjectmodel.xml diff -u presentations/slides/php5intro/nl/newobjectmodel.xml:1.2 presentations/slides/php5intro/nl/newobjectmodel.xml:1.3 --- presentations/slides/php5intro/nl/newobjectmodel.xml:1.2 Fri Jul 4 15:12:00 2003 +++ presentations/slides/php5intro/nl/newobjectmodel.xml Sat May 1 15:29:50 2004 @@ -5,7 +5,7 @@ <break lines="1" /> <image align="center" filename="newoo.png" /> - <list marginleft="3em" effect="slide" fontsize="3.5em"> + <list marginleft="2em" fontsize="3.5em"> <bullet>Pass by reference</bullet> <bullet>Objects are referenced by a handle.</bullet> </list> http://cvs.php.net/diff.php/presentations/slides/php5intro/nl/newoo.png?r1=1.1&r2=1.2&ty=u Index: presentations/slides/php5intro/nl/newoo.png http://cvs.php.net/diff.php/presentations/slides/php5intro/nl/old-noref.png?r1=1.1&r2=1.2&ty=u Index: presentations/slides/php5intro/nl/old-noref.png http://cvs.php.net/diff.php/presentations/slides/php5intro/nl/old-ref.png?r1=1.1&r2=1.2&ty=u Index: presentations/slides/php5intro/nl/old-ref.png http://cvs.php.net/diff.php/presentations/slides/php5intro/nl/oldobjectmodel2.xml?r1=1.2&r2=1.3&ty=u Index: presentations/slides/php5intro/nl/oldobjectmodel2.xml diff -u presentations/slides/php5intro/nl/oldobjectmodel2.xml:1.2 presentations/slides/php5intro/nl/oldobjectmodel2.xml:1.3 --- presentations/slides/php5intro/nl/oldobjectmodel2.xml:1.2 Fri Jul 4 15:12:00 2003 +++ presentations/slides/php5intro/nl/oldobjectmodel2.xml Sat May 1 15:29:50 2004 @@ -4,7 +4,7 @@ <image align="center" filename="old-noref.png" /> - <list marginleft="3em" effect="slide" fontsize="3.5em"> + <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> http://cvs.php.net/co.php/presentations/migrating-ffm.xml?r=1.1&p=1 Index: presentations/migrating-ffm.xml +++ presentations/migrating-ffm.xml <?xml version="1.0" encoding="iso-8859-1"?> <presentation template="php" navmode="html" navbarbackground="#4373b4" navColor="#f1fbff" logo1="presentations/slides/xdebug/ez.png" stylesheet="presentations/slides/xdebug/style.css" backgroundfixed="1" > <topic>PHP</topic> <title>Migrating from PHP 4 to PHP 5</title> <event>Intl. PHP Conference</event> <location>Amsterdam, the Netherlands</location> <date>May 5, 2004</date> <speaker>Derick Rethans</speaker> <email>derick@php.net</email> <url>http://pres.derickrethans.nl/migrating-ffm</url> <slide>slides/migrating/title.xml</slide> <slide>slides/php5intro/nl/oldobjectmodel2.xml</slide> <slide>slides/php5intro/nl/newobjectmodel.xml</slide> <slide>slides/migrating/clone.xml</slide> <slide>slides/migrating/clone-compat.xml</slide> <slide>slides/migrating/casting4.xml</slide> <slide>slides/migrating/casting5.xml</slide> <slide>slides/migrating/comparing4.xml</slide> <slide>slides/migrating/comparing5.xml</slide> <slide>slides/migrating/compat-mode.xml</slide> <slide>slides/migrating/this.xml</slide> <slide>slides/migrating/get_class.xml</slide> <slide>slides/migrating/e_strict.xml</slide> <slide>slides/migrating/var_vs_public.xml</slide> <slide>slides/migrating/automagic_objects.xml</slide> <slide>slides/migrating/signatures.xml</slide> <slide>slides/migrating/cli.xml</slide> <slide>slides/migrating/mysql.xml</slide> <slide>slides/migrating/array_merge.xml</slide> <slide>slides/migrating/strrpos.xml</slide> <slide>slides/migrating/questions.xml</slide> <slide>slides/migrating/resources.xml</slide> </presentation> http://cvs.php.net/co.php/presentations/slides/migrating/array_merge.xml?r=1.1&p=1 Index: presentations/slides/migrating/array_merge.xml +++ presentations/slides/migrating/array_merge.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>array_merge()</title> <break lines="1"/> <blurb fontsize="4em"> array_merge() no longer accepts non-array parameters to merge. </blurb> <example fontsize="1.3em"><![CDATA[<?php $scandinavia = array('Denmark', 'Norway', 'Sweden', 'Finland'); $uk = "The UK"; $europe = array_merge($scandinavia, $uk); print_r($europe); ? >]]></example> <blurb fontsize="2.5em">PHP 4:</blurb> <example fontsize="1em"><![CDATA[Array ( [0] => Denmark [1] => Norway [2] => Sweden [3] => Finland [4] => The UK ) ]]></example> <blurb fontsize="2.5em">PHP 5:</blurb> <example fontsize="1.5em"><![CDATA[Warning: array_merge(): Argument #2 is not an array in - on line 7]]></example> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/automagic_objects.xml?r=1.1&p=1 Index: presentations/slides/migrating/automagic_objects.xml +++ presentations/slides/migrating/automagic_objects.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>Automagic Objects</title> <break lines="2"/> <example fontsize="1.3em"><![CDATA[<?php $country->name = 'Moldovia'; var_dump($country); ? >]]></example> <break lines="2"/> <blurb fontsize="3.5em">PHP 5:</blurb> <example fontsize="1.3em"><![CDATA[Strict Standards: Creating default object from empty value in - on line 2 object(stdClass)#1 (1) { ["name"]=> string(8) "Moldovia" }]]></example> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/casting4.xml?r=1.1&p=1 Index: presentations/slides/migrating/casting4.xml +++ presentations/slides/migrating/casting4.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>Casting Objects</title> <blurb fontsize="3.5em">PHP 4</blurb> <example fontsize="1.3em"><![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> <blurb fontsize="2.5em">Output:</blurb> <example fontsize="1.3em"><![CDATA[0 1]]></example> <list> <bullet marginleft="0em">In PHP 4 *(int) $object* results in:</bullet> <bullet marginleft="2em">"0" when there are no properties set</bullet> <bullet marginleft="2em">"1" when there are properties set</bullet> </list> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/casting5.xml?r=1.1&p=1 Index: presentations/slides/migrating/casting5.xml +++ presentations/slides/migrating/casting5.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>Casting Objects</title> <blurb fontsize="3.5em">PHP 5</blurb> <example fontsize="1.3em"><![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> <blurb fontsize="2.5em">Output:</blurb> <example fontsize="1.3em"><![CDATA[Notice: Object of class Country could not be converted to integer in - on line 13 1 Notice: Object of class Country could not be converted to integer in - on line 14 1]]></example> <list> <bullet marginleft="0em">In PHP 5 *(int) $object* results in:</bullet> <bullet marginleft="2em">A notice and always "1"</bullet> <bullet marginleft="2em">unless *zend.ze1_compatibility_mode = 1*</bullet> </list> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/cli.xml?r=1.1&p=1 Index: presentations/slides/migrating/cli.xml +++ presentations/slides/migrating/cli.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>Command Line Interface</title> <break lines="3"/> <blurb fontsize="4em"> In the PHP 4 distributions you will find the following binaries: </blurb> <list marginleft="-2em" fontsize="3.5em"> <bullet>php.exe (The CGI binary to use with a web server)</bullet> <bullet>*cli/*php.exe (The CLI binary to use with command line scripts)</bullet> </list> <break lines="4"/> <blurb fontsize="4em"> In the PHP 5 distributions you will find the following binaries: </blurb> <list marginleft="-2em" fontsize="3.5em"> <bullet>php*-cgi*.exe (The CGI binary to use with a web server)</bullet> <bullet>php.exe (The CLI binary to use with command line scripts)</bullet> </list> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/clone-compat.xml?r=1.1&p=1 Index: presentations/slides/migrating/clone-compat.xml +++ presentations/slides/migrating/clone-compat.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>Clone</title> <blurb fontsize="3.5em">The Compatible Way</blurb> <example fontsize="1.3em"><![CDATA[<?php ini_set('zend.ze1_compatibility_mode', '1'); class OS { var $name; function OS($name) { $this->name = $name; } } function changeName(&$obj, $name) { $obj->name = $name; } $linux = new OS('linux'); $win = $linux; changeName($win, 'windows'); echo $linux->name. "\n"; echo $win->name; ? >]]></example> <blurb fontsize="2.5em">Output:</blurb> <example fontsize="1.3em"><![CDATA[linux windows]]></example> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/clone.xml?r=1.1&p=1 Index: presentations/slides/migrating/clone.xml +++ presentations/slides/migrating/clone.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>Clone</title> <blurb fontsize="3.5em">The PHP 5 Way</blurb> <example fontsize="1.3em"><![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"; echo $win->name; ? >]]></example> <blurb fontsize="2.5em">Output:</blurb> <example fontsize="1.3em"><![CDATA[linux windows]]></example> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/comparing4.xml?r=1.1&p=1 Index: presentations/slides/migrating/comparing4.xml +++ presentations/slides/migrating/comparing4.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>Comparing Objects</title> <blurb fontsize="3.5em">PHP 4</blurb> <example fontsize="1.3em"><![CDATA[<?php class Country { var $area; function Country($area) { $this->area = $area; } } $deutschland = new Country('West Europe'); $die_schweiz = new Country('West Europe'); $norway = new Country('Scandinavia'); if ($deutschland == $die_schweiz) { echo "Deutschland ist die Schweiz.\n"; } if ($deutschland == $norway) { echo "Deutschland er Norway.\n"; } ? >]]></example> <list> <bullet marginleft="0em">In PHP 4 *$obj1 == $obj2* results in *true*:</bullet> <bullet effect="slide" marginleft="2em">when the object's properties are the same</bullet> </list> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/comparing5.xml?r=1.1&p=1 Index: presentations/slides/migrating/comparing5.xml +++ presentations/slides/migrating/comparing5.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>Comparing Objects</title> <blurb fontsize="3.5em">PHP 5</blurb> <example fontsize="1.3em"><![CDATA[<?php class Country { var $area; function Country($area) { $this->area = $area; } } $deutschland = new Country('West Europe'); $die_schweiz = new Country('West Europe'); $norway = new Country('Scandinavia'); if ($deutschland == $die_schweiz) { echo "Deutschland ist die Schweiz.\n"; } if ($deutschland == $norway) { echo "Deutschland er Norway.\n"; } ? >]]></example> <list> <bullet marginleft="0em">In PHP 5 *$obj1 == $obj2* results in *true*:</bullet> <bullet effect="slide" marginleft="2em">when the object's *handles* are the same</bullet> </list> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/compat-mode.xml?r=1.1&p=1 Index: presentations/slides/migrating/compat-mode.xml +++ presentations/slides/migrating/compat-mode.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>Compatibility Mode</title> <break lines="4"/> <blurb fontsize="5em"> php.ini: </blurb> <blurb marginleft="3em" fontsize="5em"> %zend.ze1_compatibility_mode = 1% </blurb> <break lines="2"/> <blurb marginright="2em" fontsize="5em"> Affects: </blurb> <list fontsize="5em"> <bullet>cloning objects</bullet> </list> <list fontsize="5em"> <bullet>casting objects</bullet> </list> <list fontsize="5em"> <bullet>comparing objects</bullet> </list> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/e_strict.xml?r=1.1&p=1 Index: presentations/slides/migrating/e_strict.xml +++ presentations/slides/migrating/e_strict.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>E_STRICT</title> <break lines="4"/> <blurb fontsize="4em"> E_STRICT is a new error level. </blurb> <list fontsize="4em"> <bullet>Not part of E_ALL</bullet> <bullet>Numerical value is 2048 (and E_ALL is still 2047)</bullet> <bullet>To see all errors: E_ALL | E_STRICT</bullet> </list> <break lines="4"/> <blurb fontsize="4em"> Affects: </blurb> <list fontsize="4em"> <bullet>Automagically creating objects</bullet> <bullet>var / public modifiers</bullet> <bullet>Constructor naming</bullet> </list> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/get_class.xml?r=1.1&p=1 Index: presentations/slides/migrating/get_class.xml +++ presentations/slides/migrating/get_class.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>get_class()</title> <break lines="2"/> <example fontsize="1.3em"><![CDATA[<?php class TheNetherlands { var $area; function TheNetherlands($area) { $this->area = $area; } } $holland = new TheNetherlands('Holland'); echo get_class($holland), "\n"; ? >]]></example> <break lines="2"/> <blurb fontsize="3.5em">PHP 4:</blurb> <example fontsize="1.3em"><![CDATA[thenetherlands]]></example> <break lines="2"/> <blurb fontsize="3.5em">PHP 5:</blurb> <example fontsize="1.3em"><![CDATA[TheNetherlands]]></example> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/mysql.xml?r=1.1&p=1 Index: presentations/slides/migrating/mysql.xml +++ presentations/slides/migrating/mysql.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>Changes in MySQL</title> <break lines="4"/> <blurb fontsize="4em"> In PHP 5 the MySQL client library is no longer bundled because: </blurb> <list fontsize="4em"> <bullet>Maintainability</bullet> <bullet>License change</bullet> <bullet>Problems with other modules</bullet> </list> <break lines="2"/> <blurb fontsize="4em"> Solution: </blurb> <list fontsize="4em"> <bullet>Install the MySQL client libraries</bullet> <bullet>--with-mysql=[DIR]</bullet> </list> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/questions.xml?r=1.1&p=1 Index: presentations/slides/migrating/questions.xml +++ presentations/slides/migrating/questions.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>Questions</title> <break lines="16"/> <blurb align="center" marginleft="0" marginright="0" fontsize="12em">?</blurb> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/resources.xml?r=1.1&p=1 Index: presentations/slides/migrating/resources.xml +++ presentations/slides/migrating/resources.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>Resources</title> <break lines="3" /> <image align="center" filename="versions.png" /> <break lines="3" /> <link fontsize="3em" marginleft="2em" leader="These Slides: " href="http://pres.derickrethans.nl" target="_new"/> <break lines="5" /> <link fontsize="3em" marginleft="2em" leader="PHP: " href="http://www.php.net" target="_new"/> <link fontsize="3em" marginleft="2em" leader="Questions?: " href="derick@php.net" target="_new"/> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/signatures.xml?r=1.1&p=1 Index: presentations/slides/migrating/signatures.xml +++ presentations/slides/migrating/signatures.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>Signatures</title> <break lines="2"/> <example fontsize="1.3em"><![CDATA[<?php class Scandinavia { function get_countries() { return array('Norway', 'Sweden', 'Denmark', 'Finland'); } } class Europe extends Scandinavia { function get_countries($area) { if ($area == "Scandinavia") { return Scandinavia::get_countries(); } } } ? >]]></example> <break lines="2"/> <blurb fontsize="3.5em">PHP 5:</blurb> <example fontsize="1.3em"><![CDATA[Strict Standards: Declaration of Europe::get_countries() should be compatible with that of Scandinavia::get_countries() in - on line 14]]></example> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/strrpos.xml?r=1.1&p=1 Index: presentations/slides/migrating/strrpos.xml +++ presentations/slides/migrating/strrpos.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>strrpos() and strripos()</title> <break lines="4"/> <blurb fontsize="4em"> </blurb> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/this.xml?r=1.1&p=1 Index: presentations/slides/migrating/this.xml +++ presentations/slides/migrating/this.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>Assigning to $this</title> <break lines="4"/> <blurb fontsize="4em"> PEAR uses this for two things mainly: </blurb> <list marginleft="-2em" fontsize="3.5em"> <bullet type="none">1. returning errors from constructors (*$this = PEAR_Error();*)</bullet> <bullet type="none">2. driver model (*$this = new Slider('Pager');*)</bullet> </list> <break /> <blurb fontsize="4em"> This is no longer allowed in PHP 5, so the classes should be redesigned. </blurb> <break lines="3"/> <blurb fontsize="4em"> Solutions (not compatible with PHP 4). </blurb> <list marginleft="-2em" fontsize="3.5em"> <bullet type="none">1. Use Exceptions</bullet> <bullet type="none">2. driver model (*$this = new Slider('Pager');*)</bullet> </list> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/title.xml?r=1.1&p=1 Index: presentations/slides/migrating/title.xml +++ presentations/slides/migrating/title.xml <slide template="titlepage" fontsize="3.5em"> <title>Welcome!</title> <break lines="3"/> <image align="center" filename="versions.png" /> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/var_vs_public.xml?r=1.1&p=1 Index: presentations/slides/migrating/var_vs_public.xml +++ presentations/slides/migrating/var_vs_public.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>var vs. public</title> <break lines="2"/> <example fontsize="1.3em"><![CDATA[<?php class Russia { var $local_name; function Russia() { $this->local_name = "Roosjia"; } } ? >]]></example> <break lines="2"/> <blurb fontsize="3.5em">PHP 5:</blurb> <example fontsize="1.3em"><![CDATA[Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in - on line 3]]></example> </slide>
http://cvs.php.net/diff.php/presentations/slides/php5intro/nl/newobjectmodel.xml?r1=1.2&r2=1.3&ty=u Index: presentations/slides/php5intro/nl/newobjectmodel.xml diff -u presentations/slides/php5intro/nl/newobjectmodel.xml:1.2 presentations/slides/php5intro/nl/newobjectmodel.xml:1.3 --- presentations/slides/php5intro/nl/newobjectmodel.xml:1.2 Fri Jul 4 15:12:00 2003 +++ presentations/slides/php5intro/nl/newobjectmodel.xml Sat May 1 15:29:50 2004 @@ -5,7 +5,7 @@ <break lines="1" /> <image align="center" filename="newoo.png" /> - <list marginleft="3em" effect="slide" fontsize="3.5em"> + <list marginleft="2em" fontsize="3.5em"> <bullet>Pass by reference</bullet> <bullet>Objects are referenced by a handle.</bullet> </list> http://cvs.php.net/diff.php/presentations/slides/php5intro/nl/newoo.png?r1=1.1&r2=1.2&ty=u Index: presentations/slides/php5intro/nl/newoo.png http://cvs.php.net/diff.php/presentations/slides/php5intro/nl/old-noref.png?r1=1.1&r2=1.2&ty=u Index: presentations/slides/php5intro/nl/old-noref.png http://cvs.php.net/diff.php/presentations/slides/php5intro/nl/old-ref.png?r1=1.1&r2=1.2&ty=u Index: presentations/slides/php5intro/nl/old-ref.png http://cvs.php.net/diff.php/presentations/slides/php5intro/nl/oldobjectmodel2.xml?r1=1.2&r2=1.3&ty=u Index: presentations/slides/php5intro/nl/oldobjectmodel2.xml diff -u presentations/slides/php5intro/nl/oldobjectmodel2.xml:1.2 presentations/slides/php5intro/nl/oldobjectmodel2.xml:1.3 --- presentations/slides/php5intro/nl/oldobjectmodel2.xml:1.2 Fri Jul 4 15:12:00 2003 +++ presentations/slides/php5intro/nl/oldobjectmodel2.xml Sat May 1 15:29:50 2004 @@ -4,7 +4,7 @@ <image align="center" filename="old-noref.png" /> - <list marginleft="3em" effect="slide" fontsize="3.5em"> + <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> http://cvs.php.net/co.php/presentations/migrating-ffm.xml?r=1.1&p=1 Index: presentations/migrating-ffm.xml +++ presentations/migrating-ffm.xml <?xml version="1.0" encoding="iso-8859-1"?> <presentation template="php" navmode="html" navbarbackground="#4373b4" navColor="#f1fbff" logo1="presentations/slides/xdebug/ez.png" stylesheet="presentations/slides/xdebug/style.css" backgroundfixed="1" > <topic>PHP</topic> <title>Migrating from PHP 4 to PHP 5</title> <event>Intl. PHP Conference</event> <location>Amsterdam, the Netherlands</location> <date>May 5, 2004</date> <speaker>Derick Rethans</speaker> <email>derick@php.net</email> <url>http://pres.derickrethans.nl/migrating-ffm</url> <slide>slides/migrating/title.xml</slide> <slide>slides/php5intro/nl/oldobjectmodel2.xml</slide> <slide>slides/php5intro/nl/newobjectmodel.xml</slide> <slide>slides/migrating/clone.xml</slide> <slide>slides/migrating/clone-compat.xml</slide> <slide>slides/migrating/casting4.xml</slide> <slide>slides/migrating/casting5.xml</slide> <slide>slides/migrating/comparing4.xml</slide> <slide>slides/migrating/comparing5.xml</slide> <slide>slides/migrating/compat-mode.xml</slide> <slide>slides/migrating/this.xml</slide> <slide>slides/migrating/get_class.xml</slide> <slide>slides/migrating/e_strict.xml</slide> <slide>slides/migrating/var_vs_public.xml</slide> <slide>slides/migrating/automagic_objects.xml</slide> <slide>slides/migrating/signatures.xml</slide> <slide>slides/migrating/cli.xml</slide> <slide>slides/migrating/mysql.xml</slide> <slide>slides/migrating/array_merge.xml</slide> <slide>slides/migrating/strrpos.xml</slide> <slide>slides/migrating/questions.xml</slide> <slide>slides/migrating/resources.xml</slide> </presentation> http://cvs.php.net/co.php/presentations/slides/migrating/array_merge.xml?r=1.1&p=1 Index: presentations/slides/migrating/array_merge.xml +++ presentations/slides/migrating/array_merge.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>array_merge()</title> <break lines="1"/> <blurb fontsize="4em"> array_merge() no longer accepts non-array parameters to merge. </blurb> <example fontsize="1.3em"><![CDATA[<?php $scandinavia = array('Denmark', 'Norway', 'Sweden', 'Finland'); $uk = "The UK"; $europe = array_merge($scandinavia, $uk); print_r($europe); ? >]]></example> <blurb fontsize="2.5em">PHP 4:</blurb> <example fontsize="1em"><![CDATA[Array ( [0] => Denmark [1] => Norway [2] => Sweden [3] => Finland [4] => The UK ) ]]></example> <blurb fontsize="2.5em">PHP 5:</blurb> <example fontsize="1.5em"><![CDATA[Warning: array_merge(): Argument #2 is not an array in - on line 7]]></example> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/automagic_objects.xml?r=1.1&p=1 Index: presentations/slides/migrating/automagic_objects.xml +++ presentations/slides/migrating/automagic_objects.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>Automagic Objects</title> <break lines="2"/> <example fontsize="1.3em"><![CDATA[<?php $country->name = 'Moldovia'; var_dump($country); ? >]]></example> <break lines="2"/> <blurb fontsize="3.5em">PHP 5:</blurb> <example fontsize="1.3em"><![CDATA[Strict Standards: Creating default object from empty value in - on line 2 object(stdClass)#1 (1) { ["name"]=> string(8) "Moldovia" }]]></example> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/casting4.xml?r=1.1&p=1 Index: presentations/slides/migrating/casting4.xml +++ presentations/slides/migrating/casting4.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>Casting Objects</title> <blurb fontsize="3.5em">PHP 4</blurb> <example fontsize="1.3em"><![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> <blurb fontsize="2.5em">Output:</blurb> <example fontsize="1.3em"><![CDATA[0 1]]></example> <list> <bullet marginleft="0em">In PHP 4 *(int) $object* results in:</bullet> <bullet marginleft="2em">"0" when there are no properties set</bullet> <bullet marginleft="2em">"1" when there are properties set</bullet> </list> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/casting5.xml?r=1.1&p=1 Index: presentations/slides/migrating/casting5.xml +++ presentations/slides/migrating/casting5.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>Casting Objects</title> <blurb fontsize="3.5em">PHP 5</blurb> <example fontsize="1.3em"><![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> <blurb fontsize="2.5em">Output:</blurb> <example fontsize="1.3em"><![CDATA[Notice: Object of class Country could not be converted to integer in - on line 13 1 Notice: Object of class Country could not be converted to integer in - on line 14 1]]></example> <list> <bullet marginleft="0em">In PHP 5 *(int) $object* results in:</bullet> <bullet marginleft="2em">A notice and always "1"</bullet> <bullet marginleft="2em">unless *zend.ze1_compatibility_mode = 1*</bullet> </list> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/cli.xml?r=1.1&p=1 Index: presentations/slides/migrating/cli.xml +++ presentations/slides/migrating/cli.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>Command Line Interface</title> <break lines="3"/> <blurb fontsize="4em"> In the PHP 4 distributions you will find the following binaries: </blurb> <list marginleft="-2em" fontsize="3.5em"> <bullet>php.exe (The CGI binary to use with a web server)</bullet> <bullet>*cli/*php.exe (The CLI binary to use with command line scripts)</bullet> </list> <break lines="4"/> <blurb fontsize="4em"> In the PHP 5 distributions you will find the following binaries: </blurb> <list marginleft="-2em" fontsize="3.5em"> <bullet>php*-cgi*.exe (The CGI binary to use with a web server)</bullet> <bullet>php.exe (The CLI binary to use with command line scripts)</bullet> </list> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/clone-compat.xml?r=1.1&p=1 Index: presentations/slides/migrating/clone-compat.xml +++ presentations/slides/migrating/clone-compat.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>Clone</title> <blurb fontsize="3.5em">The Compatible Way</blurb> <example fontsize="1.3em"><![CDATA[<?php ini_set('zend.ze1_compatibility_mode', '1'); class OS { var $name; function OS($name) { $this->name = $name; } } function changeName(&$obj, $name) { $obj->name = $name; } $linux = new OS('linux'); $win = $linux; changeName($win, 'windows'); echo $linux->name. "\n"; echo $win->name; ? >]]></example> <blurb fontsize="2.5em">Output:</blurb> <example fontsize="1.3em"><![CDATA[linux windows]]></example> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/clone.xml?r=1.1&p=1 Index: presentations/slides/migrating/clone.xml +++ presentations/slides/migrating/clone.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>Clone</title> <blurb fontsize="3.5em">The PHP 5 Way</blurb> <example fontsize="1.3em"><![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"; echo $win->name; ? >]]></example> <blurb fontsize="2.5em">Output:</blurb> <example fontsize="1.3em"><![CDATA[linux windows]]></example> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/comparing4.xml?r=1.1&p=1 Index: presentations/slides/migrating/comparing4.xml +++ presentations/slides/migrating/comparing4.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>Comparing Objects</title> <blurb fontsize="3.5em">PHP 4</blurb> <example fontsize="1.3em"><![CDATA[<?php class Country { var $area; function Country($area) { $this->area = $area; } } $deutschland = new Country('West Europe'); $die_schweiz = new Country('West Europe'); $norway = new Country('Scandinavia'); if ($deutschland == $die_schweiz) { echo "Deutschland ist die Schweiz.\n"; } if ($deutschland == $norway) { echo "Deutschland er Norway.\n"; } ? >]]></example> <list> <bullet marginleft="0em">In PHP 4 *$obj1 == $obj2* results in *true*:</bullet> <bullet effect="slide" marginleft="2em">when the object's properties are the same</bullet> </list> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/comparing5.xml?r=1.1&p=1 Index: presentations/slides/migrating/comparing5.xml +++ presentations/slides/migrating/comparing5.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>Comparing Objects</title> <blurb fontsize="3.5em">PHP 5</blurb> <example fontsize="1.3em"><![CDATA[<?php class Country { var $area; function Country($area) { $this->area = $area; } } $deutschland = new Country('West Europe'); $die_schweiz = new Country('West Europe'); $norway = new Country('Scandinavia'); if ($deutschland == $die_schweiz) { echo "Deutschland ist die Schweiz.\n"; } if ($deutschland == $norway) { echo "Deutschland er Norway.\n"; } ? >]]></example> <list> <bullet marginleft="0em">In PHP 5 *$obj1 == $obj2* results in *true*:</bullet> <bullet effect="slide" marginleft="2em">when the object's *handles* are the same</bullet> </list> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/compat-mode.xml?r=1.1&p=1 Index: presentations/slides/migrating/compat-mode.xml +++ presentations/slides/migrating/compat-mode.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>Compatibility Mode</title> <break lines="4"/> <blurb fontsize="5em"> php.ini: </blurb> <blurb marginleft="3em" fontsize="5em"> %zend.ze1_compatibility_mode = 1% </blurb> <break lines="2"/> <blurb marginright="2em" fontsize="5em"> Affects: </blurb> <list fontsize="5em"> <bullet>cloning objects</bullet> </list> <list fontsize="5em"> <bullet>casting objects</bullet> </list> <list fontsize="5em"> <bullet>comparing objects</bullet> </list> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/e_strict.xml?r=1.1&p=1 Index: presentations/slides/migrating/e_strict.xml +++ presentations/slides/migrating/e_strict.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>E_STRICT</title> <break lines="4"/> <blurb fontsize="4em"> E_STRICT is a new error level. </blurb> <list fontsize="4em"> <bullet>Not part of E_ALL</bullet> <bullet>Numerical value is 2048 (and E_ALL is still 2047)</bullet> <bullet>To see all errors: E_ALL | E_STRICT</bullet> </list> <break lines="4"/> <blurb fontsize="4em"> Affects: </blurb> <list fontsize="4em"> <bullet>Automagically creating objects</bullet> <bullet>var / public modifiers</bullet> <bullet>Constructor naming</bullet> </list> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/get_class.xml?r=1.1&p=1 Index: presentations/slides/migrating/get_class.xml +++ presentations/slides/migrating/get_class.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>get_class()</title> <break lines="2"/> <example fontsize="1.3em"><![CDATA[<?php class TheNetherlands { var $area; function TheNetherlands($area) { $this->area = $area; } } $holland = new TheNetherlands('Holland'); echo get_class($holland), "\n"; ? >]]></example> <break lines="2"/> <blurb fontsize="3.5em">PHP 4:</blurb> <example fontsize="1.3em"><![CDATA[thenetherlands]]></example> <break lines="2"/> <blurb fontsize="3.5em">PHP 5:</blurb> <example fontsize="1.3em"><![CDATA[TheNetherlands]]></example> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/mysql.xml?r=1.1&p=1 Index: presentations/slides/migrating/mysql.xml +++ presentations/slides/migrating/mysql.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>Changes in MySQL</title> <break lines="4"/> <blurb fontsize="4em"> In PHP 5 the MySQL client library is no longer bundled because: </blurb> <list fontsize="4em"> <bullet>Maintainability</bullet> <bullet>License change</bullet> <bullet>Problems with other modules</bullet> </list> <break lines="2"/> <blurb fontsize="4em"> Solution: </blurb> <list fontsize="4em"> <bullet>Install the MySQL client libraries</bullet> <bullet>--with-mysql=[DIR]</bullet> </list> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/questions.xml?r=1.1&p=1 Index: presentations/slides/migrating/questions.xml +++ presentations/slides/migrating/questions.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>Questions</title> <break lines="16"/> <blurb align="center" marginleft="0" marginright="0" fontsize="12em">?</blurb> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/resources.xml?r=1.1&p=1 Index: presentations/slides/migrating/resources.xml +++ presentations/slides/migrating/resources.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>Resources</title> <break lines="3" /> <image align="center" filename="versions.png" /> <break lines="3" /> <link fontsize="3em" marginleft="2em" leader="These Slides: " href="http://pres.derickrethans.nl" target="_new"/> <break lines="5" /> <link fontsize="3em" marginleft="2em" leader="PHP: " href="http://www.php.net" target="_new"/> <link fontsize="3em" marginleft="2em" leader="Questions?: " href="derick@php.net" target="_new"/> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/signatures.xml?r=1.1&p=1 Index: presentations/slides/migrating/signatures.xml +++ presentations/slides/migrating/signatures.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>Signatures</title> <break lines="2"/> <example fontsize="1.3em"><![CDATA[<?php class Scandinavia { function get_countries() { return array('Norway', 'Sweden', 'Denmark', 'Finland'); } } class Europe extends Scandinavia { function get_countries($area) { if ($area == "Scandinavia") { return Scandinavia::get_countries(); } } } ? >]]></example> <break lines="2"/> <blurb fontsize="3.5em">PHP 5:</blurb> <example fontsize="1.3em"><![CDATA[Strict Standards: Declaration of Europe::get_countries() should be compatible with that of Scandinavia::get_countries() in - on line 14]]></example> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/strrpos.xml?r=1.1&p=1 Index: presentations/slides/migrating/strrpos.xml +++ presentations/slides/migrating/strrpos.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>strrpos() and strripos()</title> <break lines="4"/> <blurb fontsize="4em"> </blurb> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/this.xml?r=1.1&p=1 Index: presentations/slides/migrating/this.xml +++ presentations/slides/migrating/this.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>Assigning to $this</title> <break lines="4"/> <blurb fontsize="4em"> PEAR uses this for two things mainly: </blurb> <list marginleft="-2em" fontsize="3.5em"> <bullet type="none">1. returning errors from constructors (*$this = PEAR_Error();*)</bullet> <bullet type="none">2. driver model (*$this = new Slider('Pager');*)</bullet> </list> <break /> <blurb fontsize="4em"> This is no longer allowed in PHP 5, so the classes should be redesigned. </blurb> <break lines="3"/> <blurb fontsize="4em"> Solutions (not compatible with PHP 4). </blurb> <list marginleft="-2em" fontsize="3.5em"> <bullet type="none">1. Use Exceptions</bullet> <bullet type="none">2. driver model (*$this = new Slider('Pager');*)</bullet> </list> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/title.xml?r=1.1&p=1 Index: presentations/slides/migrating/title.xml +++ presentations/slides/migrating/title.xml <slide template="titlepage" fontsize="3.5em"> <title>Welcome!</title> <break lines="3"/> <image align="center" filename="versions.png" /> </slide> http://cvs.php.net/co.php/presentations/slides/migrating/var_vs_public.xml?r=1.1&p=1 Index: presentations/slides/migrating/var_vs_public.xml +++ presentations/slides/migrating/var_vs_public.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>var vs. public</title> <break lines="2"/> <example fontsize="1.3em"><![CDATA[<?php class Russia { var $local_name; function Russia() { $this->local_name = "Roosjia"; } } ? >]]></example> <break lines="2"/> <blurb fontsize="3.5em">PHP 5:</blurb> <example fontsize="1.3em"><![CDATA[Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in - on line 3]]></example> </slide>