cvs: presentations / mtladv05.xml /slides/intro design.xml dumb.xml high_complexity_agenda.xml high_traffic_agenda.xml input_filter2.xml large.xml
large_teams_agenda.xml max_dev.xml mtl_agenda.xml pecl_gen.snippet pecl_gen.xml php-i18n.xml php-l10n.xml php_tuning2.xml phpt_dev.xml pi.xml
repl1.xml security_agenda.xml sneak.xml tools_dev.xml urlapi.xml worries.xml ws1.xml ws2.xml ws3.xml
| From: | Rasmus Lerdorf | Date: | Tue, 12 Apr 2005 21:39:05 +0000 |
| Subject: | cvs: presentations / mtladv05.xml /slides/intro design.xml dumb.xml high_complexity_agenda.xml high_traffic_agenda.xml input_filter2.xml large.xml large_teams_agenda.xml max_dev.xml mtl_agenda.xml pecl_gen.snippet pecl_gen.xml php-i18n.xml php-l10n.xml php_tuning2.xml phpt_dev.xml pi.xml repl1.xml security_agenda.xml sneak.xml tools_dev.xml urlapi.xml worries.xml ws1.xml ws2.xml ws3.xml |
||
| Groups: | php.pres | ||
| Request: | Send a blank email to pres+get-1106@lists.php.net to get a copy of this message | ||
rasmus Tue Apr 12 17:39:05 2005 EDT
Added files:
/presentations mtladv05.xml
/presentations/slides/intro high_complexity_agenda.xml
high_traffic_agenda.xml
large_teams_agenda.xml max_dev.xml
mtl_agenda.xml pecl_gen.snippet
pecl_gen.xml php-i18n.xml php-l10n.xml
phpt_dev.xml security_agenda.xml
sneak.xml tools_dev.xml ws1.xml ws2.xml
ws3.xml
Modified files:
/presentations/slides/intro design.xml dumb.xml input_filter2.xml
large.xml php_tuning2.xml pi.xml
repl1.xml urlapi.xml worries.xml
Log:
Montreal talk
http://cvs.php.net/diff.php/presentations/slides/intro/design.xml?r1=1.2&r2=1.3&ty=u Index: presentations/slides/intro/design.xml diff -u presentations/slides/intro/design.xml:1.2 presentations/slides/intro/design.xml:1.3 --- presentations/slides/intro/design.xml:1.2 Wed Sep 22 15:15:35 2004 +++ presentations/slides/intro/design.xml Tue Apr 12 17:39:05 2005 @@ -1,5 +1,5 @@ <slide title="Design"> -<break lines="2" /> +<break lines="1" /> <list title="Outside-in and Inside-out view" fontsize="4em"> <bullet> What do outsiders (users) see looking in?</bullet> <bullet> What do insiders (developers) see looking out?</bullet> @@ -13,7 +13,7 @@ <list title="Inside-out" fontsize="4em"> <bullet>File Layout</bullet> <bullet>Separation of layout from business logic</bullet> +<bullet>Application API</bullet> <bullet>Server Architecture and Load Balancing</bullet> </list> - </slide> http://cvs.php.net/diff.php/presentations/slides/intro/dumb.xml?r1=1.1&r2=1.2&ty=u Index: presentations/slides/intro/dumb.xml diff -u presentations/slides/intro/dumb.xml:1.1 presentations/slides/intro/dumb.xml:1.2 --- presentations/slides/intro/dumb.xml:1.1 Fri Jan 14 11:12:14 2005 +++ presentations/slides/intro/dumb.xml Tue Apr 12 17:39:05 2005 @@ -1,19 +1,20 @@ <slide title="Direct Attacks"> +<image filename="dewie5.gif" align="right" marginright="10"/> <blurb title="Dumb things" /> <blurb> Don't do dumb things! </blurb> -<example><![CDATA[<?php +<example marginright="25"><![CDATA[<?php system($user_data); ?>]]></example> -<example><![CDATA[<?php +<example marginright="25"><![CDATA[<?php include "$path/$user_data"; ?>]]></example> -<example><![CDATA[<?php +<example marginright="25"><![CDATA[<?php eval($user_data); ?>]]></example> http://cvs.php.net/diff.php/presentations/slides/intro/input_filter2.xml?r1=1.1&r2=1.2&ty=u Index: presentations/slides/intro/input_filter2.xml diff -u presentations/slides/intro/input_filter2.xml:1.1 presentations/slides/intro/input_filter2.xml:1.2 --- presentations/slides/intro/input_filter2.xml:1.1 Fri Jan 14 11:12:14 2005 +++ presentations/slides/intro/input_filter2.xml Tue Apr 12 17:39:05 2005 @@ -11,12 +11,12 @@ <break lines="6" /> <example title="API?"><![CDATA[<?php - $name = pfilt(POST, 'name'); /* Default filter */ - $age = pfilt(POST, 'age', PFILT_INTEGER); - $addr = pfilt(POST, 'addr', PFILT_TEXT, 'UTF-8'); + $name = filter(POST, 'name'); /* Default filter */ + $age = filter(POST, 'age', PFILT_INTEGER); + $addr = filter(POST, 'addr', PFILT_TEXT, 'UTF-8'); ?>]]></example> -<example title="Config"><![CDATA[input_filter.default = PFILT_TEXT +<example title="Config"><![CDATA[input_filter.default = FILTER_TEXT ]]></example> <example title="Strip or Escape?"><![CDATA[abc;123{def} http://cvs.php.net/diff.php/presentations/slides/intro/large.xml?r1=1.2&r2=1.3&ty=u Index: presentations/slides/intro/large.xml diff -u presentations/slides/intro/large.xml:1.2 presentations/slides/intro/large.xml:1.3 --- presentations/slides/intro/large.xml:1.2 Wed Sep 22 15:15:35 2004 +++ presentations/slides/intro/large.xml Tue Apr 12 17:39:05 2005 @@ -12,6 +12,6 @@ <blurb>Merger of 24 Web Companies</blurb> <image filename="24.png" align="center" /> -<blurb>Make that 26 now with FareChase and MusicMatch</blurb> +<blurb>Make that 27 now with FareChase, MusicMatch and Flickr</blurb> </slide> http://cvs.php.net/diff.php/presentations/slides/intro/php_tuning2.xml?r1=1.2&r2=1.3&ty=u Index: presentations/slides/intro/php_tuning2.xml diff -u presentations/slides/intro/php_tuning2.xml:1.2 presentations/slides/intro/php_tuning2.xml:1.3 --- presentations/slides/intro/php_tuning2.xml:1.2 Tue Jan 20 13:37:15 2004 +++ presentations/slides/intro/php_tuning2.xml Tue Apr 12 17:39:05 2005 @@ -1,5 +1,10 @@ <slide title="Tuning"> +<example title="./configure" type="shell"> +./configure --with-apxs=/usr/sbin/apxs --without-pic \ + --with-config-file-scan-dir=/etc/php +</example> + <example title="include_path" type="shell"> include_path = "/usr/share/pear:." </example> @@ -14,7 +19,7 @@ </example> <blurb>open_basedir checking adds some extra syscalls to every file operation. It can be useful, -but it is rather expensive, so turn it off if you don't think you need it.</blurb> +but it is rather expensive, so turn it off if you don't you need it.</blurb> <example title="variables_order" type="shell"> variables_order = "GPC" http://cvs.php.net/diff.php/presentations/slides/intro/pi.xml?r1=1.1&r2=1.2&ty=u Index: presentations/slides/intro/pi.xml diff -u presentations/slides/intro/pi.xml:1.1 presentations/slides/intro/pi.xml:1.2 --- presentations/slides/intro/pi.xml:1.1 Tue Jul 2 01:24:59 2002 +++ presentations/slides/intro/pi.xml Tue Apr 12 17:39:05 2005 @@ -3,7 +3,7 @@ $PATH_INFO is your friend when it comes to creating clean URLS. Take for example this URL: </blurb> -<example>http://www.company.com/products/routers</example> +<example format="text">http://www.company.com/products/routers</example> <blurb> If the Apache configuration contains this block: </blurb> http://cvs.php.net/diff.php/presentations/slides/intro/repl1.xml?r1=1.4&r2=1.5&ty=u Index: presentations/slides/intro/repl1.xml diff -u presentations/slides/intro/repl1.xml:1.4 presentations/slides/intro/repl1.xml:1.5 --- presentations/slides/intro/repl1.xml:1.4 Sat Nov 2 13:45:18 2002 +++ presentations/slides/intro/repl1.xml Tue Apr 12 17:39:05 2005 @@ -1,6 +1,6 @@ <slide title="MySQL Replication"> <blurb> -As of version 3.23.15 (try to use 3.23.29 or later), MySQL supports one-way replication. +MySQL supports one-way replication. Since most web applications usually have more reads than writes, an architecture which distributes reads across multiple servers can be very beneficial. </blurb> @@ -15,12 +15,8 @@ <blurb> And add a replication user id for slaves to log in as: </blurb> -<example type="shell"><![CDATA[GRANT FILE ON *.* TO repl@"%" IDENTIFIED BY 'foobar';]]></example> +<example type="shell" fontsize="1.7em"><![CDATA[GRANT REPLICATION SLAVE ON *.* TO repl@"%" IDENTIFIED BY 'foobar';]]></example> -<blurb> -If you are using MySQL 4.0.2 or later, replace %FILE% with %REPLICATION SLAVE% in the above. -Then on your slave servers: -</blurb> <example type="shell">[mysqld] set-variable = max_connections=200 log-bin http://cvs.php.net/diff.php/presentations/slides/intro/urlapi.xml?r1=1.1&r2=1.2&ty=u Index: presentations/slides/intro/urlapi.xml diff -u presentations/slides/intro/urlapi.xml:1.1 presentations/slides/intro/urlapi.xml:1.2 --- presentations/slides/intro/urlapi.xml:1.1 Thu Jan 22 17:05:21 2004 +++ presentations/slides/intro/urlapi.xml Tue Apr 12 17:39:05 2005 @@ -1,6 +1,6 @@ <slide title="URL API"> <break lines="1" /> -<example fontsize="3em"><![CDATA[http://www.example.com/a/b?c=1&d=2]]></example> +<example fontsize="3em" format="text"><![CDATA[http://www.example.com/a/b?c=1&d=2]]></example> <blurb fontsize="4em">|ff0000|/a/b| is what we are looking for</blurb> <blurb fontsize="4em">|ff0000|?c=1&d=2| are optional modifiers</blurb> </slide> http://cvs.php.net/diff.php/presentations/slides/intro/worries.xml?r1=1.1&r2=1.2&ty=u Index: presentations/slides/intro/worries.xml diff -u presentations/slides/intro/worries.xml:1.1 presentations/slides/intro/worries.xml:1.2 --- presentations/slides/intro/worries.xml:1.1 Fri Jan 14 11:12:15 2005 +++ presentations/slides/intro/worries.xml Tue Apr 12 17:39:05 2005 @@ -1,12 +1,12 @@ <slide title="Worries"> +<image filename="dewie9.gif" align="left" marginleft="10" /> <break lines="2" /> - -<blurb align="center" fontsize="8em">Indirect Attacks</blurb> +<blurb align="left" fontsize="8em">Indirect Attacks</blurb> <blurb marginleft="5em" fontsize="5em">* XSS - Cross-site scripting attacks</blurb> <blurb marginleft="5em" fontsize="5em">* Spoofing</blurb> -<blurb align="center" fontsize="8em">Direct Attacks</blurb> +<blurb marginleft="2.8em" fontsize="8em">Direct Attacks</blurb> <blurb marginleft="5em" fontsize="5em">* Buffer Overflows</blurb> <blurb marginleft="5em" fontsize="5em">* Path tricks</blurb> <blurb marginleft="5em" fontsize="5em">* Application logic attacks</blurb> http://cvs.php.net/co.php/presentations/mtladv05.xml?r=1.1&p=1 Index: presentations/mtladv05.xml +++ presentations/mtladv05.xml <presentation template="php2" navmode="html" titlecolor="#1111aa" navbarbackground="url(images/trans-ffffff.png)" logo1="images/php-med-trans-light.gif" titlesize="2em" navbarheight="4.1em" > <!-- 90 Minutes --> <topic>PHP</topic> <title>Advanced PHP</title> <event>PHP Québec</event> <location>Montréal</location> <date>March 31, 2005</date> <speaker>Rasmus Lerdorf</speaker> <email>rasmus@php.net</email> <url>http://talks.php.net/mtladv05</url> <slide>slides/intro/titlepage.xml</slide> <slide>slides/intro/mtl_agenda.xml</slide> <slide>slides/intro/security_agenda.xml</slide> <chapter title="Security"> <slide>slides/intro/worries.xml</slide> <slide>slides/intro/overflows.xml</slide> <slide>slides/intro/dumb.xml</slide> <slide>slides/intro/input_filter.xml</slide> <slide>slides/intro/input_filter2.xml</slide> </chapter> <slide>slides/intro/large_teams_agenda.xml</slide> <chapter title="Large developer teams"> <slide>slides/intro/large.xml</slide> <slide>slides/intro/tools_dev.xml</slide> <slide>slides/intro/phpt_dev.xml</slide> </chapter> <slide>slides/intro/high_complexity_agenda.xml</slide> <chapter title="High-complexity applications"> <slide>slides/intro/max_dev.xml</slide> <slide>slides/intro/design.xml</slide> <slide>slides/intro/urlapi.xml</slide> <slide>slides/intro/pi.xml</slide> <slide>slides/intro/errdoc.xml</slide> <slide>slides/intro/file_layout.xml</slide> <slide>slides/intro/app_arch.xml</slide> <slide>slides/intro/poll1.xml</slide> <slide>slides/intro/poll2.xml</slide> <slide>slides/intro/poll3.xml</slide> </chapter> <slide>slides/intro/high_traffic_agenda.xml</slide> <chapter title="High-traffic Applications"> <slide>slides/intro/php_tuning1.xml</slide> <slide>slides/intro/php_tuning2.xml</slide> <slide>slides/intro/php_profiling.xml</slide> <slide>slides/intro/xdebug_profile.xml</slide> <slide>slides/intro/pecl_gen.xml</slide> <slide>slides/intro/repl1.xml</slide> <slide>slides/intro/repl3.xml</slide> </chapter> <slide>slides/intro/i18n_l10n_agenda.xml</slide> <chapter title="I18n and L10n"> <slide>slides/intro/php-template.xml</slide> <slide>slides/intro/php-template1.xml</slide> <slide>slides/intro/php-i18n.xml</slide> <slide>slides/intro/php-l10n.xml</slide> </chapter> <slide>slides/intro/php5_agenda.xml</slide> <chapter title="PHP5"> <slide>slides/intro/php5q2.xml</slide> <slide>slides/intro/ws1.xml</slide> <slide>slides/intro/ws2.xml</slide> <slide>slides/intro/ws3.xml</slide> <slide>slides/intro/sneak.xml</slide> </chapter> <!-- Security Concerns Input Filtering Solution? Performance Considerations - handling constants and server variables - prefer-non-pic - syscalls --> <!-- <chapter title="Performance"> <slide>slides/intro/php_tuning1.xml</slide> <slide>slides/intro/php_opcode_caches.xml</slide> <slide>slides/intro/php_opcode_caches-split.xml</slide> <slide>slides/intro/new_apc.xml</slide> <slide>slides/intro/php_opcode_caches3.xml</slide> <slide>slides/intro/tech_bench1.xml</slide> <slide>slides/intro/tech_bench1a.xml</slide> <slide>slides/intro/tech_bench2.xml</slide> <slide>slides/intro/new_bench3.xml</slide> <slide>slides/intro/php_profiling.xml</slide> <slide>slides/intro/new_apc.xml</slide> <slide>slides/intro/tech_benchapc1.xml</slide> <slide>slides/intro/tech_benchminit.xml</slide> <slide>slides/intro/tech_bench5.xml</slide> <slide>slides/intro/tech_bench6.xml</slide> <slide>slides/intro/tech_bench7.xml</slide> <slide>slides/intro/tech_bench8.xml</slide> <slide>slides/intro/tech_bench4.xml</slide> <slide>slides/intro/repl1.xml</slide> <slide>slides/intro/repl3.xml</slide> <slide>slides/intro/stop.xml</slide> </chapter> --> <slide>slides/intro/resources.xml</slide> </presentation> http://cvs.php.net/co.php/presentations/slides/intro/high_complexity_agenda.xml?r=1.1&p=1 Index: presentations/slides/intro/high_complexity_agenda.xml +++ presentations/slides/intro/high_complexity_agenda.xml <slide title="Agenda"> <break lines="5"/> <blurb fontsize="7em" align="center"> High Complexity Applications? </blurb> <break lines="5"/> <blurb fontsize="6em" align="center"> Only if you don't build them right </blurb> </slide> http://cvs.php.net/co.php/presentations/slides/intro/high_traffic_agenda.xml?r=1.1&p=1 Index: presentations/slides/intro/high_traffic_agenda.xml +++ presentations/slides/intro/high_traffic_agenda.xml <slide title="Agenda"> <break lines="5"/> <blurb fontsize="7em" align="center"> High Traffic Applications </blurb> <break lines="5"/> <blurb fontsize="6em" align="center"> Profile, Optimize and Scale it </blurb> </slide> http://cvs.php.net/co.php/presentations/slides/intro/large_teams_agenda.xml?r=1.1&p=1 Index: presentations/slides/intro/large_teams_agenda.xml +++ presentations/slides/intro/large_teams_agenda.xml <slide title="Agenda"> <break lines="5"/> <blurb fontsize="7em" align="center"> Large Development Teams </blurb> <break lines="5"/> <blurb fontsize="6em" align="center"> Make sure your infrastructure is solid before you start </blurb> </slide> http://cvs.php.net/co.php/presentations/slides/intro/max_dev.xml?r=1.1&p=1 Index: presentations/slides/intro/max_dev.xml +++ presentations/slides/intro/max_dev.xml <slide title="Maximize Dev Resources"> <break lines="5"/> <blurb fontsize="7em" align="center"> Be Lazy! </blurb> <break lines="5"/> <blurb fontsize="6em" align="center"> The greatest inefficiencies come from solving problems you will never have. </blurb> </slide> http://cvs.php.net/co.php/presentations/slides/intro/mtl_agenda.xml?r=1.1&p=1 Index: presentations/slides/intro/mtl_agenda.xml +++ presentations/slides/intro/mtl_agenda.xml <slide title="Large-Scale PHP"> <break lines="5" /> <blurb marginleft="150px" fontsize="6em"> Security </blurb> <blurb marginleft="150px" fontsize="6em"> Large developer teams </blurb> <!-- <list marginleft="3" fontsize="3em"> <bullet>Source Control</bullet> <bullet>Mailing Lists</bullet> <bullet>Bug tracking</bullet> <bullet>Regression testing</bullet> <bullet>Maximize development resources</bullet> </list> --> <blurb marginleft="150px" fontsize="6em"> High-complexity applications </blurb> <!-- <list marginleft="3" fontsize="3em"> <bullet>Separate Layout from business logic</bullet> <bullet>Clean modular internal APIs</bullet> </list> --> <blurb marginleft="150px" fontsize="6em"> High-traffic Applications </blurb> <!-- <list marginleft="3" fontsize="3em"> <bullet>Profile</bullet> <bullet>Optimize</bullet> <bullet>Scalable Architecture</bullet> </list> --> <blurb marginleft="150px" fontsize="6em"> I18n and L10n </blurb> <!-- <list marginleft="3" fontsize="3em"> <bullet>Runtime vs. Generation-time Templating</bullet> <bullet>Template Management</bullet> </list> --> </slide> http://cvs.php.net/co.php/presentations/slides/intro/pecl_gen.snippet?r=1.1&p=1 Index: presentations/slides/intro/pecl_gen.snippet +++ presentations/slides/intro/pecl_gen.snippet <?xml version="1.0"?> <extension name="my_ext"> <function name="foobar"> <proto>string foobar(void)</proto> <summary>A dummy function</summary> <description> This function returns a static string. </description> <code> RETURN_STRING("foobar", 1); </code> </function> </extension> http://cvs.php.net/co.php/presentations/slides/intro/pecl_gen.xml?r=1.1&p=1 Index: presentations/slides/intro/pecl_gen.xml +++ presentations/slides/intro/pecl_gen.xml <slide> <title>PECL_Gen</title> <blurb> PECL_Gen replaces ext_skel in PHP5 </blurb> <example fontsize="1.5em" format="xml"><![CDATA[<?xml version="1.0"?> <extension name="myext"> <summary>My Cool Extension</summary> <logo src="myext.png" mimetype="image/png" /> <maintainers> <maintainer> <user>rasmus</user> <name>Rasmus Lerdorf</name> <email>rasmus@php.net</email> <role>lead</role> </maintainer> </maintainers> <release> <version>0.1</version> <date>2005-04-01</date> <state>alpha</state> <license>php</license> <notes> - This is cool </notes> </release> <deps language="c" platform="unix"> <header name="math.h"/> <lib name="m" function="floor"/> </deps> <constant name="MYMODE" type="int" value="1" /> <global name="foo" type="long" value="42"/> <function role="internal" name="MINIT"> <code>init();</code> </function> <function name="get_foo"> <proto>int get_foo(void)</proto> <code> RETURN_LONG(MYEXT_G(foo)); </code> </function> <function name="foobar"> <proto>string foobar(void)</proto> <summary>A dummy function</summary> <description> This function returns a static string. </description> <code> RETURN_STRING("foobar", 1); </code> </function> </extension>]]></example> <example fontsize="1.5em" type="shell"><![CDATA[$ pecl-gen myext.xml Creating 'myext' extension in '/home/rasmus/myext' Your extension has been created in directory myext. See myext/README for further instructions. ]]></example> <blurb> This will create the following directory: </blurb> <example fontsize="1.5em" format="text"><![CDATA[myext |-- EXPERIMENTAL |-- README |-- config.m4 |-- manual | `--myext | |-- configure.xml | |-- functions | `-- reference.xml |-- package.xml |-- php_myext.h |-- tests |-- myext.c `-- myext.dsp]]></example> <example fontsize="1.5em" type="shell"><![CDATA[$ cd myext $ phpize $ ./configure $ make $ sudo make install]]></example> </slide> http://cvs.php.net/co.php/presentations/slides/intro/php-i18n.xml?r=1.1&p=1 Index: presentations/slides/intro/php-i18n.xml +++ presentations/slides/intro/php-i18n.xml <slide title="i18n"> <blurb fontsize="4em">PHP's strings are binary safe and mostly oblivious to character encodings and everything is fine if you just pass the data through. If you need to manipulate it you will need to do some work.</blurb> <list fontsize="4em"> <bullet>setlocale</bullet> <bullet>utf8_decode</bullet> <bullet>iconv</bullet> <bullet>mbstring</bullet> <bullet>preg_* functions support UTF-8</bullet> <bullet>pecl/translit</bullet> <bullet>Full ICU-based Unicode Support eventually</bullet> </list> <example title="php.ini">default_charset = "utf-8"</example> </slide> http://cvs.php.net/co.php/presentations/slides/intro/php-l10n.xml?r=1.1&p=1 Index: presentations/slides/intro/php-l10n.xml +++ presentations/slides/intro/php-l10n.xml <slide title="l10n"> <blurb fontsize="4em"> There isn't much localization support directly in PHP. A few things can help out. </blurb> <list fontsize="4em"> <bullet>Generated templates</bullet> <bullet>setlocale</bullet> <bullet>gettext</bullet> </list> </slide> http://cvs.php.net/co.php/presentations/slides/intro/phpt_dev.xml?r=1.1&p=1 Index: presentations/slides/intro/phpt_dev.xml +++ presentations/slides/intro/phpt_dev.xml <slide title="PHPT"> <blurb> PHPT is a simple test framework for PHP. </blurb> <example title="hello.phpt" fontsize="1.75em"><![CDATA[--TEST-- Hello World test --FILE-- <?php echo "Hello World"; ?> --EXPECT-- Hello World]]></example> <example title="filter.phpt" fontsize="1.75em"><![CDATA[--TEST-- Input Filter test --SKIPIF-- if(!extension_loaded('input_filter')) print "skip"; --POST-- a=<b>1</b> --GET-- b=<i>2</i> --FILE-- <?php echo $_POST['a']; echo $_GET['b']; ?> --EXPECT-- 12]]></example> <example fontsize="1.75em" type="shell" title="phpt output"><![CDATA[TIME START 2003-10-15 10:19:50 ==================================== PASS Hello World test [hello.phpt] PASS Input Filter test [filter.phpt] ==================================== TIME END 2003-10-15 10:19:50 ==================================== TEST RESULT SUMMARY ------------------------------------ Number of tests : 2 Tests skipped : 0 ( 0.0%) Tests warned : 0 ( 0.0%) Tests failed : 0 ( 0.0%) Tests passed : 2 (100.0%) ------------------------------------ Time taken : 0 seconds ====================================]]></example> <example fontsize="1.75em" type="shell" title="phpt failed test output"><![CDATA[TIME START 2003-10-15 10:32:48 ==================================== PASS Hello World test [hello.phpt] FAIL Input Filter test [filter.phpt] ==================================== TIME END 2003-10-15 10:32:48 ==================================== TEST RESULT SUMMARY ------------------------------------ Number of tests : 2 Tests skipped : 0 ( 0.0%) Tests warned : 0 ( 0.0%) Tests failed : 1 (50.0%) Tests passed : 1 (50.0%) ------------------------------------ Time taken : 0 seconds ==================================== ==================================== FAILED TEST SUMMARY ------------------------------------ YIV test [filter.phpt] ==================================== Some tests failed and a complete report has been saved to /tmp/php_test_results_20031015.txt]]></example> <example fontsize="1.75em" type="shell" title="failed test detailed output"><![CDATA[==================================================== /home/rasmus/t/filter.phpt ==================================================== --TEST-- YIV test --SKIPIF-- if(!extension_loaded('input_filter')) print "skip"; --POST-- a=<b>1</b> --GET-- b=<i>2</i> --FILE-- <?php echo $_POST['a']; echo $_GET['b']; ?> --EXPECT-- 1 2 ==================================================== ---- EXPECTED OUTPUT 1 2 ---- ACTUAL OUTPUT 12 ---- FAILED]]></example> <table columns="2" title="PHPT Sections"> <cell>--TEST--</cell><cell>title of the test</cell> <cell>--SKIPIF--</cell><cell>php code which prints "skip"</cell> <cell>--POST--</cell><cell>POST variables passed to test script</cell> <cell>--GET--</cell><cell>GET variables passed to test script</cell> <cell>--INI--</cell><cell>each line contains an ini setting e.g. foo=bar</cell> <cell>--FILE--</cell><cell>the test script</cell> <cell>--EXPECT--</cell><cell>the expected output from the test script</cell> <cell>--EXPECTF--</cell><cell>sscanf version of expected output</cell> <cell>--EXPECTREGEX--</cell><cell>regex version of expected output</cell> </table> </slide> http://cvs.php.net/co.php/presentations/slides/intro/security_agenda.xml?r=1.1&p=1 Index: presentations/slides/intro/security_agenda.xml +++ presentations/slides/intro/security_agenda.xml <slide title="Agenda"> <image filename="dewie4.gif" align="left" marginleft="50"/> <image filename="dewie6.gif" align="right" marginright="50"/> <break lines="3"/> <blurb fontsize="7em" align="center"> Security </blurb> <break lines="4"/> <blurb fontsize="6em" align="center"> Meet Dewie the turtle! </blurb> <image filename="dewie7.gif" align="left" marginleft="50"/> <image filename="dewie8.gif" align="right" marginright="50"/> <image filename="dewie3.gif" align="center"/> <break lines="3"/> <blurb fontsize="4em" align="center"> Brought to us by our friends at the FTC http://www.ftc.gov/infosecurity/ </blurb> </slide> http://cvs.php.net/co.php/presentations/slides/intro/sneak.xml?r=1.1&p=1 Index: presentations/slides/intro/sneak.xml +++ presentations/slides/intro/sneak.xml <slide title="REST services from Yahoo!"> <list> <bullet>Web Search</bullet> <bullet>Web Search with Context</bullet> <bullet>Creative Commons Web Search</bullet> <bullet>News Search</bullet> <bullet>Image Search</bullet> <bullet>Local Search</bullet> <bullet>Video Search</bullet> </list> <blurb> And a new one that isn't public yet. </blurb> <list> <bullet>Context Extraction Service</bullet> </list> <example type="shell" fontsize="1.3em"> _Parameter Value Description _ appid string (required) The application ID. See Application IDs for more information. context string (required) The context to extract terms from (UTF-8 encoded). query string An optional query to help with the extraction process.</example> <example title="Example" fontsize="1.4em" result="1"><![CDATA[<?php $context = "Italian sculptors and painters of the renaissance favored the Virgin Mary for inspiration."; $url = 'http://api.search.yahoo.com/ContentAnalysisService/V1/termExtraction'; $post = "query=madonna&appid=RESTDemo&context=".rawurlencode($context); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $post); $xml = simplexml_load_string(curl_exec($ch)); curl_close($ch); echo $xml->asXML(); ?>]]></example> <blurb> </blurb> </slide> http://cvs.php.net/co.php/presentations/slides/intro/tools_dev.xml?r=1.1&p=1 Index: presentations/slides/intro/tools_dev.xml +++ presentations/slides/intro/tools_dev.xml <slide title="Development Tools"> <break lines="5"/> <list fontsize="5em"> <bullet>Revision control - CVS, SVN, Perforce, Bitkeeper</bullet> <bullet>Mailing Lists</bullet> <bullet>Twikis, Personal Pages</bullet> <bullet>Bug tracking - Bugzilla</bullet> <bullet>Regression Testing - phpt, phpunit</bullet> </list> </slide> http://cvs.php.net/co.php/presentations/slides/intro/ws1.xml?r=1.1&p=1 Index: presentations/slides/intro/ws1.xml +++ presentations/slides/intro/ws1.xml <slide title="Web Services"> <blurb> With PHP5's solid XML support and improved internal OOP support, Web Services are now a natural fit for PHP. Most people seem to think of SOAP when we say Web Services, so here is the obligatory SOAP example: </blurb> <example fontsize="1.4em"><![CDATA[<?php $amazon_index = array( 'DVD', 'Photo', 'Electronics', 'OfficeProducts', 'HealthPersonalCare', 'Toys', 'Baby', 'VideoGames', 'MusicTracks', 'OutdoorLiving', 'Blended', 'MusicalInstruments', 'Magazines', 'DigitalMusic', 'Jewelry', 'Video', 'Tools', 'PCHardware', 'SportingGoods', 'Classical', 'Software', 'Books', 'VHS', 'Wireless', 'Restaurants', 'Music', 'GourmetFood', 'Miscellaneous', 'Kitchen', 'WirelessAccessories', 'Merchants', 'Beauty', 'Apparel' ); function amazon($index, $keywords, $timeout=7200) { $dest_file = "/tmp/aws_{$index}_".md5($keywords); if(file_exists($dest_file) && filemtime($dest_file) > (time()-$timeout)) { $result = unserialize(file_get_contents($dest_file)); } else { $aws = new SoapClient('http://webservices.amazon.com/'. 'AWSECommerceService/US/AWSECommerceService.wsdl', array("trace" => 1)); $result = $aws->ItemSearch(array( 'SubscriptionId'=>'XXXXXXXXXXXXXX', 'AssociateTag'=>'lerdorf-20', 'Request'=>array(array('SearchIndex'=>$index, 'Keywords'=>$keywords)) ) ); $tmpf = tempnam('/tmp','YWS'); file_put_contents($tmpf, serialize($result)); rename($tmpf, $dest_file); } return $result; } ?>]]></example> </slide> http://cvs.php.net/co.php/presentations/slides/intro/ws2.xml?r=1.1&p=1 Index: presentations/slides/intro/ws2.xml +++ presentations/slides/intro/ws2.xml <slide title="SOAP Server"> <example fontsize="1.5em"><![CDATA[<?php function Add($x,$y) { return $x+$y; } $server = new SoapServer(null,array('uri'=>"http://test-uri/")); $server->addFunction("Add"); $server->handle(); ?>]]></example> <blurb>Or using a WSDL:</blurb> <example fontsize="1.5em"><![CDATA[<?php function Add($x,$y) { return $x+$y; } $server = new SoapServer("./add.wsdl")); $server->addFunction("Add"); $server->handle(); ?>]]></example> <example fontsize="1.2em" title="add.wsdl"><![CDATA[<?xml version="1.0" ?> <definitions xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:si="http://soapinterop.org/xsd" xmlns:tns="http://localhost/~rasmus/pecl/soap/test.wsdl" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://localhost/~rasmus/pecl/soap/test.wsdl"> <types> <xsd:schema targetNamespace="http://localhost/~rasmus/pecl/soap/test.wsdl"> <xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/" /> <xsd:import namespace="http://schemas.xmlsoap.org/wsdl/" /> </xsd:schema> </types> <message name="AddRequest"> <part name="x" type="xsd:double" /> <part name="y" type="xsd:double" /> </message> <message name="AddResponse"> <part name="result" type="xsd:double" /> </message> <portType name="TestServicePortType"> <operation name="Add"> <input message="tns:AddRequest" /> <output message="tns:AddResponse" /> </operation> </portType> <binding name="TestServiceBinding" type="tns:TestServicePortType"> <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" /> <operation name="Add"> <soap:operation soapAction="Add" style="rpc" /> <input> <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </input> <output> <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </output> </operation> </binding> <service name="TestService"> <port name="TestServicePort" binding="tns:TestServiceBinding"> <soap:address location="http://localhost/~rasmus/pecl/soap/soap_server.php"/> </port> </service> </definitions>]]></example> </slide> http://cvs.php.net/co.php/presentations/slides/intro/ws3.xml?r=1.1&p=1 Index: presentations/slides/intro/ws3.xml +++ presentations/slides/intro/ws3.xml <slide title="No more SOAP!"> <blurb> SOAP makes my head hurt. Let's look at some stuff we can all actually understand instead. </blurb> <example title="Take a pinch of RSS" result="1" rfontsize="1.2em"><![CDATA[<?php $url = 'http://buzz.yahoo.com/feeds/buzzoverl.xml'; $xml = simplexml_load_file($url); foreach($xml->channel->item as $item) { $ret[(string)$item->title] = (string)$item->link; } echo "<pre>"; print_r($ret); echo "</pre>"; ?>]]></example> <example fontsize="1.6em" title="Add a spoonful of REST"><![CDATA[<?php $srv = 'http://api.search.yahoo.com/ImageSearchService/V1/imageSearch'; foreach($ret as $key=>$link) { $url = $srv . "?query=$key&appid=RESTDemo"; $obj = simplexml_load_file($url); } ?>]]></example> <example type="shell" title="A thimble of gradeschool math">x^2/a^2 + y^2/b^2 = 1</example> <blurb>And we end up with something like this</blurb> <link align="center" fontsize="5em" href="http://buzz.progphp.com/">http://buzz.progphp.com</link> <blurb>By the way, throwing a cache layer between you and whatever remote service you are accessing tends to be a good idea. In our case we can do it like this:</blurb> <example fontsize="1.6em"><![CDATA[<?php $tmp = '/tmp/'.md5($q); if(!file_exists($tmp) || filemtime($tmp) < (time()-7200)) { $stream = fopen($url,'r'); $tmpf = tempnam('/tmp','YWS'); file_put_contents($tmpf, $stream); fclose($stream); rename($tmpf, $tmp); } $obj = simplexml_load_file(file_get_contents($tmp)); ?>]]></example> </slide>
http://cvs.php.net/diff.php/presentations/slides/intro/design.xml?r1=1.2&r2=1.3&ty=u Index: presentations/slides/intro/design.xml diff -u presentations/slides/intro/design.xml:1.2 presentations/slides/intro/design.xml:1.3 --- presentations/slides/intro/design.xml:1.2 Wed Sep 22 15:15:35 2004 +++ presentations/slides/intro/design.xml Tue Apr 12 17:39:05 2005 @@ -1,5 +1,5 @@ <slide title="Design"> -<break lines="2" /> +<break lines="1" /> <list title="Outside-in and Inside-out view" fontsize="4em"> <bullet> What do outsiders (users) see looking in?</bullet> <bullet> What do insiders (developers) see looking out?</bullet> @@ -13,7 +13,7 @@ <list title="Inside-out" fontsize="4em"> <bullet>File Layout</bullet> <bullet>Separation of layout from business logic</bullet> +<bullet>Application API</bullet> <bullet>Server Architecture and Load Balancing</bullet> </list> - </slide> http://cvs.php.net/diff.php/presentations/slides/intro/dumb.xml?r1=1.1&r2=1.2&ty=u Index: presentations/slides/intro/dumb.xml diff -u presentations/slides/intro/dumb.xml:1.1 presentations/slides/intro/dumb.xml:1.2 --- presentations/slides/intro/dumb.xml:1.1 Fri Jan 14 11:12:14 2005 +++ presentations/slides/intro/dumb.xml Tue Apr 12 17:39:05 2005 @@ -1,19 +1,20 @@ <slide title="Direct Attacks"> +<image filename="dewie5.gif" align="right" marginright="10"/> <blurb title="Dumb things" /> <blurb> Don't do dumb things! </blurb> -<example><![CDATA[<?php +<example marginright="25"><![CDATA[<?php system($user_data); ?>]]></example> -<example><![CDATA[<?php +<example marginright="25"><![CDATA[<?php include "$path/$user_data"; ?>]]></example> -<example><![CDATA[<?php +<example marginright="25"><![CDATA[<?php eval($user_data); ?>]]></example> http://cvs.php.net/diff.php/presentations/slides/intro/input_filter2.xml?r1=1.1&r2=1.2&ty=u Index: presentations/slides/intro/input_filter2.xml diff -u presentations/slides/intro/input_filter2.xml:1.1 presentations/slides/intro/input_filter2.xml:1.2 --- presentations/slides/intro/input_filter2.xml:1.1 Fri Jan 14 11:12:14 2005 +++ presentations/slides/intro/input_filter2.xml Tue Apr 12 17:39:05 2005 @@ -11,12 +11,12 @@ <break lines="6" /> <example title="API?"><![CDATA[<?php - $name = pfilt(POST, 'name'); /* Default filter */ - $age = pfilt(POST, 'age', PFILT_INTEGER); - $addr = pfilt(POST, 'addr', PFILT_TEXT, 'UTF-8'); + $name = filter(POST, 'name'); /* Default filter */ + $age = filter(POST, 'age', PFILT_INTEGER); + $addr = filter(POST, 'addr', PFILT_TEXT, 'UTF-8'); ?>]]></example> -<example title="Config"><![CDATA[input_filter.default = PFILT_TEXT +<example title="Config"><![CDATA[input_filter.default = FILTER_TEXT ]]></example> <example title="Strip or Escape?"><![CDATA[abc;123{def} http://cvs.php.net/diff.php/presentations/slides/intro/large.xml?r1=1.2&r2=1.3&ty=u Index: presentations/slides/intro/large.xml diff -u presentations/slides/intro/large.xml:1.2 presentations/slides/intro/large.xml:1.3 --- presentations/slides/intro/large.xml:1.2 Wed Sep 22 15:15:35 2004 +++ presentations/slides/intro/large.xml Tue Apr 12 17:39:05 2005 @@ -12,6 +12,6 @@ <blurb>Merger of 24 Web Companies</blurb> <image filename="24.png" align="center" /> -<blurb>Make that 26 now with FareChase and MusicMatch</blurb> +<blurb>Make that 27 now with FareChase, MusicMatch and Flickr</blurb> </slide> http://cvs.php.net/diff.php/presentations/slides/intro/php_tuning2.xml?r1=1.2&r2=1.3&ty=u Index: presentations/slides/intro/php_tuning2.xml diff -u presentations/slides/intro/php_tuning2.xml:1.2 presentations/slides/intro/php_tuning2.xml:1.3 --- presentations/slides/intro/php_tuning2.xml:1.2 Tue Jan 20 13:37:15 2004 +++ presentations/slides/intro/php_tuning2.xml Tue Apr 12 17:39:05 2005 @@ -1,5 +1,10 @@ <slide title="Tuning"> +<example title="./configure" type="shell"> +./configure --with-apxs=/usr/sbin/apxs --without-pic \ + --with-config-file-scan-dir=/etc/php +</example> + <example title="include_path" type="shell"> include_path = "/usr/share/pear:." </example> @@ -14,7 +19,7 @@ </example> <blurb>open_basedir checking adds some extra syscalls to every file operation. It can be useful, -but it is rather expensive, so turn it off if you don't think you need it.</blurb> +but it is rather expensive, so turn it off if you don't you need it.</blurb> <example title="variables_order" type="shell"> variables_order = "GPC" http://cvs.php.net/diff.php/presentations/slides/intro/pi.xml?r1=1.1&r2=1.2&ty=u Index: presentations/slides/intro/pi.xml diff -u presentations/slides/intro/pi.xml:1.1 presentations/slides/intro/pi.xml:1.2 --- presentations/slides/intro/pi.xml:1.1 Tue Jul 2 01:24:59 2002 +++ presentations/slides/intro/pi.xml Tue Apr 12 17:39:05 2005 @@ -3,7 +3,7 @@ $PATH_INFO is your friend when it comes to creating clean URLS. Take for example this URL: </blurb> -<example>http://www.company.com/products/routers</example> +<example format="text">http://www.company.com/products/routers</example> <blurb> If the Apache configuration contains this block: </blurb> http://cvs.php.net/diff.php/presentations/slides/intro/repl1.xml?r1=1.4&r2=1.5&ty=u Index: presentations/slides/intro/repl1.xml diff -u presentations/slides/intro/repl1.xml:1.4 presentations/slides/intro/repl1.xml:1.5 --- presentations/slides/intro/repl1.xml:1.4 Sat Nov 2 13:45:18 2002 +++ presentations/slides/intro/repl1.xml Tue Apr 12 17:39:05 2005 @@ -1,6 +1,6 @@ <slide title="MySQL Replication"> <blurb> -As of version 3.23.15 (try to use 3.23.29 or later), MySQL supports one-way replication. +MySQL supports one-way replication. Since most web applications usually have more reads than writes, an architecture which distributes reads across multiple servers can be very beneficial. </blurb> @@ -15,12 +15,8 @@ <blurb> And add a replication user id for slaves to log in as: </blurb> -<example type="shell"><![CDATA[GRANT FILE ON *.* TO repl@"%" IDENTIFIED BY 'foobar';]]></example> +<example type="shell" fontsize="1.7em"><![CDATA[GRANT REPLICATION SLAVE ON *.* TO repl@"%" IDENTIFIED BY 'foobar';]]></example> -<blurb> -If you are using MySQL 4.0.2 or later, replace %FILE% with %REPLICATION SLAVE% in the above. -Then on your slave servers: -</blurb> <example type="shell">[mysqld] set-variable = max_connections=200 log-bin http://cvs.php.net/diff.php/presentations/slides/intro/urlapi.xml?r1=1.1&r2=1.2&ty=u Index: presentations/slides/intro/urlapi.xml diff -u presentations/slides/intro/urlapi.xml:1.1 presentations/slides/intro/urlapi.xml:1.2 --- presentations/slides/intro/urlapi.xml:1.1 Thu Jan 22 17:05:21 2004 +++ presentations/slides/intro/urlapi.xml Tue Apr 12 17:39:05 2005 @@ -1,6 +1,6 @@ <slide title="URL API"> <break lines="1" /> -<example fontsize="3em"><![CDATA[http://www.example.com/a/b?c=1&d=2]]></example> +<example fontsize="3em" format="text"><![CDATA[http://www.example.com/a/b?c=1&d=2]]></example> <blurb fontsize="4em">|ff0000|/a/b| is what we are looking for</blurb> <blurb fontsize="4em">|ff0000|?c=1&d=2| are optional modifiers</blurb> </slide> http://cvs.php.net/diff.php/presentations/slides/intro/worries.xml?r1=1.1&r2=1.2&ty=u Index: presentations/slides/intro/worries.xml diff -u presentations/slides/intro/worries.xml:1.1 presentations/slides/intro/worries.xml:1.2 --- presentations/slides/intro/worries.xml:1.1 Fri Jan 14 11:12:15 2005 +++ presentations/slides/intro/worries.xml Tue Apr 12 17:39:05 2005 @@ -1,12 +1,12 @@ <slide title="Worries"> +<image filename="dewie9.gif" align="left" marginleft="10" /> <break lines="2" /> - -<blurb align="center" fontsize="8em">Indirect Attacks</blurb> +<blurb align="left" fontsize="8em">Indirect Attacks</blurb> <blurb marginleft="5em" fontsize="5em">* XSS - Cross-site scripting attacks</blurb> <blurb marginleft="5em" fontsize="5em">* Spoofing</blurb> -<blurb align="center" fontsize="8em">Direct Attacks</blurb> +<blurb marginleft="2.8em" fontsize="8em">Direct Attacks</blurb> <blurb marginleft="5em" fontsize="5em">* Buffer Overflows</blurb> <blurb marginleft="5em" fontsize="5em">* Path tricks</blurb> <blurb marginleft="5em" fontsize="5em">* Application logic attacks</blurb> http://cvs.php.net/co.php/presentations/mtladv05.xml?r=1.1&p=1 Index: presentations/mtladv05.xml +++ presentations/mtladv05.xml <presentation template="php2" navmode="html" titlecolor="#1111aa" navbarbackground="url(images/trans-ffffff.png)" logo1="images/php-med-trans-light.gif" titlesize="2em" navbarheight="4.1em" > <!-- 90 Minutes --> <topic>PHP</topic> <title>Advanced PHP</title> <event>PHP Québec</event> <location>Montréal</location> <date>March 31, 2005</date> <speaker>Rasmus Lerdorf</speaker> <email>rasmus@php.net</email> <url>http://talks.php.net/mtladv05</url> <slide>slides/intro/titlepage.xml</slide> <slide>slides/intro/mtl_agenda.xml</slide> <slide>slides/intro/security_agenda.xml</slide> <chapter title="Security"> <slide>slides/intro/worries.xml</slide> <slide>slides/intro/overflows.xml</slide> <slide>slides/intro/dumb.xml</slide> <slide>slides/intro/input_filter.xml</slide> <slide>slides/intro/input_filter2.xml</slide> </chapter> <slide>slides/intro/large_teams_agenda.xml</slide> <chapter title="Large developer teams"> <slide>slides/intro/large.xml</slide> <slide>slides/intro/tools_dev.xml</slide> <slide>slides/intro/phpt_dev.xml</slide> </chapter> <slide>slides/intro/high_complexity_agenda.xml</slide> <chapter title="High-complexity applications"> <slide>slides/intro/max_dev.xml</slide> <slide>slides/intro/design.xml</slide> <slide>slides/intro/urlapi.xml</slide> <slide>slides/intro/pi.xml</slide> <slide>slides/intro/errdoc.xml</slide> <slide>slides/intro/file_layout.xml</slide> <slide>slides/intro/app_arch.xml</slide> <slide>slides/intro/poll1.xml</slide> <slide>slides/intro/poll2.xml</slide> <slide>slides/intro/poll3.xml</slide> </chapter> <slide>slides/intro/high_traffic_agenda.xml</slide> <chapter title="High-traffic Applications"> <slide>slides/intro/php_tuning1.xml</slide> <slide>slides/intro/php_tuning2.xml</slide> <slide>slides/intro/php_profiling.xml</slide> <slide>slides/intro/xdebug_profile.xml</slide> <slide>slides/intro/pecl_gen.xml</slide> <slide>slides/intro/repl1.xml</slide> <slide>slides/intro/repl3.xml</slide> </chapter> <slide>slides/intro/i18n_l10n_agenda.xml</slide> <chapter title="I18n and L10n"> <slide>slides/intro/php-template.xml</slide> <slide>slides/intro/php-template1.xml</slide> <slide>slides/intro/php-i18n.xml</slide> <slide>slides/intro/php-l10n.xml</slide> </chapter> <slide>slides/intro/php5_agenda.xml</slide> <chapter title="PHP5"> <slide>slides/intro/php5q2.xml</slide> <slide>slides/intro/ws1.xml</slide> <slide>slides/intro/ws2.xml</slide> <slide>slides/intro/ws3.xml</slide> <slide>slides/intro/sneak.xml</slide> </chapter> <!-- Security Concerns Input Filtering Solution? Performance Considerations - handling constants and server variables - prefer-non-pic - syscalls --> <!-- <chapter title="Performance"> <slide>slides/intro/php_tuning1.xml</slide> <slide>slides/intro/php_opcode_caches.xml</slide> <slide>slides/intro/php_opcode_caches-split.xml</slide> <slide>slides/intro/new_apc.xml</slide> <slide>slides/intro/php_opcode_caches3.xml</slide> <slide>slides/intro/tech_bench1.xml</slide> <slide>slides/intro/tech_bench1a.xml</slide> <slide>slides/intro/tech_bench2.xml</slide> <slide>slides/intro/new_bench3.xml</slide> <slide>slides/intro/php_profiling.xml</slide> <slide>slides/intro/new_apc.xml</slide> <slide>slides/intro/tech_benchapc1.xml</slide> <slide>slides/intro/tech_benchminit.xml</slide> <slide>slides/intro/tech_bench5.xml</slide> <slide>slides/intro/tech_bench6.xml</slide> <slide>slides/intro/tech_bench7.xml</slide> <slide>slides/intro/tech_bench8.xml</slide> <slide>slides/intro/tech_bench4.xml</slide> <slide>slides/intro/repl1.xml</slide> <slide>slides/intro/repl3.xml</slide> <slide>slides/intro/stop.xml</slide> </chapter> --> <slide>slides/intro/resources.xml</slide> </presentation> http://cvs.php.net/co.php/presentations/slides/intro/high_complexity_agenda.xml?r=1.1&p=1 Index: presentations/slides/intro/high_complexity_agenda.xml +++ presentations/slides/intro/high_complexity_agenda.xml <slide title="Agenda"> <break lines="5"/> <blurb fontsize="7em" align="center"> High Complexity Applications? </blurb> <break lines="5"/> <blurb fontsize="6em" align="center"> Only if you don't build them right </blurb> </slide> http://cvs.php.net/co.php/presentations/slides/intro/high_traffic_agenda.xml?r=1.1&p=1 Index: presentations/slides/intro/high_traffic_agenda.xml +++ presentations/slides/intro/high_traffic_agenda.xml <slide title="Agenda"> <break lines="5"/> <blurb fontsize="7em" align="center"> High Traffic Applications </blurb> <break lines="5"/> <blurb fontsize="6em" align="center"> Profile, Optimize and Scale it </blurb> </slide> http://cvs.php.net/co.php/presentations/slides/intro/large_teams_agenda.xml?r=1.1&p=1 Index: presentations/slides/intro/large_teams_agenda.xml +++ presentations/slides/intro/large_teams_agenda.xml <slide title="Agenda"> <break lines="5"/> <blurb fontsize="7em" align="center"> Large Development Teams </blurb> <break lines="5"/> <blurb fontsize="6em" align="center"> Make sure your infrastructure is solid before you start </blurb> </slide> http://cvs.php.net/co.php/presentations/slides/intro/max_dev.xml?r=1.1&p=1 Index: presentations/slides/intro/max_dev.xml +++ presentations/slides/intro/max_dev.xml <slide title="Maximize Dev Resources"> <break lines="5"/> <blurb fontsize="7em" align="center"> Be Lazy! </blurb> <break lines="5"/> <blurb fontsize="6em" align="center"> The greatest inefficiencies come from solving problems you will never have. </blurb> </slide> http://cvs.php.net/co.php/presentations/slides/intro/mtl_agenda.xml?r=1.1&p=1 Index: presentations/slides/intro/mtl_agenda.xml +++ presentations/slides/intro/mtl_agenda.xml <slide title="Large-Scale PHP"> <break lines="5" /> <blurb marginleft="150px" fontsize="6em"> Security </blurb> <blurb marginleft="150px" fontsize="6em"> Large developer teams </blurb> <!-- <list marginleft="3" fontsize="3em"> <bullet>Source Control</bullet> <bullet>Mailing Lists</bullet> <bullet>Bug tracking</bullet> <bullet>Regression testing</bullet> <bullet>Maximize development resources</bullet> </list> --> <blurb marginleft="150px" fontsize="6em"> High-complexity applications </blurb> <!-- <list marginleft="3" fontsize="3em"> <bullet>Separate Layout from business logic</bullet> <bullet>Clean modular internal APIs</bullet> </list> --> <blurb marginleft="150px" fontsize="6em"> High-traffic Applications </blurb> <!-- <list marginleft="3" fontsize="3em"> <bullet>Profile</bullet> <bullet>Optimize</bullet> <bullet>Scalable Architecture</bullet> </list> --> <blurb marginleft="150px" fontsize="6em"> I18n and L10n </blurb> <!-- <list marginleft="3" fontsize="3em"> <bullet>Runtime vs. Generation-time Templating</bullet> <bullet>Template Management</bullet> </list> --> </slide> http://cvs.php.net/co.php/presentations/slides/intro/pecl_gen.snippet?r=1.1&p=1 Index: presentations/slides/intro/pecl_gen.snippet +++ presentations/slides/intro/pecl_gen.snippet <?xml version="1.0"?> <extension name="my_ext"> <function name="foobar"> <proto>string foobar(void)</proto> <summary>A dummy function</summary> <description> This function returns a static string. </description> <code> RETURN_STRING("foobar", 1); </code> </function> </extension> http://cvs.php.net/co.php/presentations/slides/intro/pecl_gen.xml?r=1.1&p=1 Index: presentations/slides/intro/pecl_gen.xml +++ presentations/slides/intro/pecl_gen.xml <slide> <title>PECL_Gen</title> <blurb> PECL_Gen replaces ext_skel in PHP5 </blurb> <example fontsize="1.5em" format="xml"><![CDATA[<?xml version="1.0"?> <extension name="myext"> <summary>My Cool Extension</summary> <logo src="myext.png" mimetype="image/png" /> <maintainers> <maintainer> <user>rasmus</user> <name>Rasmus Lerdorf</name> <email>rasmus@php.net</email> <role>lead</role> </maintainer> </maintainers> <release> <version>0.1</version> <date>2005-04-01</date> <state>alpha</state> <license>php</license> <notes> - This is cool </notes> </release> <deps language="c" platform="unix"> <header name="math.h"/> <lib name="m" function="floor"/> </deps> <constant name="MYMODE" type="int" value="1" /> <global name="foo" type="long" value="42"/> <function role="internal" name="MINIT"> <code>init();</code> </function> <function name="get_foo"> <proto>int get_foo(void)</proto> <code> RETURN_LONG(MYEXT_G(foo)); </code> </function> <function name="foobar"> <proto>string foobar(void)</proto> <summary>A dummy function</summary> <description> This function returns a static string. </description> <code> RETURN_STRING("foobar", 1); </code> </function> </extension>]]></example> <example fontsize="1.5em" type="shell"><![CDATA[$ pecl-gen myext.xml Creating 'myext' extension in '/home/rasmus/myext' Your extension has been created in directory myext. See myext/README for further instructions. ]]></example> <blurb> This will create the following directory: </blurb> <example fontsize="1.5em" format="text"><![CDATA[myext |-- EXPERIMENTAL |-- README |-- config.m4 |-- manual | `--myext | |-- configure.xml | |-- functions | `-- reference.xml |-- package.xml |-- php_myext.h |-- tests |-- myext.c `-- myext.dsp]]></example> <example fontsize="1.5em" type="shell"><![CDATA[$ cd myext $ phpize $ ./configure $ make $ sudo make install]]></example> </slide> http://cvs.php.net/co.php/presentations/slides/intro/php-i18n.xml?r=1.1&p=1 Index: presentations/slides/intro/php-i18n.xml +++ presentations/slides/intro/php-i18n.xml <slide title="i18n"> <blurb fontsize="4em">PHP's strings are binary safe and mostly oblivious to character encodings and everything is fine if you just pass the data through. If you need to manipulate it you will need to do some work.</blurb> <list fontsize="4em"> <bullet>setlocale</bullet> <bullet>utf8_decode</bullet> <bullet>iconv</bullet> <bullet>mbstring</bullet> <bullet>preg_* functions support UTF-8</bullet> <bullet>pecl/translit</bullet> <bullet>Full ICU-based Unicode Support eventually</bullet> </list> <example title="php.ini">default_charset = "utf-8"</example> </slide> http://cvs.php.net/co.php/presentations/slides/intro/php-l10n.xml?r=1.1&p=1 Index: presentations/slides/intro/php-l10n.xml +++ presentations/slides/intro/php-l10n.xml <slide title="l10n"> <blurb fontsize="4em"> There isn't much localization support directly in PHP. A few things can help out. </blurb> <list fontsize="4em"> <bullet>Generated templates</bullet> <bullet>setlocale</bullet> <bullet>gettext</bullet> </list> </slide> http://cvs.php.net/co.php/presentations/slides/intro/phpt_dev.xml?r=1.1&p=1 Index: presentations/slides/intro/phpt_dev.xml +++ presentations/slides/intro/phpt_dev.xml <slide title="PHPT"> <blurb> PHPT is a simple test framework for PHP. </blurb> <example title="hello.phpt" fontsize="1.75em"><![CDATA[--TEST-- Hello World test --FILE-- <?php echo "Hello World"; ?> --EXPECT-- Hello World]]></example> <example title="filter.phpt" fontsize="1.75em"><![CDATA[--TEST-- Input Filter test --SKIPIF-- if(!extension_loaded('input_filter')) print "skip"; --POST-- a=<b>1</b> --GET-- b=<i>2</i> --FILE-- <?php echo $_POST['a']; echo $_GET['b']; ?> --EXPECT-- 12]]></example> <example fontsize="1.75em" type="shell" title="phpt output"><![CDATA[TIME START 2003-10-15 10:19:50 ==================================== PASS Hello World test [hello.phpt] PASS Input Filter test [filter.phpt] ==================================== TIME END 2003-10-15 10:19:50 ==================================== TEST RESULT SUMMARY ------------------------------------ Number of tests : 2 Tests skipped : 0 ( 0.0%) Tests warned : 0 ( 0.0%) Tests failed : 0 ( 0.0%) Tests passed : 2 (100.0%) ------------------------------------ Time taken : 0 seconds ====================================]]></example> <example fontsize="1.75em" type="shell" title="phpt failed test output"><![CDATA[TIME START 2003-10-15 10:32:48 ==================================== PASS Hello World test [hello.phpt] FAIL Input Filter test [filter.phpt] ==================================== TIME END 2003-10-15 10:32:48 ==================================== TEST RESULT SUMMARY ------------------------------------ Number of tests : 2 Tests skipped : 0 ( 0.0%) Tests warned : 0 ( 0.0%) Tests failed : 1 (50.0%) Tests passed : 1 (50.0%) ------------------------------------ Time taken : 0 seconds ==================================== ==================================== FAILED TEST SUMMARY ------------------------------------ YIV test [filter.phpt] ==================================== Some tests failed and a complete report has been saved to /tmp/php_test_results_20031015.txt]]></example> <example fontsize="1.75em" type="shell" title="failed test detailed output"><![CDATA[==================================================== /home/rasmus/t/filter.phpt ==================================================== --TEST-- YIV test --SKIPIF-- if(!extension_loaded('input_filter')) print "skip"; --POST-- a=<b>1</b> --GET-- b=<i>2</i> --FILE-- <?php echo $_POST['a']; echo $_GET['b']; ?> --EXPECT-- 1 2 ==================================================== ---- EXPECTED OUTPUT 1 2 ---- ACTUAL OUTPUT 12 ---- FAILED]]></example> <table columns="2" title="PHPT Sections"> <cell>--TEST--</cell><cell>title of the test</cell> <cell>--SKIPIF--</cell><cell>php code which prints "skip"</cell> <cell>--POST--</cell><cell>POST variables passed to test script</cell> <cell>--GET--</cell><cell>GET variables passed to test script</cell> <cell>--INI--</cell><cell>each line contains an ini setting e.g. foo=bar</cell> <cell>--FILE--</cell><cell>the test script</cell> <cell>--EXPECT--</cell><cell>the expected output from the test script</cell> <cell>--EXPECTF--</cell><cell>sscanf version of expected output</cell> <cell>--EXPECTREGEX--</cell><cell>regex version of expected output</cell> </table> </slide> http://cvs.php.net/co.php/presentations/slides/intro/security_agenda.xml?r=1.1&p=1 Index: presentations/slides/intro/security_agenda.xml +++ presentations/slides/intro/security_agenda.xml <slide title="Agenda"> <image filename="dewie4.gif" align="left" marginleft="50"/> <image filename="dewie6.gif" align="right" marginright="50"/> <break lines="3"/> <blurb fontsize="7em" align="center"> Security </blurb> <break lines="4"/> <blurb fontsize="6em" align="center"> Meet Dewie the turtle! </blurb> <image filename="dewie7.gif" align="left" marginleft="50"/> <image filename="dewie8.gif" align="right" marginright="50"/> <image filename="dewie3.gif" align="center"/> <break lines="3"/> <blurb fontsize="4em" align="center"> Brought to us by our friends at the FTC http://www.ftc.gov/infosecurity/ </blurb> </slide> http://cvs.php.net/co.php/presentations/slides/intro/sneak.xml?r=1.1&p=1 Index: presentations/slides/intro/sneak.xml +++ presentations/slides/intro/sneak.xml <slide title="REST services from Yahoo!"> <list> <bullet>Web Search</bullet> <bullet>Web Search with Context</bullet> <bullet>Creative Commons Web Search</bullet> <bullet>News Search</bullet> <bullet>Image Search</bullet> <bullet>Local Search</bullet> <bullet>Video Search</bullet> </list> <blurb> And a new one that isn't public yet. </blurb> <list> <bullet>Context Extraction Service</bullet> </list> <example type="shell" fontsize="1.3em"> _Parameter Value Description _ appid string (required) The application ID. See Application IDs for more information. context string (required) The context to extract terms from (UTF-8 encoded). query string An optional query to help with the extraction process.</example> <example title="Example" fontsize="1.4em" result="1"><![CDATA[<?php $context = "Italian sculptors and painters of the renaissance favored the Virgin Mary for inspiration."; $url = 'http://api.search.yahoo.com/ContentAnalysisService/V1/termExtraction'; $post = "query=madonna&appid=RESTDemo&context=".rawurlencode($context); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $post); $xml = simplexml_load_string(curl_exec($ch)); curl_close($ch); echo $xml->asXML(); ?>]]></example> <blurb> </blurb> </slide> http://cvs.php.net/co.php/presentations/slides/intro/tools_dev.xml?r=1.1&p=1 Index: presentations/slides/intro/tools_dev.xml +++ presentations/slides/intro/tools_dev.xml <slide title="Development Tools"> <break lines="5"/> <list fontsize="5em"> <bullet>Revision control - CVS, SVN, Perforce, Bitkeeper</bullet> <bullet>Mailing Lists</bullet> <bullet>Twikis, Personal Pages</bullet> <bullet>Bug tracking - Bugzilla</bullet> <bullet>Regression Testing - phpt, phpunit</bullet> </list> </slide> http://cvs.php.net/co.php/presentations/slides/intro/ws1.xml?r=1.1&p=1 Index: presentations/slides/intro/ws1.xml +++ presentations/slides/intro/ws1.xml <slide title="Web Services"> <blurb> With PHP5's solid XML support and improved internal OOP support, Web Services are now a natural fit for PHP. Most people seem to think of SOAP when we say Web Services, so here is the obligatory SOAP example: </blurb> <example fontsize="1.4em"><![CDATA[<?php $amazon_index = array( 'DVD', 'Photo', 'Electronics', 'OfficeProducts', 'HealthPersonalCare', 'Toys', 'Baby', 'VideoGames', 'MusicTracks', 'OutdoorLiving', 'Blended', 'MusicalInstruments', 'Magazines', 'DigitalMusic', 'Jewelry', 'Video', 'Tools', 'PCHardware', 'SportingGoods', 'Classical', 'Software', 'Books', 'VHS', 'Wireless', 'Restaurants', 'Music', 'GourmetFood', 'Miscellaneous', 'Kitchen', 'WirelessAccessories', 'Merchants', 'Beauty', 'Apparel' ); function amazon($index, $keywords, $timeout=7200) { $dest_file = "/tmp/aws_{$index}_".md5($keywords); if(file_exists($dest_file) && filemtime($dest_file) > (time()-$timeout)) { $result = unserialize(file_get_contents($dest_file)); } else { $aws = new SoapClient('http://webservices.amazon.com/'. 'AWSECommerceService/US/AWSECommerceService.wsdl', array("trace" => 1)); $result = $aws->ItemSearch(array( 'SubscriptionId'=>'XXXXXXXXXXXXXX', 'AssociateTag'=>'lerdorf-20', 'Request'=>array(array('SearchIndex'=>$index, 'Keywords'=>$keywords)) ) ); $tmpf = tempnam('/tmp','YWS'); file_put_contents($tmpf, serialize($result)); rename($tmpf, $dest_file); } return $result; } ?>]]></example> </slide> http://cvs.php.net/co.php/presentations/slides/intro/ws2.xml?r=1.1&p=1 Index: presentations/slides/intro/ws2.xml +++ presentations/slides/intro/ws2.xml <slide title="SOAP Server"> <example fontsize="1.5em"><![CDATA[<?php function Add($x,$y) { return $x+$y; } $server = new SoapServer(null,array('uri'=>"http://test-uri/")); $server->addFunction("Add"); $server->handle(); ?>]]></example> <blurb>Or using a WSDL:</blurb> <example fontsize="1.5em"><![CDATA[<?php function Add($x,$y) { return $x+$y; } $server = new SoapServer("./add.wsdl")); $server->addFunction("Add"); $server->handle(); ?>]]></example> <example fontsize="1.2em" title="add.wsdl"><![CDATA[<?xml version="1.0" ?> <definitions xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:si="http://soapinterop.org/xsd" xmlns:tns="http://localhost/~rasmus/pecl/soap/test.wsdl" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://localhost/~rasmus/pecl/soap/test.wsdl"> <types> <xsd:schema targetNamespace="http://localhost/~rasmus/pecl/soap/test.wsdl"> <xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/" /> <xsd:import namespace="http://schemas.xmlsoap.org/wsdl/" /> </xsd:schema> </types> <message name="AddRequest"> <part name="x" type="xsd:double" /> <part name="y" type="xsd:double" /> </message> <message name="AddResponse"> <part name="result" type="xsd:double" /> </message> <portType name="TestServicePortType"> <operation name="Add"> <input message="tns:AddRequest" /> <output message="tns:AddResponse" /> </operation> </portType> <binding name="TestServiceBinding" type="tns:TestServicePortType"> <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" /> <operation name="Add"> <soap:operation soapAction="Add" style="rpc" /> <input> <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </input> <output> <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </output> </operation> </binding> <service name="TestService"> <port name="TestServicePort" binding="tns:TestServiceBinding"> <soap:address location="http://localhost/~rasmus/pecl/soap/soap_server.php"/> </port> </service> </definitions>]]></example> </slide> http://cvs.php.net/co.php/presentations/slides/intro/ws3.xml?r=1.1&p=1 Index: presentations/slides/intro/ws3.xml +++ presentations/slides/intro/ws3.xml <slide title="No more SOAP!"> <blurb> SOAP makes my head hurt. Let's look at some stuff we can all actually understand instead. </blurb> <example title="Take a pinch of RSS" result="1" rfontsize="1.2em"><![CDATA[<?php $url = 'http://buzz.yahoo.com/feeds/buzzoverl.xml'; $xml = simplexml_load_file($url); foreach($xml->channel->item as $item) { $ret[(string)$item->title] = (string)$item->link; } echo "<pre>"; print_r($ret); echo "</pre>"; ?>]]></example> <example fontsize="1.6em" title="Add a spoonful of REST"><![CDATA[<?php $srv = 'http://api.search.yahoo.com/ImageSearchService/V1/imageSearch'; foreach($ret as $key=>$link) { $url = $srv . "?query=$key&appid=RESTDemo"; $obj = simplexml_load_file($url); } ?>]]></example> <example type="shell" title="A thimble of gradeschool math">x^2/a^2 + y^2/b^2 = 1</example> <blurb>And we end up with something like this</blurb> <link align="center" fontsize="5em" href="http://buzz.progphp.com/">http://buzz.progphp.com</link> <blurb>By the way, throwing a cache layer between you and whatever remote service you are accessing tends to be a good idea. In our case we can do it like this:</blurb> <example fontsize="1.6em"><![CDATA[<?php $tmp = '/tmp/'.md5($q); if(!file_exists($tmp) || filemtime($tmp) < (time()-7200)) { $stream = fopen($url,'r'); $tmpf = tempnam('/tmp','YWS'); file_put_contents($tmpf, $stream); fclose($stream); rename($tmpf, $tmp); } $obj = simplexml_load_file(file_get_contents($tmp)); ?>]]></example> </slide>