cvs: presentations / errorhandling-adam2003.xml /slides/errorhandling check-return-value.xml debug.gif debug.xml demo.png error_cb.png
function-lib.xml monkey_typing.png phpunit1.xml phpunit2.xml profile.png shot_4.png trace.png user-input.xml user-input2.xml vardump.png
weaverslave.xml xdebug-cb-dump.xml xdebug-demo.xml xdebug-profile.xml xdebug-trace.xml xdebug.xml

From: Date: Fri, 09 May 2003 09:38:23 +0000
Subject: cvs: presentations / errorhandling-adam2003.xml /slides/errorhandling check-return-value.xml debug.gif debug.xml demo.png error_cb.png
function-lib.xml monkey_typing.png phpunit1.xml phpunit2.xml profile.png shot_4.png trace.png user-input.xml user-input2.xml vardump.png
weaverslave.xml xdebug-cb-dump.xml xdebug-demo.xml xdebug-profile.xml xdebug-trace.xml xdebug.xml
Groups: php.pres 
Request: Send a blank email to pres+get-706@lists.php.net to get a copy of this message
derick Fri May 9 05:38:23 2003 EDT Added files: /presentations/slides/errorhandling check-return-value.xml debug.gif debug.xml demo.png error_cb.png function-lib.xml monkey_typing.png phpunit1.xml phpunit2.xml profile.png shot_4.png trace.png user-input.xml user-input2.xml vardump.png weaverslave.xml xdebug-cb-dump.xml xdebug-demo.xml xdebug-profile.xml xdebug-trace.xml xdebug.xml Modified files: /presentations errorhandling-adam2003.xml Log: - Adding the missing slides

Index: presentations/errorhandling-adam2003.xml diff -u presentations/errorhandling-adam2003.xml:1.1 presentations/errorhandling-adam2003.xml:1.2 --- presentations/errorhandling-adam2003.xml:1.1 Tue May 6 16:51:46 2003 +++ presentations/errorhandling-adam2003.xml Fri May 9 05:38:22 2003 @@ -36,6 +36,7 @@ <!-- Preventing --> <slide>slides/errorhandling/user-input.xml</slide> +<slide>slides/errorhandling/user-input2.xml</slide> <slide>slides/errorhandling/check-return-value.xml</slide> <!-- Dry theory --> @@ -45,16 +46,19 @@ <!-- Testing! --> <slide>slides/errorhandling/function-lib.xml</slide> -<slide>slides/errorhandling/test-all-paths1.xml</slide> -<slide>slides/errorhandling/test-all-paths2.xml</slide> <slide>slides/errorhandling/phpunit1.xml</slide> <slide>slides/errorhandling/phpunit2.xml</slide> -<slide>slides/errorhandling/phpunit3.xml</slide> -<slide>slides/errorhandling/phpunit4.xml</slide> -<slide>slides/errorhandling/phpunit5.xml</slide> <!-- Still problems? Debug! --> +<slide>slides/errorhandling/debug.xml</slide> +<slide>slides/errorhandling/xdebug.xml</slide> +<slide>slides/errorhandling/xdebug-cb-dump.xml</slide> +<slide>slides/errorhandling/xdebug-trace.xml</slide> +<slide>slides/errorhandling/xdebug-profile.xml</slide> +<slide>slides/errorhandling/xdebug-demo.xml</slide> + +<slide>slides/errorhandling/weaverslave.xml</slide> <slide>slides/errorhandling/questions.xml</slide> <slide>slides/errorhandling/resources.xml</slide> Index: presentations/slides/errorhandling/check-return-value.xml +++ presentations/slides/errorhandling/check-return-value.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>Checking Return Values</title> <blurb> </blurb> <blurb>PHP 4:</blurb> <example fontsize="1.2em"><![CDATA[<?php if (@mysql_connect('localhost', 'root', 'ut34FblY:')) { if (@mysql_select_db('game')) { $r = mysql_query('SELECT * FROM news ORDER BY date DESC LIMIT 1'); ...]]></example> <blurb> </blurb> <blurb>PHP 5:</blurb> <example fontsize="1.2em"><![CDATA[<?php try { mysql_connect('localhost', 'root', 'ut34FblY:')); mysql_select_db('game'); $r = mysql_query('SELECT * FROM news ORDER BY date DESC LIMIT 1'); } catch (Exception $e) { /* Do recovery */ exit(); }]]></example> </slide> Index: presentations/slides/errorhandling/debug.xml +++ presentations/slides/errorhandling/debug.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em" title="Debug"> <blurb> </blurb> <blurb> </blurb> <blurb> </blurb> <image align="center" filename="debug.gif" /> <list marginleft="4em" effect="slide" fontsize="5em"> <bullet>Not perfect code</bullet> <bullet>Time to debug!</bullet> <bullet>"echo" debugging</bullet> <bullet>Time consuming</bullet> </list> </slide> Index: presentations/slides/errorhandling/function-lib.xml +++ presentations/slides/errorhandling/function-lib.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em" title="Testing"> <image align="right" filename="monkey_typing.png" /> <example fontsize="0.7em"><![CDATA[<?php function crop_string ($str, $length) { if (strlen($str) > $length - 3) { $lines = split("\n", wordwrap($str, $length - 3)); return $lines[0]. "..."; } else { return $str; } } ?>]]></example> <example fontsize="0.7em"><![CDATA[<?php include 'lib.php'; $tests = array ( 'crop_string' => array( array('foo...', 'foo', 1), array('foo...', 'foo', 3), array('foo', 'foo', 7), array('', '', 1), array('', '', 7), array('Hello...', 'Hello world', 1), array('Hello...', 'Hello world', 7), array('Hello world', 'Hello world', 17), ), ); $functions = get_defined_functions(); $functions = $functions['user']; foreach ($functions as $function) { if (isset($tests[$function])) { $i = 0; foreach ($tests[$function] as $test) { $i++; switch (count($test)) { case 2: $res = $function($test[1]); break; case 3: $res = $function($test[1], $test[2]); break; } if ($res != $test[0]) { echo "FAILED test $function, $i: Expected '{$test[0]}' got '$res'\n"; } else { echo "PASSED test $function, $i\n"; } } } } ?>]]></example> </slide> Index: presentations/slides/errorhandling/phpunit1.xml +++ presentations/slides/errorhandling/phpunit1.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em" title="PHPUnit"> <blurb> </blurb> <blurb> </blurb> <blurb> </blurb> <blurb> </blurb> <image align="right" filename="bug.gif" /> <list effect="slide" fontsize="5em"> <bullet>PEAR Class</bullet> <bullet>%pear install PHPUnit%</bullet> <bullet>Easy testing of class (methods)</bullet> <bullet>Automated</bullet> </list> </slide> Index: presentations/slides/errorhandling/phpunit2.xml +++ presentations/slides/errorhandling/phpunit2.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em" title="Running Testsuite"> <example fontsize="0.8em"><![CDATA[<?php class CropString { function cropString($str, $length) { if (strlen($str) > $length - 3) { $lines = split("\n", wordwrap($str, $length - 3)); $this->result = $lines[0]. "..."; } else { $this->result = $str; } } ?>]]></example> <example fontsize="0.8em"><![CDATA[<?php require_once 'crop_string.class.php'; require_once 'PHPUnit.php'; class CropStringTest extends PHPUnit_TestCase { function CropStringTest($name) { PHPUnit_TestCase::PHPUnit_TestCase($name); } function emptyTest() { $cstring = new CropString('', 1); $this->assertTrue($cstring->result == ''); } function fooTest() { $cstring = new CropString('foo', 1); $this->assertTrue($cstring->result == 'foo...'); } function helloWorldTest() { $cstring = new CropString('Hello world', 1); $this->assertTrue($cstring->result == 'Hello...'); } } $suite = new PHPUnit_TestSuite(); $suite->addTest(new CropStringTest('emptyTest')); $suite->addTest(new CropStringTest('fooTest')); $suite->addTest(new CropStringTest('helloWorldTest')); $result = PHPUnit::run($suite); echo $result->toString(); ?>]]></example> </slide> Index: presentations/slides/errorhandling/user-input.xml +++ presentations/slides/errorhandling/user-input.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>User Input</title> <blurb> </blurb> <blurb> </blurb> <blurb> </blurb> <blurb> </blurb> <blurb> </blurb> <list effect="slide" fontsize="5em"> <bullet>Users are evil!</bullet> <bullet>register_globals == evil</bullet> <bullet>$_GET, $_POST, $_COOKIE, $_REQUEST, $_ENV, $_SERVER</bullet> </list> </slide> Index: presentations/slides/errorhandling/user-input2.xml +++ presentations/slides/errorhandling/user-input2.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>User Input (2)</title> <blurb> </blurb> <blurb> </blurb> <blurb> </blurb> <blurb> </blurb> <list effect="slide" fontsize="5em"> <bullet>Cross Site Scripting</bullet> <bullet>SQL injection</bullet> <bullet>String cut attacks</bullet> <bullet>include() and eval()</bullet> </list> </slide> Index: presentations/slides/errorhandling/weaverslave.xml +++ presentations/slides/errorhandling/weaverslave.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>Weaverslave</title> <image align="center" filename="shot_4.png" /> </slide> Index: presentations/slides/errorhandling/xdebug-cb-dump.xml +++ presentations/slides/errorhandling/xdebug-cb-dump.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>Modified PHP functions</title> <blurb> </blurb> <blurb>Modified error handler: </blurb> <image align="center" filename="error_cb.png"/> <blurb> </blurb> <blurb> </blurb> <blurb> </blurb> <blurb>Modified var_dump() function:</blurb> <image align="center" filename="vardump.png"/> </slide> Index: presentations/slides/errorhandling/xdebug-demo.xml +++ presentations/slides/errorhandling/xdebug-demo.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>Demo</title> <blurb> </blurb> <image align="center" filename="demo.png"/> </slide> Index: presentations/slides/errorhandling/xdebug-profile.xml +++ presentations/slides/errorhandling/xdebug-profile.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>Profiling</title> <image align="center" filename="profile.png"/> <blurb> </blurb> <list effect="slide" fontsize="4.5em"> <bullet>xdebug_start_profile()</bullet> <bullet>xdebug_dump_function_profile(mode)</bullet> <bullet marginleft="2em">8 profiling modes</bullet> </list> </slide> Index: presentations/slides/errorhandling/xdebug-trace.xml +++ presentations/slides/errorhandling/xdebug-trace.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em"> <title>Tracing</title> <blurb> </blurb> <image align="center" filename="trace.png"/> <blurb> </blurb> <blurb> </blurb> <list effect="slide" fontsize="5em"> <bullet>xdebug_start_trace()</bullet> <bullet>xdebug_dump_function_trace()</bullet> </list> </slide> Index: presentations/slides/errorhandling/xdebug.xml +++ presentations/slides/errorhandling/xdebug.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide fontsize="6em" title="Xdebug"> <blurb> </blurb> <blurb> </blurb> <blurb> </blurb> <blurb> </blurb> <list effect="slide" fontsize="4.5em"> <bullet>Helps finding bugs</bullet> <bullet>Zend extension</bullet> <bullet type="none" marginleft="2em">zend_extension=/path/to/xdebug.so</bullet> <bullet type="none" marginleft="2em">zend_extension_ts=C:/path/to/xdebug.dll</bullet> <bullet>Hooks into error handler</bullet> <bullet type="none" marginleft="2em">and function exection</bullet> </list> </slide>
« previous php.pres (#706) next »