cvs: presentations /slides/php5intro blanktitlepage.xml const.xml copy1.xml final.xml final1.php interface2.php newfunctionality.xml overload.php
spl.php spl.xml static.php

From: Date: Sun, 29 Jun 2003 02:52:05 +0000
Subject: cvs: presentations /slides/php5intro blanktitlepage.xml const.xml copy1.xml final.xml final1.php interface2.php newfunctionality.xml overload.php
spl.php spl.xml static.php
Groups: php.pres 
Request: Send a blank email to pres+get-759@lists.php.net to get a copy of this message
shane Sat Jun 28 22:52:05 2003 EDT Added files: /presentations/slides/php5intro blanktitlepage.xml Modified files: /presentations/slides/php5intro const.xml copy1.xml final.xml final1.php interface2.php newfunctionality.xml overload.php spl.php spl.xml static.php Log: initial run of quick fixes to the slides Index: presentations/slides/php5intro/const.xml diff -u presentations/slides/php5intro/const.xml:1.1 presentations/slides/php5intro/const.xml:1.2 --- presentations/slides/php5intro/const.xml:1.1 Sat Mar 22 23:35:37 2003 +++ presentations/slides/php5intro/const.xml Sat Jun 28 22:52:05 2003 @@ -1,7 +1,7 @@ <slide> <title>Constants</title> <blurb> -PHP5 supports %class% and %namespace% level %define%'s, known as constants (%const%). +PHP5 supports %class% level %define%'s, known as constants (%const%). </blurb> <example filename="const.php" result="1" /> </slide> Index: presentations/slides/php5intro/copy1.xml diff -u presentations/slides/php5intro/copy1.xml:1.1 presentations/slides/php5intro/copy1.xml:1.2 --- presentations/slides/php5intro/copy1.xml:1.1 Sat Mar 22 23:35:37 2003 +++ presentations/slides/php5intro/copy1.xml Sat Jun 28 22:52:05 2003 @@ -3,5 +3,5 @@ <blurb fontsize="3.5em"> Clones! </blurb> -<example filename="clone2.php" /> +<example filename="clone2.php" result="1"/> </slide> Index: presentations/slides/php5intro/final.xml diff -u presentations/slides/php5intro/final.xml:1.1 presentations/slides/php5intro/final.xml:1.2 --- presentations/slides/php5intro/final.xml:1.1 Sat Mar 22 23:35:37 2003 +++ presentations/slides/php5intro/final.xml Sat Jun 28 22:52:05 2003 @@ -2,7 +2,7 @@ <title>Final</title> <image filename="music_britney_pepsi_gr.jpg" align="right" /> <blurb fontsize="3.5em"> -Final allows you to restrict a variable from being modified. +Final allows you to restrict modifications to classes and methods. </blurb> <blurb><![CDATA[<br /><br /><br /><br />]]> </blurb> Index: presentations/slides/php5intro/final1.php diff -u presentations/slides/php5intro/final1.php:1.1 presentations/slides/php5intro/final1.php:1.2 --- presentations/slides/php5intro/final1.php:1.1 Sat Mar 22 23:35:37 2003 +++ presentations/slides/php5intro/final1.php Sat Jun 28 22:52:05 2003 @@ -1,16 +1,23 @@ <?php + class Brand { - final public $type = 'Softdrink'; - public $name; + final function show() { + echo "The Pepsi Generation\n"; + } } -class Pepsi extends Brand { - public $type = 'Laxative'; - function __construct() { - $this->name = 'Pepsi'; +final class BrandX extends Brand { +} + +$t = new Brand(); +$t->show(); + +class BetterBrand extends BrandX { + function show() { + echo "Coke is better\n"; } } -$p = new Pepsi(); -echo "{$p->name} is {$p->type}\n"; +$t = new BetterBrand(); +$t->show(); ?> Index: presentations/slides/php5intro/interface2.php diff -u presentations/slides/php5intro/interface2.php:1.1 presentations/slides/php5intro/interface2.php:1.2 --- presentations/slides/php5intro/interface2.php:1.1 Sat Mar 22 23:35:37 2003 +++ presentations/slides/php5intro/interface2.php Sat Jun 28 22:52:05 2003 @@ -10,13 +10,13 @@ public $name; function sleep() { - file_set_contents(SERIALIZED, - serialize($this->name) - ); + $f = fopen(SERIALIZED,'w'); + fwrite($f,serialize($this->name)); + fclose($f); } function wakeup() { - $this->name = unserialize( + $this->name = @unserialize( file_get_contents(SERIALIZED) ); } Index: presentations/slides/php5intro/newfunctionality.xml diff -u presentations/slides/php5intro/newfunctionality.xml:1.4 presentations/slides/php5intro/newfunctionality.xml:1.5 --- presentations/slides/php5intro/newfunctionality.xml:1.4 Sun Mar 23 16:56:19 2003 +++ presentations/slides/php5intro/newfunctionality.xml Sat Jun 28 22:52:05 2003 @@ -1,14 +1,16 @@ <slide title="New Functionality"> <list> <bullet>Revamped Internals</bullet> -<bullet>Namespaces</bullet> -<bullet>Exceptions</bullet> <bullet>*Real* Object Orientation</bullet> +<bullet>Exceptions</bullet> <bullet>Improved Streams API</bullet> +<bullet>Bundled SQLite</bullet> +<bullet>New XML extensions based on libXML-2</bullet> <bullet>SPL</bullet> <bullet>The ~ADT~ extension</bullet> <bullet>RPC extension</bullet> <bullet>~Mono~ extension</bullet> <bullet>Bundled ~cURL~ library</bullet> + </list> </slide> Index: presentations/slides/php5intro/overload.php diff -u presentations/slides/php5intro/overload.php:1.1 presentations/slides/php5intro/overload.php:1.2 --- presentations/slides/php5intro/overload.php:1.1 Sat Mar 22 23:35:37 2003 +++ presentations/slides/php5intro/overload.php Sat Jun 28 22:52:05 2003 @@ -4,11 +4,10 @@ private $file; function __construct($file) { - $this->members = unserialize( + $this->file = $file; + $this->members = @unserialize( file_get_contents($file) ); - - $this->file = $file; } function __get($name) { @@ -20,9 +19,9 @@ } function __destruct() { - file_set_contents($this->file, - serialize($this->members) - ); + $f = fopen($this->file,'w'); + fwrite($f,serialize($this->members)); + fclose($f); } } Index: presentations/slides/php5intro/spl.php diff -u presentations/slides/php5intro/spl.php:1.3 presentations/slides/php5intro/spl.php:1.4 --- presentations/slides/php5intro/spl.php:1.3 Mon Mar 24 23:27:42 2003 +++ presentations/slides/php5intro/spl.php Sat Jun 28 22:52:05 2003 @@ -1,6 +1,6 @@ <?php class dba_reader - implements spl::iterator { + implements spl_iterator { public $db = NULL; function __construct($file, $handler) @@ -18,7 +18,7 @@ } class dba_iter - implements spl::sequence_assoc + implements spl_sequence_assoc { private $obj; private $key = NULL; Index: presentations/slides/php5intro/spl.xml diff -u presentations/slides/php5intro/spl.xml:1.1 presentations/slides/php5intro/spl.xml:1.2 --- presentations/slides/php5intro/spl.xml:1.1 Sun Mar 23 16:51:37 2003 +++ presentations/slides/php5intro/spl.xml Sat Jun 28 22:52:05 2003 @@ -1,8 +1,9 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> <slide> <title>SPL</title> <blurb> SPL is a standard extension by Marcus Börger that allows you to register a set of standard engine level interfaces. </blurb> -<example filename="spl.php" title="Database Mapping" /> +<example filename="spl.php" title="Database Mapping"/> </slide> Index: presentations/slides/php5intro/static.php diff -u presentations/slides/php5intro/static.php:1.1 presentations/slides/php5intro/static.php:1.2 --- presentations/slides/php5intro/static.php:1.1 Sat Mar 22 23:35:37 2003 +++ presentations/slides/php5intro/static.php Sat Jun 28 22:52:05 2003 @@ -1,16 +1,14 @@ <?php -namespace DB { - class Globals { - static $NAME = "sterling"; - static $HOST = "localhost"; - static $USER = "sterling"; - static $PASS = "itsasecret"; - } +class Globals { + static $NAME = "sterling"; + static $HOST = "localhost"; + static $USER = "sterling"; + static $PASS = "itsasecret"; } -echo DB::Globals::$NAME; +echo Globals::$NAME; echo "\n<br />\n"; -DB::Globals::$HOST = "db42.pair.com"; -echo DB::Globals::$HOST; +Globals::$HOST = "db42.pair.com"; +echo Globals::$HOST; echo "\n<br />\n"; ?> Index: presentations/slides/php5intro/blanktitlepage.xml +++ presentations/slides/php5intro/blanktitlepage.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide template="titlepage"> <title>Welcome!</title> </slide>

« previous php.pres (#759) next »