cvs: presentations /slides/intro acon05_ref.xml carl.xml categories.txt input_filter2.xml large_scale.xml nz1_ref.xml nz2_ref.xml perf1.xml perf2.xml
php_june05_bm.xml php_opcache_hints.xml php_opcache_hints3.xml php_opcode_caches3.xml who-uses.xml ws5.xml ws9.xml xml_eg.xml

From: Date: Fri, 27 Jan 2006 01:27:19 +0000
Subject: cvs: presentations /slides/intro acon05_ref.xml carl.xml categories.txt input_filter2.xml large_scale.xml nz1_ref.xml nz2_ref.xml perf1.xml perf2.xml
php_june05_bm.xml php_opcache_hints.xml php_opcache_hints3.xml php_opcode_caches3.xml who-uses.xml ws5.xml ws9.xml xml_eg.xml
Groups: php.pres 
Request: Send a blank email to pres+get-1242@lists.php.net to get a copy of this message
rasmus Fri Jan 27 01:27:19 2006 UTC Added files: /presentations/slides/intro categories.txt large_scale.xml perf1.xml perf2.xml Removed files: /presentations/slides/intro php_opcache_hints.xml Modified files: /presentations/slides/intro acon05_ref.xml carl.xml input_filter2.xml nz1_ref.xml nz2_ref.xml php_june05_bm.xml php_opcache_hints3.xml php_opcode_caches3.xml who-uses.xml ws5.xml ws9.xml xml_eg.xml Log: A few new slides

http://cvs.php.net/viewcvs.cgi/presentations/slides/intro/acon05_ref.xml?r1=1.1&r2=1.2&diff_format=u Index: presentations/slides/intro/acon05_ref.xml diff -u presentations/slides/intro/acon05_ref.xml:1.1 presentations/slides/intro/acon05_ref.xml:1.2 --- presentations/slides/intro/acon05_ref.xml:1.1 Wed Dec 14 00:13:18 2005 +++ presentations/slides/intro/acon05_ref.xml Fri Jan 27 01:27:19 2006 @@ -5,6 +5,7 @@ <blurb> </blurb> <link fontsize="3em" marginleft="3em" leader="Slides: " href="http://talks.lerdorf.com/show/acon05"/> <link fontsize="3em" marginleft="3em" leader="APC: " href="http://pecl.php.net/package/APC"/> +<link fontsize="3em" marginleft="3em" leader="Xdebug: " href="http://xdebug.org/"/> <link fontsize="3em" marginleft="3em" leader="Yahoo: " href="http://developer.yahoo.net/"/> <link fontsize="3em" marginleft="3em" leader="Flickr: " href="http://flickr.com/services/api/"/> </slide> http://cvs.php.net/viewcvs.cgi/presentations/slides/intro/carl.xml?r1=1.1&r2=1.2&diff_format=u Index: presentations/slides/intro/carl.xml diff -u presentations/slides/intro/carl.xml:1.1 presentations/slides/intro/carl.xml:1.2 --- presentations/slides/intro/carl.xml:1.1 Tue Jan 20 18:37:15 2004 +++ presentations/slides/intro/carl.xml Fri Jan 27 01:27:19 2006 @@ -1,4 +1,4 @@ -<slide title="CArL"> -<image filename="img_1912.png" align="center" /> -<image filename="img_1917.png" align="center" /> +<slide title="Carl AlexandeR Lerdorf"> +<image filename="carl_nz1.jpg" align="center" /> +<image filename="carl_nz2.jpg" align="center" /> </slide> http://cvs.php.net/viewcvs.cgi/presentations/slides/intro/input_filter2.xml?r1=1.4&r2=1.5&diff_format=u Index: presentations/slides/intro/input_filter2.xml diff -u presentations/slides/intro/input_filter2.xml:1.4 presentations/slides/intro/input_filter2.xml:1.5 --- presentations/slides/intro/input_filter2.xml:1.4 Thu Sep 15 03:24:22 2005 +++ presentations/slides/intro/input_filter2.xml Fri Jan 27 01:27:19 2006 @@ -2,16 +2,52 @@ <break lines="2" /> -<example title="Config"><![CDATA[input_filter.paranoid_admin_default_filter = stripped]]></example> +<example title="Config"><![CDATA[filter.default=special_chars]]></example> -<example title="API" marginleft="1em" marginright="0em"><![CDATA[<?php -$email = input_get(INPUT_POST, 'name', FS_EMAIL); -$age = input_get(INPUT_POST, 'age', FS_NUMBER_INT); -$url = input_get(INPUT_COOKIE, 'url', FS_URL); -$raw_msg = input_get(INPUT_POST, 'msg', FS_UNSAFE_RAW); -$options = input_array(INPUT_GET, 'options', FS_ENCODED); +<example title="API" fontsize="1.5em"><![CDATA[<?php +$email = input_get(INPUT_POST, 'name', FILTER_VALIDATE_EMAIL); +$age = input_get(INPUT_POST, 'age', FILTER_VALIDATE_INT); +$url = input_get(INPUT_COOKIE, 'url', FILTER_VALIDATE_URL); +$raw_msg = input_get(INPUT_POST, 'msg', FILTER_UNSAFE_RAW); +$options = input_array(INPUT_GET, 'options', FILTER_SANITIZE_SPECIAL_CHARS); -$data = filter_data($user_data, FS_STRIPPED); +$data = filter_data($user_data, FILTER_SANITIZE_STRING); ?>]]></example> +<example title="All the Filters" fontsize="1.3em" result="1"><![CDATA[<table border="2" style="font-size:.9em; background:#fff;"> +<?php +function test($data) { + return strtoupper($data); +} +$data1 = "PHP"; +$data2 = "123"; +$data3 = "123abc<>()"; +$data4 = "O'Henry"; +$data5 = "하퍼"; +echo "<tr><th> </th><td>PHP</td><td>123</td><td>123abc&lt;&gt;()</td>"; +echo "<td>O'Henry</td><td>하퍼</td></tr>\n"; +foreach(input_filters_list() as $filter) { + if($filter=="validate_regexp") { + $result1 = filter_data($data1,input_name_to_filter($filter),array("regexp"=>'/^O.*/')); + $result2 = filter_data($data2,input_name_to_filter($filter),array("regexp"=>'/^O.*/')); + $result3 = filter_data($data3,input_name_to_filter($filter),array("regexp"=>'/^O.*/')); + $result4 = filter_data($data4,input_name_to_filter($filter),array("regexp"=>'/^O.*/')); + $result5 = filter_data($data5,input_name_to_filter($filter),array("regexp"=>'/^O.*/')); + } else { + $result1 = filter_data($data1,input_name_to_filter($filter),"test"); + $result2 = filter_data($data2,input_name_to_filter($filter),"test"); + $result3 = filter_data($data3,input_name_to_filter($filter),"test"); + $result4 = filter_data($data4,input_name_to_filter($filter),"test"); + $result5 = filter_data($data5,input_name_to_filter($filter),"test"); + } + echo "<tr><th align='left'>$filter</th>"; + echo "<td>".htmlspecialchars($result1)."</td>"; + echo "<td>".htmlspecialchars($result2)."</td>"; + echo "<td>".htmlspecialchars($result3)."</td>"; + echo "<td>".htmlspecialchars($result4)."</td>"; + echo "<td>".htmlspecialchars($result5)."</td></tr>\n"; +} +?> +</table>]]></example> + </slide> http://cvs.php.net/viewcvs.cgi/presentations/slides/intro/nz1_ref.xml?r1=1.1&r2=1.2&diff_format=u Index: presentations/slides/intro/nz1_ref.xml diff -u presentations/slides/intro/nz1_ref.xml:1.1 presentations/slides/intro/nz1_ref.xml:1.2 --- presentations/slides/intro/nz1_ref.xml:1.1 Wed Dec 28 21:04:40 2005 +++ presentations/slides/intro/nz1_ref.xml Fri Jan 27 01:27:19 2006 @@ -3,7 +3,7 @@ <blurb> </blurb> <blurb> </blurb> <blurb> </blurb> -<link fontsize="3em" marginleft="3em" leader="Slides: " href="http://talks.lerdorf.com/show/acon05"/> +<link fontsize="3em" marginleft="3em" leader="Slides: " href="http://talks.lerdorf.com/show/nz1"/> <link fontsize="3em" marginleft="3em" leader="APC: " href="http://pecl.php.net/package/APC"/> <link fontsize="3em" marginleft="3em" leader="Xdebug: " href="http://xdebug.org/"/> <link fontsize="3em" marginleft="3em" leader="Yahoo: " href="http://developer.yahoo.net/"/> http://cvs.php.net/viewcvs.cgi/presentations/slides/intro/nz2_ref.xml?r1=1.1&r2=1.2&diff_format=u Index: presentations/slides/intro/nz2_ref.xml diff -u presentations/slides/intro/nz2_ref.xml:1.1 presentations/slides/intro/nz2_ref.xml:1.2 --- presentations/slides/intro/nz2_ref.xml:1.1 Thu Dec 29 18:25:22 2005 +++ presentations/slides/intro/nz2_ref.xml Fri Jan 27 01:27:19 2006 @@ -3,9 +3,7 @@ <blurb> </blurb> <blurb> </blurb> <blurb> </blurb> -<link fontsize="3em" marginleft="3em" leader="Slides: " href="http://talks.lerdorf.com/show/acon05"/> +<link fontsize="3em" marginleft="3em" leader="Slides: " href="http://talks.lerdorf.com/show/nz2"/> <link fontsize="3em" marginleft="3em" leader="APC: " href="http://pecl.php.net/package/APC"/> <link fontsize="3em" marginleft="3em" leader="Xdebug: " href="http://xdebug.org/"/> -<link fontsize="3em" marginleft="3em" leader="Yahoo: " href="http://developer.yahoo.net/"/> -<link fontsize="3em" marginleft="3em" leader="Flickr: " href="http://flickr.com/services/api/"/> </slide> http://cvs.php.net/viewcvs.cgi/presentations/slides/intro/php_june05_bm.xml?r1=1.1&r2=1.2&diff_format=u Index: presentations/slides/intro/php_june05_bm.xml diff -u presentations/slides/intro/php_june05_bm.xml:1.1 presentations/slides/intro/php_june05_bm.xml:1.2 --- presentations/slides/intro/php_june05_bm.xml:1.1 Thu Jun 23 11:17:14 2005 +++ presentations/slides/intro/php_june05_bm.xml Fri Jan 27 01:27:19 2006 @@ -22,4 +22,13 @@ but the differences are usually not all that dramatic. </blurb> +<example type="shell" title="Try it" fontsize="1.5em"> +~/php51/Zend> php zend_vm_gen.php --with-vm-kind=GOTO +zend_vm_opcodes.h generated succesfully. +zend_vm_execute.h generated succesfully. +cd .. +./buildconf +./configure ... +make +</example> </slide> http://cvs.php.net/viewcvs.cgi/presentations/slides/intro/php_opcache_hints3.xml?r1=1.1&r2=1.2&diff_format=u Index: presentations/slides/intro/php_opcache_hints3.xml diff -u presentations/slides/intro/php_opcache_hints3.xml:1.1 presentations/slides/intro/php_opcache_hints3.xml:1.2 --- presentations/slides/intro/php_opcache_hints3.xml:1.1 Thu Dec 29 18:25:22 2005 +++ presentations/slides/intro/php_opcache_hints3.xml Fri Jan 27 01:27:19 2006 @@ -34,4 +34,15 @@ settings. The one downside to this approach is that you have to restart the server to make any changes to the config. </blurb> +<example fontsize="1.6em" result="0"><![CDATA[<?php +// load_list takes a text file and turns it +// into a global array cached by APC. +function load_list($name) { + global $$name; + if(!$$name = apc_fetch($name)) { + $$name = explode("\n",trim(file_get_contents($name.'.txt'))); + apc_store($name,$$name); + } +} +?>]]></example> </slide> http://cvs.php.net/viewcvs.cgi/presentations/slides/intro/php_opcode_caches3.xml?r1=1.11&r2=1.12&diff_format=u Index: presentations/slides/intro/php_opcode_caches3.xml diff -u presentations/slides/intro/php_opcode_caches3.xml:1.11 presentations/slides/intro/php_opcode_caches3.xml:1.12 --- presentations/slides/intro/php_opcode_caches3.xml:1.11 Wed Oct 19 15:50:17 2005 +++ presentations/slides/intro/php_opcode_caches3.xml Fri Jan 27 01:27:19 2006 @@ -1,5 +1,5 @@ <slide title="APC Stats"> <break lines="1" /> -<example filename="http://lerdorf.com/apc.php" marginleft="1em" marginright="0em" hide="1" result="1" type="iframe" iheight="700"/> +<example filename="http://localhost/apc.php" marginleft="1em" marginright="0em" hide="1" result="1" type="iframe" iheight="700"/> </slide> http://cvs.php.net/viewcvs.cgi/presentations/slides/intro/who-uses.xml?r1=1.1&r2=1.2&diff_format=u Index: presentations/slides/intro/who-uses.xml diff -u presentations/slides/intro/who-uses.xml:1.1 presentations/slides/intro/who-uses.xml:1.2 --- presentations/slides/intro/who-uses.xml:1.1 Tue Mar 8 15:21:34 2005 +++ presentations/slides/intro/who-uses.xml Fri Jan 27 01:27:19 2006 @@ -11,5 +11,10 @@ <bullet>Cap Gemini</bullet> <bullet>Air Canada</bullet> <bullet>NASA</bullet> + <bullet>Sahana</bullet> + <bullet>WomenOnWaves.org</bullet> + <bullet>www.udf.org</bullet> + <bullet>www.parti-socialiste.fr</bullet> + <bullet>www.pcf.fr</bullet> </list> </slide> http://cvs.php.net/viewcvs.cgi/presentations/slides/intro/ws5.xml?r1=1.4&r2=1.5&diff_format=u Index: presentations/slides/intro/ws5.xml diff -u presentations/slides/intro/ws5.xml:1.4 presentations/slides/intro/ws5.xml:1.5 --- presentations/slides/intro/ws5.xml:1.4 Sun Sep 18 20:12:50 2005 +++ presentations/slides/intro/ws5.xml Fri Jan 27 01:27:19 2006 @@ -17,16 +17,17 @@ <example fontsize="1.2em" title="We can parse it like this" result="1" marginright="0em" required_extension="simplexml"><![CDATA[<?php function photo_url($p, $size='s', $ext='jpg') { - return "http://photos{$p['server']}.flickr.com/{$p['id']}_{$p['secret']}_{$size}.{$ext}"; + return "http://static.flickr.com/{$p['server']}/{$p['id']}_{$p['secret']}_{$size}.{$ext}"; } $url = "http://flickr.com/services/rest/?method=flickr.people.getPublicPhotos". "&user_id=56053642@N00&per_page=2&api_key=3aba8184848f9263b80795c95529bcd1"; $xml = @simplexml_load_file($url) or die("Unable to contact Flickr"); + $perpage = $xml->photos['perpage']; $total = $xml->photos['total']; foreach($xml->photos->photo as $photo) { - echo '<a href="'.photo_url($photo,'b').'" target="_blank">'; + echo '<a href="'.photo_url($photo,'o').'" target="_blank">'; echo '<img src="'.photo_url($photo).'" height="75" width="75" />'; echo '<br />'.$photo['title'].'</a><br />'; } http://cvs.php.net/viewcvs.cgi/presentations/slides/intro/ws9.xml?r1=1.1&r2=1.2&diff_format=u Index: presentations/slides/intro/ws9.xml diff -u presentations/slides/intro/ws9.xml:1.1 presentations/slides/intro/ws9.xml:1.2 --- presentations/slides/intro/ws9.xml:1.1 Wed Nov 9 11:33:37 2005 +++ presentations/slides/intro/ws9.xml Fri Jan 27 01:27:19 2006 @@ -25,8 +25,7 @@ mymap.addTool(new PanTool(), true); mymap.addWidget(new NavigatorWidget()); -olay = new GeoRSSOverlay( - 'http://earthquake.usgs.gov/recenteqsww/catalogs/eqs7day-M2.5.xml'); +olay = new GeoRSSOverlay('http://earthquake.usgs.gov/recenteqsww/catalogs/eqs7day-M2.5.xml'); mymap.addOverlay(olay); </script>]]></example> http://cvs.php.net/viewcvs.cgi/presentations/slides/intro/xml_eg.xml?r1=1.3&r2=1.4&diff_format=u Index: presentations/slides/intro/xml_eg.xml diff -u presentations/slides/intro/xml_eg.xml:1.3 presentations/slides/intro/xml_eg.xml:1.4 --- presentations/slides/intro/xml_eg.xml:1.3 Tue Nov 22 17:29:42 2005 +++ presentations/slides/intro/xml_eg.xml Fri Jan 27 01:27:19 2006 @@ -1,6 +1,7 @@ <slide title="XML"> <break lines="1" /> +<php filename="presentations/slides/intro/cd.php"/> <!-- <php><![CDATA[<?php chdir('presentations/slides/intro');?>]]></php> --> <example title="All XML handling based on libxml2" marginleft="2em" marginright="0em" result="0"><![CDATA[<?php @@ -14,7 +15,7 @@ ?>]]></example> <example title="XPath" result="1" fontsize="1.5em" marginleft="2em" marginright="0em"><![CDATA[<?php -$dom = domdocument::load('presentations/slides/intro/menu.xml'); +$dom = domdocument::load('menu.xml'); $ctx = new domXPath($dom); $result = $ctx->query('/breakfast_menu/food[@itemno > 3]/price/text()'); foreach($result as $node) { @@ -23,15 +24,15 @@ ?>]]></example> <example title="XSL" result="1" marginleft="2em" marginright="0em"><![CDATA[<?php -$dom = domdocument::load('presentations/slides/intro/menu.xml'); -$domxsl = domDocument::load('presentations/slides/intro/menu.xsl'); +$dom = domdocument::load('menu.xml'); +$domxsl = domDocument::load('menu.xsl'); $proc = new xsltProcessor; $proc->importStyleSheet($domxsl); echo $proc->transformToXML($dom); ?>]]></example> <example title="SimpleXML" result="1" marginleft="2em"><![CDATA[<?php - $menu = simplexml_load_file('presentations/slides/intro/menu.xml'); + $menu = simplexml_load_file('menu.xml'); foreach ($menu->food as $item) { echo $item['itemno'] . ") "; echo $item->price . " ... "; http://cvs.php.net/viewcvs.cgi/presentations/slides/intro/categories.txt?view=markup&rev=1.1 Index: presentations/slides/intro/categories.txt +++ presentations/slides/intro/categories.txt Apparel Computers Food Miscellaneous Weird Stuff http://cvs.php.net/viewcvs.cgi/presentations/slides/intro/large_scale.xml?view=markup&rev=1.1 Index: presentations/slides/intro/large_scale.xml +++ presentations/slides/intro/large_scale.xml <slide title="Large-Scale PHP"> <blurb>Scaling PHP is all about scaling your backend</blurb> <image filename="repl2.png" align="center"/> <break lines="1" /> <blurb>Or bigger</blurb> <image filename="repl3.png" align="center"/> <break lines="1" /> </slide> http://cvs.php.net/viewcvs.cgi/presentations/slides/intro/perf1.xml?view=markup&rev=1.1 Index: presentations/slides/intro/perf1.xml +++ presentations/slides/intro/perf1.xml <slide title="Performance"> <break lines="2" /> <list title="No Runtime Templating!"> <bullet> PHP is a templating system, we don't need another one</bullet> <bullet> Ok, sometimes you might, but don't do it at runtime</bullet> </list> <list title="System Calls - Code Changes"> <bullet> No more than 1 stat() per PHP file per request</bullet> <bullet> Don't stat if Apache has already stat'ed the file</bullet> <bullet> Get rid of excessive stats in the streams code</bullet> <bullet> PHP 5.1 now has a stat cache to help this</bullet> </list> <list title="System Calls - Scripting Changes"> <bullet> Use an opcode cache - APC works well</bullet> <bullet> Remove ./ from include_path and use relative path includes</bullet> <bullet> Use just a single base dir in include_path</bullet> <bullet> Avoid include_once/require_once</bullet> </list> </slide> http://cvs.php.net/viewcvs.cgi/presentations/slides/intro/perf2.xml?view=markup&rev=1.1 Index: presentations/slides/intro/perf2.xml +++ presentations/slides/intro/perf2.xml <slide title="Performance"> <break lines="2" /> <list title="Watch those compiler flags"> <bullet> Use non-PIC Apache DSO (gcc -prefer-non-pic) by using --without-pic</bullet> <bullet> Use platform-specific gcc flags</bullet> <bullet> ./configure --disable-all</bullet> </list> <list title="Other Changes"> <bullet> Plenty of custom extensions and limit RINIT</bullet> <bullet> Filter all user data by default</bullet> <bullet> No $_COOKIE nor $_ENV for you and use JIT population for $_SERVER</bullet> <bullet> Careful use of the session extension</bullet> </list> </slide>
« previous php.pres (#1242) next »