cvs: presentations / ezc-quebec9.xml ezc-winter09.xml /slides/ezc all_your_base.png install-bundle.xml install-download.xml install-pear.xml
install.xml kore-tobias.xml mvc-basic-ideas.xml mvc-controller-algo.xml mvc-controller-redirect.xml mvc-controller.xml
mvc-dispatcher-configuration.xml mvc-dispatcher.xml mvc-filters.xml mvc-login.xml mvc-parts-overview.xml mvc-request-example-http.xml
mvc-request-example-mail.xml mvc-request-parser.xml mvc-response-writer.xml mvc-router.xml mvc-routing-information.xml mvc-view-handlers.xml
mvc-views.xml mvctools-login.png mvctools-overview.png mvctools-overview.svg mvctools-zones.png new-2008.2.xml onr-autoload.xml onr-config.xml
onr-configuration1.xml onr-database-scheme.xml onr-dirs.xml onr-home-controller1.xml onr-index-config.xml onr-index-htaccess.xml onr-intro.xml
onr-main-view.xml onr-step1.jpg onr-step2-action-login-logout.xml onr-step2-action-login-required.xml onr-step2-action-register-submit.xml
onr-step2-auth-over! view.xml onr-step2-configuration.xml onr-step2-overview.xml onr-step2-result.xml onr-step2-routes-autoload.xml
onr-step2-template.xml onr-step2-template2.xml onr-step2-views.xml onr-step2.jpg onr-step3-action-list.xml onr-step3-action-recipe-add-submit.xml
onr-step3-action-view.xml onr-step3-add-recipe.xml onr-step3-configuration.xml onr-step3-result.xml onr-step3-routes-autoload.php
onr-step3-routes-autoload.xml onr-step3-template.xml onr-step3-template2.xml onr-step3-views.xml onr-step3.jpg onr-template-home1.xml
onr-template-main.xml overview.xml router.xml

From: Date: Tue, 03 Mar 2009 12:02:32 +0000
Subject: cvs: presentations / ezc-quebec9.xml ezc-winter09.xml /slides/ezc all_your_base.png install-bundle.xml install-download.xml install-pear.xml
install.xml kore-tobias.xml mvc-basic-ideas.xml mvc-controller-algo.xml mvc-controller-redirect.xml mvc-controller.xml
mvc-dispatcher-configuration.xml mvc-dispatcher.xml mvc-filters.xml mvc-login.xml mvc-parts-overview.xml mvc-request-example-http.xml
mvc-request-example-mail.xml mvc-request-parser.xml mvc-response-writer.xml mvc-router.xml mvc-routing-information.xml mvc-view-handlers.xml
mvc-views.xml mvctools-login.png mvctools-overview.png mvctools-overview.svg mvctools-zones.png new-2008.2.xml onr-autoload.xml onr-config.xml
onr-configuration1.xml onr-database-scheme.xml onr-dirs.xml onr-home-controller1.xml onr-index-config.xml onr-index-htaccess.xml onr-intro.xml
onr-main-view.xml onr-step1.jpg onr-step2-action-login-logout.xml onr-step2-action-login-required.xml onr-step2-action-register-submit.xml
onr-step2-auth-over! view.xml onr-step2-configuration.xml onr-step2-overview.xml onr-step2-result.xml onr-step2-routes-autoload.xml
onr-step2-template.xml onr-step2-template2.xml onr-step2-views.xml onr-step2.jpg onr-step3-action-list.xml onr-step3-action-recipe-add-submit.xml
onr-step3-action-view.xml onr-step3-add-recipe.xml onr-step3-configuration.xml onr-step3-result.xml onr-step3-routes-autoload.php
onr-step3-routes-autoload.xml onr-step3-template.xml onr-step3-template2.xml onr-step3-views.xml onr-step3.jpg onr-template-home1.xml
onr-template-main.xml overview.xml router.xml
Groups: php.pres 
Request: Send a blank email to pres+get-1540@lists.php.net to get a copy of this message
derick Tue Mar 3 12:02:32 2009 UTC Added files: /presentations ezc-winter09.xml ezc-quebec9.xml /presentations/slides/ezc install-bundle.xml install.xml kore-tobias.xml mvc-basic-ideas.xml mvc-controller-algo.xml mvc-controller-redirect.xml mvc-controller.xml mvc-dispatcher-configuration.xml mvc-dispatcher.xml mvc-filters.xml mvc-login.xml mvc-parts-overview.xml mvc-request-example-http.xml mvc-request-example-mail.xml mvc-request-parser.xml mvc-response-writer.xml mvc-router.xml mvc-routing-information.xml mvc-view-handlers.xml mvc-views.xml mvctools-login.png mvctools-overview.png mvctools-overview.svg mvctools-zones.png new-2008.2.xml onr-autoload.xml onr-config.xml onr-configuration1.xml onr-database-scheme.xml onr-dirs.xml onr-home-controller1.xml onr-index-config.xml onr-index-htaccess.xml onr-intro.xml onr-main-view.xml onr-step1.jpg onr-step2-action-login-logout.xml onr-step2-action-login-required.xml onr-step2-action-register-submit.xml onr-step2-auth-overview.xml onr-step2-configuration.xml onr-step2-overview.xml onr-step2-result.xml onr-step2-routes-autoload.xml onr-step2-template.xml onr-step2-template2.xml onr-step2-views.xml onr-step2.jpg onr-step3-action-list.xml onr-step3-action-recipe-add-submit.xml onr-step3-action-view.xml onr-step3-add-recipe.xml onr-step3-configuration.xml onr-step3-result.xml onr-step3-routes-autoload.php onr-step3-routes-autoload.xml onr-step3-template.xml onr-step3-template2.xml onr-step3-views.xml onr-step3.jpg onr-template-home1.xml onr-template-main.xml router.xml Modified files: /presentations/slides/ezc all_your_base.png install-download.xml install-pear.xml overview.xml Log: - Added ezc presentations and slides.

http://cvs.php.net/viewvc.cgi/presentations/slides/ezc/all_your_base.png?r1=1.2&r2=1.3&diff_format=u Index: presentations/slides/ezc/all_your_base.png http://cvs.php.net/viewvc.cgi/presentations/slides/ezc/install-download.xml?r1=1.9&r2=1.10&diff_format=u Index: presentations/slides/ezc/install-download.xml diff -u presentations/slides/ezc/install-download.xml:1.9 presentations/slides/ezc/install-download.xml:1.10 --- presentations/slides/ezc/install-download.xml:1.9 Thu Oct 30 12:16:15 2008 +++ presentations/slides/ezc/install-download.xml Tue Mar 3 12:02:31 2009 @@ -5,14 +5,14 @@ <blurb>Installation:</blurb> <example><![CDATA[// download the bundle from http://ezcomponents.org/download -tar -xjf ezcomponents-2008.1.tar.bz2 +tar -xjf ezcomponents-2008.2.tar.bz2 pwd]]></example> -<break lines="3"/> +<break/> <blurb>Setup:</blurb> <example result='0'><![CDATA[<?php -ini_set( 'include_path', '/home/httpd/ezcomponents-2008.1:.' ); +ini_set( 'include_path', '/home/httpd/ezcomponents-2008.2:.' ); require 'Base/src/base.php'; function __autoload( $className ) @@ -20,4 +20,12 @@ ezcBase::autoload( $className ); } ?>]]></example> + +<break/> + + <blurb>Quick Setup:</blurb> + <example result='0'><![CDATA[<?php +ini_set( 'include_path', '/home/httpd/ezcomponents-2008.2:.' ); +require 'Base/src/ezc_bookstrap.php'; +?>]]></example> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/ezc/install-pear.xml?r1=1.3&r2=1.4&diff_format=u Index: presentations/slides/ezc/install-pear.xml diff -u presentations/slides/ezc/install-pear.xml:1.3 presentations/slides/ezc/install-pear.xml:1.4 --- presentations/slides/ezc/install-pear.xml:1.3 Sat May 12 22:23:39 2007 +++ presentations/slides/ezc/install-pear.xml Tue Mar 3 12:02:31 2009 @@ -8,7 +8,7 @@ pear remote-list -c ezc pear install ezc/ezcomponents]]></example> -<break lines="3"/> +<break/> <blurb>Setup:</blurb> <example result='0'><![CDATA[<?php @@ -19,4 +19,11 @@ ezcBase::autoload( $className ); } ?>]]></example> + +<break/> + + <blurb>Quick Setup:</blurb> + <example result='0'><![CDATA[<?php +require 'ezc/Base/ezc_bootstrap.php'; +?>]]></example> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/ezc/overview.xml?r1=1.3&r2=1.4&diff_format=u Index: presentations/slides/ezc/overview.xml diff -u presentations/slides/ezc/overview.xml:1.3 presentations/slides/ezc/overview.xml:1.4 --- presentations/slides/ezc/overview.xml:1.3 Sat May 12 22:23:40 2007 +++ presentations/slides/ezc/overview.xml Tue Mar 3 12:02:32 2009 @@ -2,9 +2,5 @@ <slide fontsize="6em"> <title>Overview</title> - <blurb><![CDATA[ -<div id="graph"> -<iframe id="graphIn" src="http://kossu/test/allyourbase.svg"/> -</div> -]]></blurb> + <image align="center" filename="all_your_base.png"/> </slide> http://cvs.php.net/viewvc.cgi/presentations/ezc-winter09.xml?view=markup&rev=1.1 Index: presentations/ezc-winter09.xml +++ presentations/ezc-winter09.xml <?xml version="1.0" encoding="iso-8859-1"?> <presentation template="css" navmode="html" navbarbackground="#4373b4" navbartopiclinks="0" navColor="#000000" logo1="" stylesheet="presentations/slides/ezc/ez.css" backgroundfixed="1" > <topic>Component Libraries</topic> <title>eZ Components Tutorial</title> <event>eZ International Winter Conference</event> <location>Barcelona, Spain</location> <date>Jan 29th, 2009</date> <speaker>Derick Rethans</speaker> <email>dr@ez.no</email> <url>http://derickrethans.nl/talks.php</url> <slide>slides/ezc/title-ezc-generic.xml</slide> <!-- introduction --> <slide>slides/toolbox/goals-process.xml</slide> <slide>slides/toolbox/documentation.xml</slide> <slide>slides/toolbox/goals-library.xml</slide> <slide>slides/ezc/contributing.xml</slide> <slide>slides/toolbox/dependencies.xml</slide> <slide>slides/ezc/overview.xml</slide> <slide>slides/ezc/dev-process.xml</slide> <slide>slides/ezc/install.xml</slide> <slide>slides/ezc/install-pear.xml</slide> <slide>slides/ezc/install-download.xml</slide> <slide>slides/ezc/new-2008.2.xml</slide> <slide>slides/ezc/kore-tobias.xml</slide> <!-- quick mvc intro --> <slide>slides/ezc/mvc-parts-overview.xml</slide> <slide>slides/ezc/mvc-basic-ideas.xml</slide> <slide>slides/ezc/mvc-dispatcher.xml</slide> <slide>slides/ezc/mvc-dispatcher-configuration.xml</slide> <slide>slides/ezc/mvc-request-parser.xml</slide> <slide>slides/ezc/mvc-router.xml</slide> <slide>slides/ezc/mvc-controller.xml</slide> <slide>slides/ezc/mvc-views.xml</slide> <slide>slides/ezc/mvc-response-writer.xml</slide> <slide>slides/ezc/mvc-filters.xml</slide> <!-- introducing the app --> <slide>slides/ezc/onr-intro.xml</slide> <slide>slides/ezc/onr-dirs.xml</slide> <slide>slides/ezc/onr-config.xml</slide> <slide>slides/ezc/onr-index-htaccess.xml</slide> <slide>slides/ezc/onr-database-scheme.xml</slide> <!-- step 1 --> <slide>slides/ezc/onr-configuration1.xml</slide> <slide>slides/ezc/onr-autoload.xml</slide> <slide>slides/ezc/onr-home-controller1.xml</slide> <slide>slides/ezc/onr-main-view.xml</slide> <slide>slides/ezc/onr-template-main.xml</slide> <slide>slides/ezc/onr-template-home1.xml</slide> <!-- step 2: authentication --> <slide>slides/ezc/onr-step2-overview.xml</slide> <slide>slides/ezc/onr-step2-auth-overview.xml</slide> <slide>slides/ezc/onr-step2-routes-autoload.xml</slide> <slide>slides/ezc/onr-step2-configuration.xml</slide> <slide>slides/ezc/onr-step2-views.xml</slide> <slide>slides/ezc/onr-step2-template.xml</slide> <slide>slides/ezc/onr-step2-template2.xml</slide> <slide>slides/ezc/onr-step2-action-login-required.xml</slide> <slide>slides/ezc/onr-step2-action-login-logout.xml</slide> <slide>slides/ezc/onr-step2-action-register-submit.xml</slide> <slide>slides/ezc/onr-step2-result.xml</slide> <!-- step 3: adding a recipe --> <slide>slides/ezc/onr-step3-add-recipe.xml</slide> <slide>slides/ezc/onr-step3-routes-autoload.xml</slide> <slide>slides/ezc/onr-step3-configuration.xml</slide> <slide>slides/ezc/onr-step3-views.xml</slide> <slide>slides/ezc/onr-step3-template.xml</slide> <slide>slides/ezc/onr-step3-template2.xml</slide> <slide>slides/ezc/onr-step3-action-recipe-add-submit.xml</slide> <slide>slides/ezc/onr-step3-action-list.xml</slide> <slide>slides/ezc/onr-step3-action-view.xml</slide> <slide>slides/ezc/onr-step3-result.xml</slide> <!-- implementing the app --> <!-- <slide>slides/ezc/mvc-.xml</slide> <slide>slides/ezc/mvc-.xml</slide> <slide>slides/ezc/mvc-.xml</slide> <slide>slides/ezc/mvc-.xml</slide> <slide>slides/ezc/mvc-.xml</slide> <slide>slides/ezc/mvc-.xml</slide> <slide>slides/ezc/mvc-.xml</slide> <slide>slides/ezc/mvc-.xml</slide> <slide>slides/ezc/mvc-.xml</slide> <slide>slides/ezc/mvc-.xml</slide> <slide>slides/ezc/mvc-.xml</slide> <slide>slides/ezc/mvc-.xml</slide> <slide>slides/ezc/mvc-.xml</slide> --> <!-- the tutorial --> <!-- overview --> <slide>slides/ezc/support.xml</slide> <slide>slides/ezc/questions.xml</slide> </presentation> http://cvs.php.net/viewvc.cgi/presentations/ezc-quebec9.xml?view=markup&rev=1.1 Index: presentations/ezc-quebec9.xml +++ presentations/ezc-quebec9.xml <?xml version="1.0" encoding="UTF-8"?> <presentation template="css" navmode="html" navbarbackground="#4373b4" navbartopiclinks="0" navColor="#000000" logo1="" stylesheet="presentations/slides/ezc/ez.css" backgroundfixed="1" > <topic>Component Libraries</topic> <title>MVC Tools</title> <event>PHP Québec 2009</event> <location>Montréal, Canada</location> <date>March 6th, 2009</date> <speaker>Derick Rethans</speaker> <email>dr@ez.no</email> <url>http://derickrethans.nl/talks.php</url> <slide>slides/ezc/title-ezc-generic.xml</slide> <!-- quick mvc intro --> <slide>slides/ezc/mvc-basic-ideas.xml</slide> <slide>slides/ezc/mvc-parts-overview.xml</slide> <slide>slides/ezc/mvc-dispatcher.xml</slide> <slide>slides/ezc/mvc-dispatcher-configuration.xml</slide> <slide>slides/ezc/mvc-request-parser.xml</slide> <slide>slides/ezc/mvc-request-example-http.xml</slide> <slide>slides/ezc/mvc-request-example-mail.xml</slide> <slide>slides/ezc/mvc-router.xml</slide> <slide>slides/ezc/mvc-routing-information.xml</slide> <slide>slides/ezc/mvc-controller.xml</slide> <slide>slides/ezc/mvc-controller-algo.xml</slide> <slide>slides/ezc/mvc-controller-redirect.xml</slide> <slide>slides/ezc/mvc-views.xml</slide> <slide>slides/ezc/mvc-view-handlers.xml</slide> <slide>slides/ezc/mvc-response-writer.xml</slide> <slide>slides/ezc/mvc-filters.xml</slide> <!-- introducing the app --> <slide>slides/ezc/onr-intro.xml</slide> <slide>slides/ezc/onr-dirs.xml</slide> <slide>slides/ezc/onr-config.xml</slide> <slide>slides/ezc/onr-index-htaccess.xml</slide> <!--<slide>slides/ezc/onr-database-scheme.xml</slide>--> <!-- step 1 --> <slide>slides/ezc/onr-configuration1.xml</slide> <slide>slides/ezc/onr-autoload.xml</slide> <slide>slides/ezc/onr-home-controller1.xml</slide> <slide>slides/ezc/onr-main-view.xml</slide> <slide>slides/ezc/onr-template-main.xml</slide> <slide>slides/ezc/onr-template-home1.xml</slide> <!-- step 2: authentication --> <slide>slides/ezc/onr-step2-overview.xml</slide> <slide>slides/ezc/onr-step2-auth-overview.xml</slide> <slide>slides/ezc/onr-step2-routes-autoload.xml</slide> <slide>slides/ezc/onr-step2-configuration.xml</slide> <slide>slides/ezc/onr-step2-views.xml</slide> <slide>slides/ezc/onr-step2-template.xml</slide> <slide>slides/ezc/onr-step2-template2.xml</slide> <slide>slides/ezc/onr-step2-action-login-required.xml</slide> <slide>slides/ezc/onr-step2-action-login-logout.xml</slide> <slide>slides/ezc/onr-step2-action-register-submit.xml</slide> <slide>slides/ezc/onr-step2-result.xml</slide> <!-- step 3: adding a recipe --> <slide>slides/ezc/onr-step3-add-recipe.xml</slide> <slide>slides/ezc/onr-step3-routes-autoload.xml</slide> <slide>slides/ezc/onr-step3-configuration.xml</slide> <slide>slides/ezc/onr-step3-views.xml</slide> <slide>slides/ezc/onr-step3-template.xml</slide> <slide>slides/ezc/onr-step3-template2.xml</slide> <slide>slides/ezc/onr-step3-action-recipe-add-submit.xml</slide> <slide>slides/ezc/onr-step3-action-list.xml</slide> <slide>slides/ezc/onr-step3-action-view.xml</slide> <slide>slides/ezc/onr-step3-result.xml</slide> <!-- implementing the app --> <!-- <slide>slides/ezc/mvc-.xml</slide> <slide>slides/ezc/mvc-.xml</slide> <slide>slides/ezc/mvc-.xml</slide> <slide>slides/ezc/mvc-.xml</slide> <slide>slides/ezc/mvc-.xml</slide> <slide>slides/ezc/mvc-.xml</slide> <slide>slides/ezc/mvc-.xml</slide> <slide>slides/ezc/mvc-.xml</slide> <slide>slides/ezc/mvc-.xml</slide> <slide>slides/ezc/mvc-.xml</slide> <slide>slides/ezc/mvc-.xml</slide> <slide>slides/ezc/mvc-.xml</slide> <slide>slides/ezc/mvc-.xml</slide> --> <!-- the tutorial --> <!-- overview --> <slide>slides/ezc/support.xml</slide> <slide>slides/ezc/questions.xml</slide> </presentation> http://cvs.php.net/viewvc.cgi/presentations/slides/ezc/install-bundle.xml?view=markup&rev=1.1 Index: presentations/slides/ezc/install-bundle.xml +++ presentations/slides/ezc/install-bundle.xml http://cvs.php.net/viewvc.cgi/presentations/slides/ezc/install.xml?view=markup&rev=1.1 Index: presentations/slides/ezc/install.xml +++ presentations/slides/ezc/install.xml <?xml version="1.0" encoding="utf-8"?> <slide> <title>Installation and Setup</title> <blurb>Through the PEAR installer</blurb> <list> <bullet>Easy to upgrade one (or more) specific component(s)</bullet> <bullet>Depends on external tool</bullet> </list> <break/> <blurb>From a download bundle</blurb> <list> <bullet>Everything comes in one package</bullet> <bullet>Hard to impossible to upgrade one specific component</bullet> </list> <break/> <blurb>|777777|Through eZ Publish download|</blurb> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/ezc/kore-tobias.xml?view=markup&rev=1.1 Index: presentations/slides/ezc/kore-tobias.xml +++ presentations/slides/ezc/kore-tobias.xml <?xml version="1.0" encoding="iso-8859-1"?> <slide fontsize="6em"> <title>Additions for eZ Components 2008.2</title> <list> <bullet>Kore Nordmann, on using Document</bullet> <bullet>Tobias Schlitt, on using Webdav</bullet> </list> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/ezc/mvc-basic-ideas.xml?view=markup&rev=1.1 Index: presentations/slides/ezc/mvc-basic-ideas.xml +++ presentations/slides/ezc/mvc-basic-ideas.xml <?xml version="1.0" encoding="utf-8"?> <slide> <title>Core Ideas</title> <list> <bullet>Everything is decoupled</bullet> <bullet>Everything can be reused</bullet> <bullet>It's easy to override and overload functionality</bullet> <bullet>The MvcTools package does not dictate any kind of structure</bullet> <bullet>Full flexibility</bullet> </list> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/ezc/mvc-controller-algo.xml?view=markup&rev=1.1 Index: presentations/slides/ezc/mvc-controller-algo.xml +++ presentations/slides/ezc/mvc-controller-algo.xml <?xml version="1.0" encoding="utf-8"?> <slide> <title>Controller</title> <subtitle>Changing action mapping algorithm</subtitle> <list> <bullet>The "default" controller uses the actions name to map to a method, but this algorithm can be easily overridden.</bullet> </list> <example>&lt;?php class helloController extends ezcMvcController { public function action_greet() { $ret = new ezcMvcResult; $ret->variables['greeting'] = 'Hello World!'; return $ret; } public function createActionMethodName( $actionName ) { return 'action_' . $actionName; } ?></example> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/ezc/mvc-controller-redirect.xml?view=markup&rev=1.1 Index: presentations/slides/ezc/mvc-controller-redirect.xml +++ presentations/slides/ezc/mvc-controller-redirect.xml <?xml version="1.0" encoding="utf-8"?> <slide> <title>Controller</title> <subtitle>Redirects</subtitle> <blurb>Internal redirects are replacements for ezcMvcResult objects:</blurb> <example>class redirectController extends ezcMvcController { public function doLogout() { $request = clone $this->request; $request->variables['redirUrl'] = '/new-url'; $request->variables['reasons'] = 'something was wrong'; $request->uri = '/login-required'; return new ezcMvcInternalRedirect( $request ); } }</example> <break lines="2"/> <blurb>External redirects are done through the status property:</blurb> <example>class redirectController extends ezcMvcController { public function doLogout() { $res = new ezcMvcResult; $res->status = new ezcMvcExternalRedirect( '/' ); return $res; } }</example> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/ezc/mvc-controller.xml?view=markup&rev=1.1 Index: presentations/slides/ezc/mvc-controller.xml +++ presentations/slides/ezc/mvc-controller.xml <?xml version="1.0" encoding="utf-8"?> <slide> <title>Controller</title> <list> <bullet>The controller is created by the dispatcher from the routing information returned by the router.</bullet> <bullet>The controller is responsible for business logic and returns its results in an %ezcMvcResult% object.</bullet> <bullet>Users should implement inheritted classes to provide the actions.</bullet> <bullet>The "default" controller uses the actions name to map to a method, but this algorithm can be easily overridden.</bullet> </list> <example>&lt;?php class helloController extends ezcMvcController { public function doGreet() { $ret = new ezcMvcResult; $ret->variables['greeting'] = 'Hello World!'; return $ret; } ?></example> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/ezc/mvc-dispatcher-configuration.xml?view=markup&rev=1.1 Index: presentations/slides/ezc/mvc-dispatcher-configuration.xml +++ presentations/slides/ezc/mvc-dispatcher-configuration.xml <?xml version="1.0" encoding="utf-8"?> <slide> <title>ezcMvcConfigurableDispatcher</title> <subtitle>The ezcMvcDispatcherConfiguration interface</subtitle> <example>createRequestParser(); createRouter( ezcMvcRequest $request ); createView( ezcMvcRoutingInformation $routeInfo, ezcMvcRequest $request, ezcMvcResult $result ); createResponseWriter( ezcMvcRoutingInformation $routeInfo, ezcMvcRequest $request, ezcMvcResult $result, ezcMvcResponse $response ); createFatalRedirectRequest( ezcMvcRequest $request, ezcMvcResult $result, Exception $e ); </example> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/ezc/mvc-dispatcher.xml?view=markup&rev=1.1 Index: presentations/slides/ezc/mvc-dispatcher.xml +++ presentations/slides/ezc/mvc-dispatcher.xml <?xml version="1.0" encoding="utf-8"?> <slide> <title>Dispatcher</title> <list> <bullet>Is responsible for the processing of the request</bullet> <bullet>Implements the %ezcMvcDispatcher% interface</bullet> <bullet>The current (and only) implementation right now is configured through a configuration object</bullet> <bullet>Configuration objects implement the %ezcMvcDispatcherConfiguration% interface</bullet> </list> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/ezc/mvc-filters.xml?view=markup&rev=1.1 Index: presentations/slides/ezc/mvc-filters.xml +++ presentations/slides/ezc/mvc-filters.xml <?xml version="1.0" encoding="utf-8"?> <slide> <title>Filters</title> <blurb>Can be run on four stages from the dispatcher:</blurb> <list> <bullet>Before the router with %runPreRoutingFilters()% to modify parsed request data to be able to select different routers.</bullet> <bullet>After the router has run, but before the controller has been selected with %runRequestFilters()% (example: password protecting parts of the site).</bullet> <bullet>After the controller/action has run, but before the view is applied with %runResultFilters()% (example: adding common variables to be used in views, such as INI settings).</bullet> <bullet>After the view has run, but before the request writer writes output with %runResponseFilters()% (example: gzipping HTTP content on the fly).</bullet> </list> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/ezc/mvc-login.xml?view=markup&rev=1.1 Index: presentations/slides/ezc/mvc-login.xml +++ presentations/slides/ezc/mvc-login.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>MvcTools Overview</title> <image align="center" filename="mvctools-overview.png"/> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/ezc/mvc-parts-overview.xml?view=markup&rev=1.1 Index: presentations/slides/ezc/mvc-parts-overview.xml +++ presentations/slides/ezc/mvc-parts-overview.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>MvcTools Overview</title> <image align="center" filename="mvctools-overview.png"/> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/ezc/mvc-request-example-http.xml?view=markup&rev=1.1 Index: presentations/slides/ezc/mvc-request-example-http.xml +++ presentations/slides/ezc/mvc-request-example-http.xml <?xml version="1.0" encoding="utf-8"?> <slide> <title>Request Parser Example</title> <subtitle>HTTP</subtitle> <blurb>Request:</blurb> <example><![CDATA[http://kossu/test/test.php GET /test/test.php HTTP/1.1 Host: kossu User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.6) Gecko/2009020407 Iceweasel/3.0.6 (Debian-3.0.6-1) FirePHP/0.2.4 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en,en-us;q=0.8,nb;q=0.5,nl;q=0.3 Accept-Encoding: gzip,deflate Accept-Charset: UTF-8,* Keep-Alive: 3000 Connection: keep-alive Cache-Control: max-age=0]]></example> <break/> <blurb>Generates:</blurb> <example><![CDATA[object(ezcMvcRequest)#2 (14) { ["date"]=> object(DateTime)#3 (3) { ["date"]=> string(19) "2009-03-03 08:55:50" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" } ["protocol"]=> string(8) "http-get" ["host"]=> string(5) "kossu" ["uri"]=> string(14) "/test/test.php" ["requestId"]=> string(19) "kossu/test/test.php" ["referrer"]=> NULL ["variables"]=> &array(0) { } ["body"]=> string(0) "" ["files"]=> NULL ["accept"]=> object(ezcMvcRequestAccept)#4 (4) { ["types"]=> array(4) { [0]=> string(9) "text/html" [1]=> string(21) "application/xhtml+xml" [2]=> string(15) "application/xml" [3]=> string(3) "*/*" } ["charsets"]=> array(2) { [0]=> string(5) "UTF-8" [1]=> string(1) "*" } ["languages"]=> array(4) { [0]=> string(2) "en" [1]=> string(5) "en-us" [2]=> string(2) "nb" [3]=> string(2) "nl" } ["encodings"]=> array(2) { [0]=> string(4) "gzip" [1]=> string(7) "deflate" } } ["agent"]=> object(ezcMvcRequestUserAgent)#5 (1) { ["agent"]=> string(117) "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.6) Gecko/2009020407 Iceweasel/3.0.6 (Debian-3.0.6-1) FirePHP/0.2.4" } ["authentication"]=> NULL ["raw"]=> &array(31) { } ["cookies"]=> array(0) { } } ]]></example> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/ezc/mvc-request-example-mail.xml?view=markup&rev=1.1 Index: presentations/slides/ezc/mvc-request-example-mail.xml +++ presentations/slides/ezc/mvc-request-example-mail.xml <?xml version="1.0" encoding="utf-8"?> <slide> <title>Request Parser Example</title> <subtitle>Mail</subtitle> <blurb>Request:</blurb> <example><![CDATA[Return-path: <SRS0=DbNu=XN=example.no=ts@example.net> Message-ID: <4869F84F.2060803@example.no> Date: Tue, 01 Jul 2008 11:26:39 +0200 From: Tobias Schlitt <ts@example.no> User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20041124 Thunderbird/0.9 Mnenhy/0.6.0.104 MIME-Version: 1.0 To: Derick Rethans <dr@example.no> Cc: Components <components@lists.example.no> Subject: Re: [Components] [Sdk-public] MmvTools requirements and design References: <alpine.DEB.0.98.0806251707220.16594@kossu.example.no> <48678AF4.7010908@example.no> <alpine.DEB.0.98.0806300846100.16594@kossu.example.no> <4868A272.2080800@example.no> <alpine.DEB.0.98.0806301153050.16594@kossu.example.no> <4868DFE3.5090001@example.no> <alpine.DEB.0.98.0807011003550.16594@kossu.example.no> In-Reply-To: <alpine.DEB.0.98.0807011003550.16594@kossu.example.no> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ze body ]]></example> <break/> <blurb>Generates:</blurb> <example><![CDATA[ezcMvcRequest::__set_state(array( 'date' => DateTime::__set_state(array( 'date' => '2008-07-01 09:26:39', 'timezone_type' => 1, 'timezone' => '+00:00', )), 'protocol' => 'mail', 'host' => 'example.no', 'uri' => 'dr', 'requestId' => 'example.no/dr', 'referrer' => 'alpine.DEB.0.98.0807011003550.16594@kossu.example.no', 'variables' => array ( 'fromAddress' => 'ts@example.no', 'fromName' => 'Tobias Schlitt', 'subject' => 'Re: [Components] [Sdk-public] MmvTools requirements and design', ), 'body' => 'Ze body ', 'files' => NULL, 'accept' => ezcMvcRequestAccept::__set_state(array( 'types' => array ( ), 'charsets' => array ( ), 'languages' => array ( ), 'encodings' => array ( ), )), 'agent' => ezcMvcRequestUserAgent::__set_state(array( 'agent' => 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20041124 Thunderbird/0.9 Mnenhy/0.6.0.104', )), 'authentication' => NULL, 'raw' => ezcMail::__set_state(array( ]]></example> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/ezc/mvc-request-parser.xml?view=markup&rev=1.1 Index: presentations/slides/ezc/mvc-request-parser.xml +++ presentations/slides/ezc/mvc-request-parser.xml <?xml version="1.0" encoding="utf-8"?> <slide> <title>Request Parser</title> <list> <bullet>Converts raw request data from a source to an abstracted %ezcMvcRequest% object.</bullet> <bullet>%ezcMvcHttpRequestParser% and %ezcMvcMailRequestParser%.</bullet> </list> <example>class ezcMvcRequest { public $date; // DateTime public $protocol; // string public $host; // string public $uri; // string public $requestId; // string public $referrer; // string public $variables; // array public $body; // string public $files; // array(ezcMvcRequestFile) public $accept; // ezcMvcRequestAccept public $agent; // ezcMvcRequestUserAgent public $authentication; // ezcMvcRequestAuthentication public $raw; // ezcMvcRawRequest public $cookies; // array(ezcMvcRequestCookie) }</example> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/ezc/mvc-response-writer.xml?view=markup&rev=1.1 Index: presentations/slides/ezc/mvc-response-writer.xml +++ presentations/slides/ezc/mvc-response-writer.xml <?xml version="1.0" encoding="utf-8"?> <slide> <title>Response Writer</title> <list> <bullet>Takes the abstract %ezcMvcResponse% object.</bullet> <bullet>Is transport-mechanism specific.</bullet> <bullet>Matches with request parsers.</bullet> <bullet>Currently only implement for HTTP as the %ezcMvcHttpResponseWriter%.</bullet> <bullet>Uses the abstract data to set HTTP headers/cookies.</bullet> <bullet>Supports a "status" object for HTTP redirections.</bullet> </list> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/ezc/mvc-router.xml?view=markup&rev=1.1 Index: presentations/slides/ezc/mvc-router.xml +++ presentations/slides/ezc/mvc-router.xml <?xml version="1.0" encoding="utf-8"?> <slide> <title>Router</title> <list> <bullet>Is configured by inheriting and reimplementing the %createRoutes()% method.</bullet> <bullet>The %createRoutes()% method returns an array of routes.</bullet> <bullet>Routes are objects of classes that implement the %ezcMvcRoute% interface: %ezcMvcRailsRoute% and %ezcMvcRegexpRoute%.</bullet> <bullet>Each route tests itself if it matches the request data, and returns an %ezcMvcRoutingInformation% object if it matched.</bullet> </list> <example>&lt;?php return array( new ezcMvcRailsRoute( '/', 'shareHomeController', 'list' ), new ezcMvcRailsRoute( '/updates', 'shareHomeController', 'list' ), new ezcMvcRailsRoute( '/update/:id', 'shareHomeController', 'show' ), new ezcMvcRailsRoute( '/view/:id', 'shareHomeController', 'show', array( 'id' => 1 ) ), new ezcMvcRegexpRoute( '@^people(/((?P&gt;nr>[0-9]+)|(?P&gt;name>.+)))?$@', 'testController', 'action', array( 'nr' => '', 'name' => '' ) ); ?></example> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/ezc/mvc-routing-information.xml?view=markup&rev=1.1 Index: presentations/slides/ezc/mvc-routing-information.xml +++ presentations/slides/ezc/mvc-routing-information.xml <?xml version="1.0" encoding="utf-8"?> <slide> <title>Routing Information</title> <list> <bullet>Is returned by the router if a route is found in the form of an %ezcMvcRoutingInformation% object.</bullet> </list> <example>&lt;?php class ezcMvcRoutingInformation extends ezcBaseStruct { public $matchedRoute; public $controllerClass; public $action; ?></example> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/ezc/mvc-view-handlers.xml?view=markup&rev=1.1 Index: presentations/slides/ezc/mvc-view-handlers.xml +++ presentations/slides/ezc/mvc-view-handlers.xml <?xml version="1.0" encoding="utf-8"?> <slide> <title>View Handler</title> <list> <bullet>Renders a zone with variables from the abstract output into an %ezcMvcResponse% object.</bullet> <bullet>Are implemented by inheriting from %ezcMvcViewHandler%.</bullet> <bullet>The result can be re-used in following zones.</bullet> <bullet>The last view handler's process() method is special.</bullet> </list> <break lines="2"/> <blurb>Available view handlers:</blurb> <list> <bullet>*ezcMvcJsonViewHandler*: renders result objects as JSON</bullet> <bullet>*ezcMvcPhpViewHandler*: uses PHP files to render result objects</bullet> <bullet>*ezcMvcTemplateViewHandler*: uses the template component to render result objects</bullet> <bullet>|777777|*ezcMvcFeedViewHandler*: uses XML feeds to render result objects|</bullet> </list> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/ezc/mvc-views.xml?view=markup&rev=1.1 Index: presentations/slides/ezc/mvc-views.xml +++ presentations/slides/ezc/mvc-views.xml <?xml version="1.0" encoding="utf-8"?> <slide> <title>Views</title> <list> <bullet>Render the abstract output into an %ezcMvcResponse% object.</bullet> <bullet>Are implemented by inheriting from %ezcMvcView%.</bullet> <bullet>Define zones with a view handler.</bullet> </list> <image align='center' filename='mvctools-zones.png'/> <break/> <example>&lt;?php class helloNameView extends ezcMvcView { function createZones( $layout ) { $zones = array(); $zones[] = new ezcMvcTemplateViewHandler( 'menu', 'menu.ezt' ); $zones[] = new ezcMvcPhpViewHandler( 'content', 'greeting.php' ); $zones[] = new ezcMvcTemplateViewHandler( 'page_layout', 'layout.ezt' ); return $zones; </example> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/ezc/mvctools-overview.svg?view=markup&rev=1.1 Index: presentations/slides/ezc/mvctools-overview.svg +++ presentations/slides/ezc/mvctools-overview.svg <?xml version="1.0" encoding="UTF-8" standalone="no"?> <!-- Created by diasvg.py --> <svg width="12.447cm" height="22.200cm" viewBox="4.000 0.400 16.447 22.600" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <rect x="4.200" y="3.000" width="8.541" height="16.941" fill="#959595" stroke="none" stroke-width="0"/> <path stroke="none" fill="#959595" d ="M 4.200,3.000 A 0.200,0.200 0 0,0 4.000,3.200 "/> <path stroke="none" fill="#959595" d ="M 12.941,3.200 A 0.200,0.200 0 0,0 12.741,3.000 "/> <rect x="4.000" y="3.200" width="8.941" height="16.541" fill="#959595" stroke="none" stroke-width="0"/> <path stroke="none" fill="#959595" d ="M 4.000,19.741 A 0.200,0.200 0 0,0 4.200,19.941 "/> <path stroke="none" fill="#959595" d ="M 12.741,19.941 A 0.200,0.200 0 0,0 12.941,19.741 "/> <line x1="4.200" y1="3.000" x2="12.741" y2="3.000" stroke="#000000" stroke-width="0.001" /> <line x1="4.200" y1="19.941" x2="12.741" y2="19.941" stroke="#000000" stroke-width="0.001" /> <path stroke="#000000" fill="none" stroke-width="0.001" d ="M 4.200,3.000 A 0.200,0.200 0 0,0 4.000,3.200 "/> <path stroke="#000000" fill="none" stroke-width="0.001" d ="M 12.941,3.200 A 0.200,0.200 0 0,0 12.741,3.000 "/> <line x1="4.000" y1="3.200" x2="4.000" y2="19.741" stroke="#000000" stroke-width="0.001" /> <line x1="12.941" y1="3.200" x2="12.941" y2="19.741" stroke="#000000" stroke-width="0.001" /> <path stroke="#000000" fill="none" stroke-width="0.001" d ="M 4.000,19.741 A 0.200,0.200 0 0,0 4.200,19.941 "/> <path stroke="#000000" fill="none" stroke-width="0.001" d ="M 12.741,19.941 A 0.200,0.200 0 0,0 12.941,19.741 "/> <line x1="11.500" y1="16.000" x2="11.500" y2="16.976" stroke="#0066FF" stroke-width="0.200" /> <polygon fill="#FFFFFF" stroke="none" stroke-width="0.200" points="11.350,16.976 11.500,17.276 11.650,16.976 "/> <polygon fill="none" stroke="#0066FF" stroke-width="0.200" points="11.350,16.976 11.500,17.276 11.650,16.976 "/> <line x1="9.500" y1="11.500" x2="9.500" y2="16.976" stroke="#00FF66" stroke-width="0.200" /> <polygon fill="#FFFFFF" stroke="none" stroke-width="0.200" points="9.350,16.976 9.500,17.276 9.650,16.976 "/> <polygon fill="none" stroke="#00FF66" stroke-width="0.200" points="9.350,16.976 9.500,17.276 9.650,16.976 "/> <line x1="7.500" y1="8.500" x2="7.500" y2="16.976" stroke="#CDFF00" stroke-width="0.200" /> <polygon fill="#FFFFFF" stroke="none" stroke-width="0.200" points="7.350,16.976 7.500,17.276 7.650,16.976 "/> <polygon fill="none" stroke="#CDFF00" stroke-width="0.200" points="7.350,16.976 7.500,17.276 7.650,16.976 "/> <line x1="5.500" y1="5.500" x2="5.500" y2="16.976" stroke="#FF0000" stroke-width="0.200" /> <polygon fill="#FFFFFF" stroke="none" stroke-width="0.200" points="5.350,16.976 5.500,17.276 5.650,16.976 "/> <polygon fill="none" stroke="#FF0000" stroke-width="0.200" points="5.350,16.976 5.500,17.276 5.650,16.976 "/> <rect x="4.700" y="3.500" width="7.600" height="2.000" fill="#FF3333" stroke="none" stroke-width="0"/> <path stroke="none" fill="#FF3333" d ="M 4.700,3.500 A 0.200,0.200 0 0,0 4.500,3.700 "/> <path stroke="none" fill="#FF3333" d ="M 12.500,3.700 A 0.200,0.200 0 0,0 12.300,3.500 "/> <rect x="4.500" y="3.700" width="8.000" height="1.600" fill="#FF3333" stroke="none" stroke-width="0"/> <path stroke="none" fill="#FF3333" d ="M 4.500,5.300 A 0.200,0.200 0 0,0 4.700,5.500 "/> <path stroke="none" fill="#FF3333" d ="M 12.300,5.500 A 0.200,0.200 0 0,0 12.500,5.300 "/> <line x1="4.700" y1="3.500" x2="12.300" y2="3.500" stroke="#000000" stroke-width="0.001" /> <line x1="4.700" y1="5.500" x2="12.300" y2="5.500" stroke="#000000" stroke-width="0.001" /> <path stroke="#000000" fill="none" stroke-width="0.001" d ="M 4.700,3.500 A 0.200,0.200 0 0,0 4.500,3.700 "/> <path stroke="#000000" fill="none" stroke-width="0.001" d ="M 12.500,3.700 A 0.200,0.200 0 0,0 12.300,3.500 "/> <line x1="4.500" y1="3.700" x2="4.500" y2="5.300" stroke="#000000" stroke-width="0.001" /> <line x1="12.500" y1="3.700" x2="12.500" y2="5.300" stroke="#000000" stroke-width="0.001" /> <path stroke="#000000" fill="none" stroke-width="0.001" d ="M 4.500,5.300 A 0.200,0.200 0 0,0 4.700,5.500 "/> <path stroke="#000000" fill="none" stroke-width="0.001" d ="M 12.300,5.500 A 0.200,0.200 0 0,0 12.500,5.300 "/> <text x="6.312" y="4.643" fill="#000000" text-anchor="start" font-size="0.80" font-family="sans" font-style="normal" font-weight="400"> Request Parser</text> <rect x="4.700" y="7.000" width="7.600" height="2.000" fill="#D7FF33" stroke="none" stroke-width="0"/> <path stroke="none" fill="#D7FF33" d ="M 4.700,7.000 A 0.200,0.200 0 0,0 4.500,7.200 "/> <path stroke="none" fill="#D7FF33" d ="M 12.500,7.200 A 0.200,0.200 0 0,0 12.300,7.000 "/> <rect x="4.500" y="7.200" width="8.000" height="1.600" fill="#D7FF33" stroke="none" stroke-width="0"/> <path stroke="none" fill="#D7FF33" d ="M 4.500,8.800 A 0.200,0.200 0 0,0 4.700,9.000 "/> <path stroke="none" fill="#D7FF33" d ="M 12.300,9.000 A 0.200,0.200 0 0,0 12.500,8.800 "/> <line x1="4.700" y1="7.000" x2="12.300" y2="7.000" stroke="#000000" stroke-width="0.001" /> <line x1="4.700" y1="9.000" x2="12.300" y2="9.000" stroke="#000000" stroke-width="0.001" /> <path stroke="#000000" fill="none" stroke-width="0.001" d ="M 4.700,7.000 A 0.200,0.200 0 0,0 4.500,7.200 "/> <path stroke="#000000" fill="none" stroke-width="0.001" d ="M 12.500,7.200 A 0.200,0.200 0 0,0 12.300,7.000 "/> <line x1="4.500" y1="7.200" x2="4.500" y2="8.800" stroke="#000000" stroke-width="0.001" /> <line x1="12.500" y1="7.200" x2="12.500" y2="8.800" stroke="#000000" stroke-width="0.001" /> <path stroke="#000000" fill="none" stroke-width="0.001" d ="M 4.500,8.800 A 0.200,0.200 0 0,0 4.700,9.000 "/> <path stroke="#000000" fill="none" stroke-width="0.001" d ="M 12.300,9.000 A 0.200,0.200 0 0,0 12.500,8.800 "/> <text x="7.534" y="8.143" fill="#000000" text-anchor="start" font-size="0.80" font-family="sans" font-style="normal" font-weight="400"> Router</text> <rect x="4.700" y="10.500" width="7.600" height="2.000" fill="#33FF85" stroke="none" stroke-width="0"/> <path stroke="none" fill="#33FF85" d ="M 4.700,10.500 A 0.200,0.200 0 0,0 4.500,10.700 "/> <path stroke="none" fill="#33FF85" d ="M 12.500,10.700 A 0.200,0.200 0 0,0 12.300,10.500 "/> <rect x="4.500" y="10.700" width="8.000" height="1.600" fill="#33FF85" stroke="none" stroke-width="0"/> <path stroke="none" fill="#33FF85" d ="M 4.500,12.300 A 0.200,0.200 0 0,0 4.700,12.500 "/> <path stroke="none" fill="#33FF85" d ="M 12.300,12.500 A 0.200,0.200 0 0,0 12.500,12.300 "/> <line x1="4.700" y1="10.500" x2="12.300" y2="10.500" stroke="#000000" stroke-width="0.001" /> <line x1="4.700" y1="12.500" x2="12.300" y2="12.500" stroke="#000000" stroke-width="0.001" /> <path stroke="#000000" fill="none" stroke-width="0.001" d ="M 4.700,10.500 A 0.200,0.200 0 0,0 4.500,10.700 "/> <path stroke="#000000" fill="none" stroke-width="0.001" d ="M 12.500,10.700 A 0.200,0.200 0 0,0 12.300,10.500 "/> <line x1="4.500" y1="10.700" x2="4.500" y2="12.300" stroke="#000000" stroke-width="0.001" /> <line x1="12.500" y1="10.700" x2="12.500" y2="12.300" stroke="#000000" stroke-width="0.001" /> <path stroke="#000000" fill="none" stroke-width="0.001" d ="M 4.500,12.300 A 0.200,0.200 0 0,0 4.700,12.500 "/> <path stroke="#000000" fill="none" stroke-width="0.001" d ="M 12.300,12.500 A 0.200,0.200 0 0,0 12.500,12.300 "/> <text x="7.065" y="11.643" fill="#000000" text-anchor="start" font-size="0.80" font-family="sans" font-style="normal" font-weight="400"> Controller</text> <rect x="4.700" y="14.000" width="7.600" height="2.000" fill="#3385FF" stroke="none" stroke-width="0"/> <path stroke="none" fill="#3385FF" d ="M 4.700,14.000 A 0.200,0.200 0 0,0 4.500,14.200 "/> <path stroke="none" fill="#3385FF" d ="M 12.500,14.200 A 0.200,0.200 0 0,0 12.300,14.000 "/> <rect x="4.500" y="14.200" width="8.000" height="1.600" fill="#3385FF" stroke="none" stroke-width="0"/> <path stroke="none" fill="#3385FF" d ="M 4.500,15.800 A 0.200,0.200 0 0,0 4.700,16.000 "/> <path stroke="none" fill="#3385FF" d ="M 12.300,16.000 A 0.200,0.200 0 0,0 12.500,15.800 "/> <line x1="4.700" y1="14.000" x2="12.300" y2="14.000" stroke="#000000" stroke-width="0.001" /> <line x1="4.700" y1="16.000" x2="12.300" y2="16.000" stroke="#000000" stroke-width="0.001" /> <path stroke="#000000" fill="none" stroke-width="0.001" d ="M 4.700,14.000 A 0.200,0.200 0 0,0 4.500,14.200 "/> <path stroke="#000000" fill="none" stroke-width="0.001" d ="M 12.500,14.200 A 0.200,0.200 0 0,0 12.300,14.000 "/> <line x1="4.500" y1="14.200" x2="4.500" y2="15.800" stroke="#000000" stroke-width="0.001" /> <line x1="12.500" y1="14.200" x2="12.500" y2="15.800" stroke="#000000" stroke-width="0.001" /> <path stroke="#000000" fill="none" stroke-width="0.001" d ="M 4.500,15.800 A 0.200,0.200 0 0,0 4.700,16.000 "/> <path stroke="#000000" fill="none" stroke-width="0.001" d ="M 12.300,16.000 A 0.200,0.200 0 0,0 12.500,15.800 "/> <text x="7.809" y="15.143" fill="#000000" text-anchor="start" font-size="0.80" font-family="sans" font-style="normal" font-weight="400"> View</text> <rect x="4.700" y="17.500" width="7.600" height="2.000" fill="#D733FF" stroke="none" stroke-width="0"/> <path stroke="none" fill="#D733FF" d ="M 4.700,17.500 A 0.200,0.200 0 0,0 4.500,17.700 "/> <path stroke="none" fill="#D733FF" d ="M 12.500,17.700 A 0.200,0.200 0 0,0 12.300,17.500 "/> <rect x="4.500" y="17.700" width="8.000" height="1.600" fill="#D733FF" stroke="none" stroke-width="0"/> <path stroke="none" fill="#D733FF" d ="M 4.500,19.300 A 0.200,0.200 0 0,0 4.700,19.500 "/> <path stroke="none" fill="#D733FF" d ="M 12.300,19.500 A 0.200,0.200 0 0,0 12.500,19.300 "/> <line x1="4.700" y1="17.500" x2="12.300" y2="17.500" stroke="#000000" stroke-width="0.001" /> <line x1="4.700" y1="19.500" x2="12.300" y2="19.500" stroke="#000000" stroke-width="0.001" /> <path stroke="#000000" fill="none" stroke-width="0.001" d ="M 4.700,17.500 A 0.200,0.200 0 0,0 4.500,17.700 "/> <path stroke="#000000" fill="none" stroke-width="0.001" d ="M 12.500,17.700 A 0.200,0.200 0 0,0 12.300,17.500 "/> <line x1="4.500" y1="17.700" x2="4.500" y2="19.300" stroke="#000000" stroke-width="0.001" /> <line x1="12.500" y1="17.700" x2="12.500" y2="19.300" stroke="#000000" stroke-width="0.001" /> <path stroke="#000000" fill="none" stroke-width="0.001" d ="M 4.500,19.300 A 0.200,0.200 0 0,0 4.700,19.500 "/> <path stroke="#000000" fill="none" stroke-width="0.001" d ="M 12.300,19.500 A 0.200,0.200 0 0,0 12.500,19.300 "/> <text x="6.120" y="18.642" fill="#000000" text-anchor="start" font-size="0.80" font-family="sans" font-style="normal" font-weight="400"> Response Writer</text> <line x1="8.500" y1="0.500" x2="8.500" y2="2.976" stroke="#000000" stroke-width="0.200" /> <polygon fill="#FFFFFF" stroke="none" stroke-width="0.200" points="8.350,2.976 8.500,3.276 8.650,2.976 "/> <polygon fill="none" stroke="#000000" stroke-width="0.200" points="8.350,2.976 8.500,3.276 8.650,2.976 "/> <line x1="8.500" y1="19.500" x2="8.500" y2="21.976" stroke="#000000" stroke-width="0.200" /> <polygon fill="#FFFFFF" stroke="none" stroke-width="0.200" points="8.350,21.976 8.500,22.276 8.650,21.976 "/> <polygon fill="none" stroke="#000000" stroke-width="0.200" points="8.350,21.976 8.500,22.276 8.650,21.976 "/> <text x="5.500" y="6.500" fill="#000000" text-anchor="start" font-size="0.80" font-family="sans" font-style="normal" font-weight="400"> ezcMvcRequest</text> <text x="7.500" y="10.000" fill="#000000" text-anchor="start" font-size="0.80" font-family="sans" font-style="normal" font-weight="400"> ezcMvcRoutingInformation</text> <text x="9.500" y="13.500" fill="#000000" text-anchor="start" font-size="0.80" font-family="sans" font-style="normal" font-weight="400"> ezcMvcResult</text> <text x="11.500" y="17.000" fill="#000000" text-anchor="start" font-size="0.80" font-family="sans" font-style="normal" font-weight="400"> ezcMvcResponse</text> </svg> http://cvs.php.net/viewvc.cgi/presentations/slides/ezc/new-2008.2.xml?view=markup&rev=1.1 Index: presentations/slides/ezc/new-2008.2.xml +++ presentations/slides/ezc/new-2008.2.xml <?xml version="1.0" encoding="iso-8859-1"?> <slide> <title>Additions for eZ Components 2008.2</title> <blurb>New components:</blurb> <list> <bullet>*MvcTools*: Light weight MVC layer with Tieins</bullet> </list> <blurb>Additions to components:</blurb> <list> <bullet>*Document*: Support for many more formats</bullet> <bullet>*Webdav*: Support for authentication and locking</bullet> </list> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/ezc/onr-autoload.xml?view=markup&rev=1.1 Index: presentations/slides/ezc/onr-autoload.xml +++ presentations/slides/ezc/onr-autoload.xml <?xml version="1.0" encoding="utf-8"?> <slide> <title>Step 1: The home controller and view</title> <subtitle>Autoload file and router</subtitle> <blurb>%lib/autoload/autoload.php%:</blurb> <example><![CDATA[<?php return array( 'onrMvcConfiguration' => 'config.php', 'onrRouter' => 'router.php', 'onrHomeController' => 'controllers/home.php', 'onrView' => 'views/main.php', ); ?>]]></example> <break lines="2"/> <blurb>%lib/router.php%:</blurb> <example><![CDATA[<?php class onrRouter extends ezcMvcRouter { public function createRoutes() { return array( new ezcMvcRailsRoute( '/', 'onrHomeController', 'list' ), ); } } ?>]]></example> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/ezc/onr-config.xml?view=markup&rev=1.1 Index: presentations/slides/ezc/onr-config.xml +++ presentations/slides/ezc/onr-config.xml <?xml version="1.0" encoding="utf-8"?> <slide> <title>Setting-Up</title> <subtitle>Configuration file, and index.php</subtitle> <blurb>%config.php%:</blurb> <example><![CDATA[<?php ini_set( 'include_path', '/home/derick/dev/ezcomponents/trunk:.' ); require 'Base/src/ezc_bootstrap.php'; ezcDbInstance::set( ezcDbFactory::create( 'sqlite://'. dirname( __FILE__ ) . '/omnomr.sqlite' ) ); ezcBase::addClassRepository( dirname( __FILE__ ) . '/lib', null, 'onr' ); $tc = ezcTemplateConfiguration::getInstance(); $tc->templatePath = dirname( __FILE__ ) . '/templates'; $tc->compilePath = dirname( __FILE__ ) . '/cache'; ?>]]></example> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/ezc/onr-configuration1.xml?view=markup&rev=1.1 Index: presentations/slides/ezc/onr-configuration1.xml +++ presentations/slides/ezc/onr-configuration1.xml <?xml version="1.0" encoding="utf-8"?> <slide> <title>Step 1: The home controller and view</title> <subtitle>Dispatcher configuration</subtitle> <blurb>%config.php%:</blurb> <example class="code_large"><![CDATA[<?php class onrMvcConfiguration implements ezcMvcDispatcherConfiguration { function createRequestParser() { return new ezcMvcHttpRequestParser; } function createRouter( ezcMvcRequest $request ) { return new onrRouter( $request ); } function runPreRoutingFilters( ezcMvcRequest $request ) { } function runRequestFilters( ezcMvcRoutingInformation $routeInfo, ezcMvcRequest $request ) { } function runResultFilters( ezcMvcRoutingInformation $routeInfo, ezcMvcRequest $request, ezcMvcResult $result ) { } function runResponseFilters( ezcMvcRoutingInformation $routeInfo, ezcMvcRequest $request, ezcMvcResult $result, ezcMvcResponse $response ) { } function createView( ezcMvcRoutingInformation $routeInfo, ezcMvcRequest $request, ezcMvcResult $result ) { switch ( $routeInfo->matchedRoute ) { case '/': $view->contentTemplate = 'home.ezt'; break; } return $view; } function createResponseWriter( ezcMvcRoutingInformation $routeInfo, ezcMvcRequest $request, ezcMvcResult $result, ezcMvcResponse $response ) { return new ezcMvcHttpResponseWriter( $response ); } function createFatalRedirectRequest(ezcMvcRequest $request, ezcMvcResult $result, Exception $response ) { $req = clone $request; $req->uri = '/fatal'; $req->variables['message'] = $response->getMessage(); return $req; } } ?>]]></example> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/ezc/onr-database-scheme.xml?view=markup&rev=1.1 Index: presentations/slides/ezc/onr-database-scheme.xml +++ presentations/slides/ezc/onr-database-scheme.xml <?xml version="1.0" encoding="utf-8"?> <slide> <title>Setting-Up</title> <subtitle>Database Schema</subtitle> <blurb>%sqlite3 omnomr.sqlite%</blurb> <example><![CDATA[CREATE TABLE comments ( id INTEGER PRIMARY KEY AUTOINCREMENT, user_id INT NOT NULL, recipe_id INT NOT NULL, comment TEXT); CREATE TABLE ingredient ( id INTEGER PRIMARY KEY AUTOINCREMENT, name VARCHAR(128) NOT NULL, form VARCHAR(128), notes TEXT); CREATE TABLE recipe ( id INTEGER PRIMARY KEY AUTOINCREMENT, user_id INT NOT NULL, name VARCHAR(250) NOT NULL, time_prep FLOAT, time_cook FLOAT, portions INT NOT NULL, description TEXT NOT NULL, photo_id INT); CREATE TABLE recipe_ingredient ( recipe_id INT NOT NULL, ingredient_id INT NOT NULL, count INT NOT NULL, unit_id INT NOT NULL); CREATE TABLE unit ( id INTEGER PRIMARY KEY AUTOINCREMENT, name_single VARCHAR(64) NOT NULL, name_plural VARCHAR(64) NOT NULL); CREATE TABLE user ( id INTEGER PRIMARY KEY AUTOINCREMENT, email VARCHAR(250), name VARCHAR(128), password CHAR(40)); INSERT INTO unit(name_single, name_plural) VALUES('cup', 'cups'); INSERT INTO unit(name_single, name_plural) VALUES('tsp', 'tsps'); INSERT INTO unit(name_single, name_plural) VALUES('tbsp', 'tbsps'); INSERT INTO unit(name_single, name_plural) VALUES('piece', 'pieces'); INSERT INTO unit(name_single, name_plural) VALUES('kg', 'kg'); INSERT INTO unit(name_single, name_plural) VALUES('dl', 'dl'); INSERT INTO unit(name_single, name_plural) VALUES('ounce', 'ounces'); INSERT INTO unit(name_single, name_plural) VALUES('pound', 'pounds');]]></example> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/ezc/onr-dirs.xml?view=markup&rev=1.1 Index: presentations/slides/ezc/onr-dirs.xml +++ presentations/slides/ezc/onr-dirs.xml <?xml version="1.0" encoding="utf-8"?> <slide> <title>Setting-Up</title> <subtitle>Directory Structure</subtitle> <example># directories: mkdir OmNomR cd OmNomR mkdir cache mkdir cache/compiled_templates mkdir lib mkdir lib/autoload mkdir lib/controllers mkdir lib/views mkdir templates mkdir www mkdir www/stylesheets # permissions: chgrp nogroup cache/compiled_templates chmod g+w cache/compiled_templates</example> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/ezc/onr-home-controller1.xml?view=markup&rev=1.1 Index: presentations/slides/ezc/onr-home-controller1.xml +++ presentations/slides/ezc/onr-home-controller1.xml <?xml version="1.0" encoding="utf-8"?> <slide> <title>Step 1: The home controller and view</title> <subtitle>Controller</subtitle> <blurb>%lib/controllers/home.php%:</blurb> <example class="code_large"><![CDATA[<?php class onrHomeController extends ezcMvcController { public function doList() { $res = new ezcMvcResult(); return $res; } } ?>]]></example> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/ezc/onr-index-config.xml?view=markup&rev=1.1 Index: presentations/slides/ezc/onr-index-config.xml +++ presentations/slides/ezc/onr-index-config.xml <?xml version="1.0" encoding="utf-8"?> <slide> <title>Setting-Up</title> <subtitle>Configuration file, and index.php</subtitle> <blurb>%config.php%:</blurb> <example><![CDATA[<?php ini_set( 'include_path', '/home/derick/dev/ezcomponents/trunk:.' ); require 'Base/src/ezc_bootstrap.php'; ezcDbInstance::set( ezcDbFactory::create( 'sqlite://'. dirname( __FILE__ ) . '/omnomr.sqlite' ) ); ezcBase::addClassRepository( dirname( __FILE__ ) . '/lib', null, 'onr' ); $tc = ezcTemplateConfiguration::getInstance(); $tc->templatePath = dirname( __FILE__ ) . '/templates'; $tc->compilePath = dirname( __FILE__ ) . '/cache'; ?>]]></example> <blurb>%www/index.php%:</blurb> <example><![CDATA[<?php include '../config.php'; $config = new onrMvcConfiguration( $ini ); $dispatcher = new ezcMvcConfigurableDispatcher( $config ); $dispatcher->run(); ?>]]></example> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/ezc/onr-index-htaccess.xml?view=markup&rev=1.1 Index: presentations/slides/ezc/onr-index-htaccess.xml +++ presentations/slides/ezc/onr-index-htaccess.xml <?xml version="1.0" encoding="utf-8"?> <slide> <title>Setting-Up</title> <subtitle>index.php and mod_rewrite config</subtitle> <blurb>%www/index.php%:</blurb> <example><![CDATA[<?php include '../config.php'; $config = new onrMvcConfiguration(); $dispatcher = new ezcMvcConfigurableDispatcher( $config ); $dispatcher->run(); ?>]]></example> <break lines="2"/> <blurb>%www/.htaccess%:</blurb> <example><![CDATA[RewriteEngine On RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l RewriteRule ^.*$ - [NC,L] RewriteRule ^.*$ index.php [NC,L] ErrorDocument 404 /error/404 php_value session.gc_maxlifetime 864000]]></example> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/ezc/onr-intro.xml?view=markup&rev=1.1 Index: presentations/slides/ezc/onr-intro.xml +++ presentations/slides/ezc/onr-intro.xml <?xml version="1.0" encoding="utf-8"?> <slide> <title>OmNomR</title> <subtitle>Recipe Sharing</subtitle> <list> <bullet>*Authentication*: User registration</bullet> <bullet>*Database*: Storing the recipes</bullet> <bullet>*Document*: Displayed the wiki-formatted recipes as XHTML</bullet> <bullet>*Feed*: New recipes</bullet> <bullet>*MvcTools*: Application layout</bullet> <bullet>*Template*: Application templates</bullet> </list> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/ezc/onr-main-view.xml?view=markup&rev=1.1 Index: presentations/slides/ezc/onr-main-view.xml +++ presentations/slides/ezc/onr-main-view.xml <?xml version="1.0" encoding="utf-8"?> <slide> <title>Step 1: The home controller and view</title> <subtitle>View zones configuration</subtitle> <blurb>%lib/views/main.php%:</blurb> <example><![CDATA[<?php class onrView extends ezcMvcView { public $contentTemplate; function createZones( $layout ) { $zones = array(); $zones[] = new ezcMvcTemplateViewHandler( 'content', $this->contentTemplate ); $zones[] = new ezcMvcTemplateViewHandler( 'page_layout', 'main.ezt' ); return $zones; } } ?>]]></example> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/ezc/onr-step2-action-login-logout.xml?view=markup&rev=1.1 Index: presentations/slides/ezc/onr-step2-action-login-logout.xml +++ presentations/slides/ezc/onr-step2-action-login-logout.xml <?xml version="1.0" encoding="utf-8"?> <slide> <title>Step 2: Adding authentication</title> <subtitle>Adding actions: login and logout</subtitle> <blurb>%lib/controllers/auth.php%:</blurb> <example><![CDATA[<?php class onrAuthController extends ezcMvcController { public function doLogin() { // obtain credentials from POST $email = isset( $_POST['email'] ) ? $_POST['email'] : null; $password = isset( $_POST['password'] ) ? $_POST['password'] : null; $redirUrl = isset( $_POST['redirUrl'] ) ? $_POST['redirUrl'] : '/'; $database = new ezcAuthenticationDatabaseInfo( ezcDbInstance::get(), 'user', array( 'email', 'password' ) ); $databaseFilter = new ezcAuthenticationDatabaseFilter( $database ); $options = new ezcAuthenticationSessionOptions(); $options->validity = 86400; $session = new ezcAuthenticationSession( $options ); $session->start(); // use the options object when creating a new Session object $credentials = new ezcAuthenticationPasswordCredentials( $email, md5( $password ) ); $authentication = new ezcAuthentication( $credentials ); $authentication->session = $session; $authentication->addFilter( $databaseFilter ); if ( !$authentication->run() ) { $request = clone $this->request; $status = $authentication->getStatus(); $request->variables['redirUrl'] = $redirUrl; $request->variables['reasons'] = $status; $request->uri = '/login-required'; return new ezcMvcInternalRedirect( $request ); } $res = new ezcMvcResult; $res->status = new ezcMvcExternalRedirect( $redirUrl ); return $res; } public function doLogout() { $options = new ezcAuthenticationSessionOptions(); $options->validity = 86400; $session = new ezcAuthenticationSession( $options ); $session->start(); $session->destroy(); $res = new ezcMvcResult; $res->status = new ezcMvcExternalRedirect( '/' ); return $res; } } ?>]]></example> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/ezc/onr-step2-action-login-required.xml?view=markup&rev=1.1 Index: presentations/slides/ezc/onr-step2-action-login-required.xml +++ presentations/slides/ezc/onr-step2-action-login-required.xml <?xml version="1.0" encoding="utf-8"?> <slide> <title>Step 2: Adding authentication</title> <subtitle>Adding actions: login-required</subtitle> <blurb>%lib/controllers/auth.php%:</blurb> <example><![CDATA[<?php class onrAuthController extends ezcMvcController { public function doLoginRequired() { $res = new ezcMvcResult; $res->variables['redirUrl'] = $this->redirUrl; $err = array( 'ezcAuthenticationDatabaseFilter' => array( ezcAuthenticationHtpasswdFilter::STATUS_USERNAME_INCORRECT => 'Incorrect or no credentials provided.', ezcAuthenticationHtpasswdFilter::STATUS_PASSWORD_INCORRECT => 'Incorrect or no credentials provided.' ), 'ezcAuthenticationSession' => array( ezcAuthenticationSession::STATUS_EMPTY => 'No session', ezcAuthenticationSession::STATUS_EXPIRED => 'Session expired' ), 'logout' => array( 1 => 'You logged out', ) ); $reasonText = array(); $reasons = $this->reasons; foreach ( $reasons as $line ) { list( $key, $value ) = each( $line ); $reasonText[] = $err[$key][$value]; } $res->variables['reasons'] = $reasonText; $res->variables['redirUrl'] = $this->redirUrl; return $res; } } ?>]]></example> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/ezc/onr-step2-action-register-submit.xml?view=markup&rev=1.1 Index: presentations/slides/ezc/onr-step2-action-register-submit.xml +++ presentations/slides/ezc/onr-step2-action-register-submit.xml <?xml version="1.0" encoding="utf-8"?> <slide> <title>Step 2: Adding authentication</title> <subtitle>Adding actions: register and register-submit</subtitle> <blurb>%lib/controllers/auth.php%:</blurb> <example><![CDATA[<?php class onrAuthController extends ezcMvcController { public function doRegister() { $res = new ezcMvcResult; return $res; } public function doRegisterSubmit() { $res = new ezcMvcResult; if ( isset( $this->reg ) ) { $res->variables['success'] = self::register( $message ); $res->variables['message'] = $message; } return $res; } private static function register( &$message ) { $db = ezcDbInstance::get(); $email = substr( preg_replace( '/[^a-z0-9.@]/', '', $_POST['email'] ), 0, 32 ); $fullname= ucwords( strtolower( preg_replace( '/[^a-zæøå0-9 ]/ui', '', $_POST['fullname'] ) ) ); // check if the user already exists. $q = $db->createSelectQuery(); $q->select( 'email' )->from( 'user' )->where( $q->expr->eq( 'email', $q->bindValue( $email ) ) ); $s = $q->prepare(); $s->execute(); $r = $s->fetchAll(); if ( count( $r ) > 0 ) { $message = "A user with e-mail address '{$email}' already exists."; return false; } // generate password mt_srand( base_convert( substr( md5( $email ), 0, 6 ), 36, 10 ) * microtime( true ) ); $a = base_convert( mt_rand(), 10, 36 ); $b = base_convert( mt_rand(), 10, 36 ); $password = substr( $b . $a, 1, 8 ); // create user $q = $db->createInsertQuery(); $q->insertInto( 'user' ) ->set( 'email', $q->bindValue( $email ) ) ->set( 'password', $q->bindValue( md5( $password ) ) ) ->set( 'name', $q->bindValue( $fullname ) ); $s = $q->prepare(); $s->execute(); $fromAddress = 'noreply@dev.omnomr'; $url = 'dev.omnomr'; // send registration mail $m = new ezcMailComposer; $m->from = new ezcMailAddress( $fromAddress, 'OmNomR' ); $m->addTo( new ezcMailAddress( $email, $fullname ) ); $m->subject = 'Registration for OmNomR'; $m->plainText = <<<ENDT Hello! We've created a user account. Your password is: {$password} You can now login at http://$url. Please change your password to something you want it to be. regards, OnNomR ENDT; $m->build(); $s = new ezcMailMtaTransport(); $s->send( $m ); $message = "A user account has been created, see your mail to find further instructions."; return true; } ?>]]></example> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/ezc/onr-step2-auth-overview.xml?view=markup&rev=1.1 Index: presentations/slides/ezc/onr-step2-auth-overview.xml +++ presentations/slides/ezc/onr-step2-auth-overview.xml <?xml version="1.0" encoding="utf-8"?> <slide> <title>Step 2: Adding authentication</title> <subtitle>Overview</subtitle> <list> <bullet>Prevent access to content with a request filter.</bullet> <bullet>Request filter runs after the router has selected a router with controller and action.</bullet> <bullet>Make sure that we do not limit access to the authentication pages and register pages.</bullet> </list> <blurb>Implement:</blurb> <list> <bullet>The new routes to the router.</bullet> <bullet>The onrAuthController class to the autoload file.</bullet> <bullet>The filter logic in the configuration object.</bullet> <bullet>Template views to configuration object.</bullet> <bullet>Templates</bullet> <bullet>A "login required" action which a user gets redirected too.</bullet> <bullet>A "login" and "logout" action.</bullet> <bullet>A "register" and "register submit" action.</bullet> </list> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/ezc/onr-step2-configuration.xml?view=markup&rev=1.1 Index: presentations/slides/ezc/onr-step2-configuration.xml +++ presentations/slides/ezc/onr-step2-configuration.xml <?xml version="1.0" encoding="utf-8"?> <slide> <title>Step 2: Adding authentication</title> <subtitle>Setting up the filter logic</subtitle> <blurb>%lib/config.php%:</blurb> <example><![CDATA[<?php function runRequestFilters( ezcMvcRoutingInformation $routeInfo, ezcMvcRequest $request ) { switch ( $routeInfo->matchedRoute ) { case '/': return $this->runAuthCheckLoggedIn( $request ); break; case '/register/submit': case '/register': case '/login-required': case '/login': case '/logout': case '/fatal': break; default: return $this->runAuthRequiredFilter( $request ); } } private function doAuthCheck( $request ) { $database = new ezcAuthenticationDatabaseInfo( ezcDbInstance::get(), 'user', array( 'email', 'password' ) ); $databaseFilter = new ezcAuthenticationDatabaseFilter( $database ); // use the options object when creating a new Session object $options = new ezcAuthenticationSessionOptions(); $options->validity = 86400; $session = new ezcAuthenticationSession( $options ); $session->start(); $user = $session->load(); $password = null; $loginWithForm = true; $credentials = new ezcAuthenticationPasswordCredentials( $user, md5( $password ) ); $authentication = new ezcAuthentication( $credentials ); $authentication->session = $session; $authentication->addFilter( $databaseFilter ); return $authentication; } private function fetchUserName() { if ( isset( $_SESSION['ezcAuth_id'] ) ) { $q = ezcDbInstance::get()->createSelectQuery(); $q->select( '*' ) ->from( 'user' ) ->where( $q->expr->eq( 'email', $q->bindValue( $_SESSION['ezcAuth_id'] ) ) ); $s = $q->prepare(); $s->execute(); $r = $s->fetchAll(); return $r[0]['name']; } return null; } private function runAuthCheckLoggedIn( $request ) { $auth = self::doAuthCheck( $request ); $auth->run(); $request->variables['user'] = self::fetchUserName(); } private function runAuthRequiredFilter( $request ) { $auth = self::doAuthCheck( $request ); if ( !$auth->run() ) { $status = $auth->getStatus(); $request->variables['redirUrl'] = $request->uri; $request->variables['reasons'] = $status; $request->uri = '/login-required'; return new ezcMvcInternalRedirect( $request ); } $request->variables['user'] = self::fetchUserName(); } function runResultFilters( ezcMvcRoutingInformation $routeInfo, ezcMvcRequest $request, ezcMvcResult $result ) { $result->variables['user'] = isset( $request->variables['user'] ) ? $request->variables['user'] : 'Anonymous'; } ]]></example> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/ezc/onr-step2-overview.xml?view=markup&rev=1.1 Index: presentations/slides/ezc/onr-step2-overview.xml +++ presentations/slides/ezc/onr-step2-overview.xml <?xml version="1.0" encoding="utf-8"?> <slide fontsize="6em"> <title>Step 2: Adding authentication</title> <subtitle>Diagram</subtitle> <break lines="3"/> <image align="center" filename="mvctools-login.png"/> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/ezc/onr-step2-result.xml?view=markup&rev=1.1 Index: presentations/slides/ezc/onr-step2-result.xml +++ presentations/slides/ezc/onr-step2-result.xml <?xml version="1.0" encoding="utf-8"?> <slide> <title>Step 2: Adding authentication</title> <subtitle>Viewing recipes</subtitle> <image align="center" filename="onr-step2.jpg"/> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/ezc/onr-step2-routes-autoload.xml?view=markup&rev=1.1 Index: presentations/slides/ezc/onr-step2-routes-autoload.xml +++ presentations/slides/ezc/onr-step2-routes-autoload.xml <?xml version="1.0" encoding="utf-8"?> <slide> <title>Step 2: Adding authentication</title> <subtitle>New routes and autoload entries</subtitle> <blurb>%lib/router.php%:</blurb> <example><![CDATA[<?php class onrRouter extends ezcMvcRouter { public function createRoutes() { return array( // Authentication new ezcMvcRailsRoute( '/register/submit', 'onrAuthController', 'register-sub' ), new ezcMvcRailsRoute( '/register', 'onrAuthController', 'register' ), new ezcMvcRailsRoute( '/login-required', 'onrAuthController', 'login-required' ), new ezcMvcRailsRoute( '/login', 'onrAuthController', 'login' ), new ezcMvcRailsRoute( '/logout', 'onrAuthController', 'logout' ), ); } }]]></example> <blurb>%lib/autoload/autoload.php%:</blurb> <example><![CDATA[<?php return array( 'onrAuthController' => 'controllers/auth.php', ); ?>]]></example> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/ezc/onr-step2-template.xml?view=markup&rev=1.1 Index: presentations/slides/ezc/onr-step2-template.xml +++ presentations/slides/ezc/onr-step2-template.xml <?xml version="1.0" encoding="utf-8"?> <slide> <title>Step 2: Adding authentication</title> <subtitle>Adding view templates</subtitle> <blurb>%templates/login.ezt%:</blurb> <example><![CDATA[{use $redirUrl, $reasons} <h1>Login</h1> <div class="login"> <p> You are not logged in, because: </p> <ul> {foreach $reasons as $reason} <li>{$reason}</li> {/foreach} </ul> <form class="login" action='/login' method='post'> <div> Email: <input name='email' size='32'/><br/> Password: <input type='password' name='password'/><br/> <br/> <input type='hidden' name='redirUrl' value='{$redirUrl}'/> <input type='submit' value="Login"/> </div> </form> </div>]]></example> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/ezc/onr-step2-template2.xml?view=markup&rev=1.1 Index: presentations/slides/ezc/onr-step2-template2.xml +++ presentations/slides/ezc/onr-step2-template2.xml <?xml version="1.0" encoding="utf-8"?> <slide> <title>Step 2: Adding authentication</title> <subtitle>Adding view templates</subtitle> <blurb>%templates/register.ezt%:</blurb> <example><![CDATA[{use $mailDomain = 'dev.omnomr'} <h1>Register</h1> <div class="pres"> <form class="prefs" action='register/submit' method='post'> E-mail: <input name='email' size='32'/><br/> Full name: <input name='fullname' size='32'/> (Like "Derick Rethans")<br/><br/> <br/> <input type='submit' name='reg' value="Register"/> </form> </div>]]></example> <blurb>%templates/register-submit.ezt%:</blurb> <example><![CDATA[{use $message = '', $success = false} <h1>Registration Result</h1> <div class="pres"> <div class='regmessage'> {$message} </div> {if !$success} <a href='/register'>try again</a> {/if} </div> </div>]]></example> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/ezc/onr-step2-views.xml?view=markup&rev=1.1 Index: presentations/slides/ezc/onr-step2-views.xml +++ presentations/slides/ezc/onr-step2-views.xml <?xml version="1.0" encoding="utf-8"?> <slide> <title>Step 2: Adding authentication</title> <subtitle>Adding view templates</subtitle> <blurb>%lib/config.php%:</blurb> <example><![CDATA[<?php function createView( ezcMvcRoutingInformation $routeInfo, ezcMvcRequest $request, ezcMvcResult $result ) { switch ( $routeInfo->matchedRoute ) { case '/': $view->contentTemplate = 'home.ezt'; break; case '/register/submit': $view->contentTemplate = 'register-submit.ezt'; break; case '/register': $view->contentTemplate = 'register.ezt'; break; case '/login-required': $view->contentTemplate = 'login.ezt'; break; } } ?>]]></example> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/ezc/onr-step3-action-list.xml?view=markup&rev=1.1 Index: presentations/slides/ezc/onr-step3-action-list.xml +++ presentations/slides/ezc/onr-step3-action-list.xml <?xml version="1.0" encoding="utf-8"?> <slide> <title>Step 3: Recipes</title> <subtitle>Adding actions: list</subtitle> <blurb>%lib/controllers/recipe.php%:</blurb> <example><![CDATA[<?php class onrRecipeController extends ezcMvcController { public function doList() { $d = ezcDbInstance::get(); $q = $d->createSelectQuery(); $q->select( 'id', 'name' )->from( 'recipe' )->orderBy( 'name' ); $s = $q->prepare(); $s->execute(); $res = new ezcMvcResult; $res->variables['recipes'] = $s; return $res; } } ?>]]></example> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/ezc/onr-step3-action-recipe-add-submit.xml?view=markup&rev=1.1 Index: presentations/slides/ezc/onr-step3-action-recipe-add-submit.xml +++ presentations/slides/ezc/onr-step3-action-recipe-add-submit.xml <?xml version="1.0" encoding="utf-8"?> <slide> <title>Step 3: Recipes</title> <subtitle>Adding actions: add and submit</subtitle> <blurb>%lib/controllers/recipe.php%:</blurb> <example><![CDATA[<?php class onrRecipeController extends ezcMvcController { public function doAdd() { return new ezcMvcResult; } public function doSubmit() { $d = ezcDbInstance::get(); $q = $d->createInsertQuery(); $q->insertInto( 'recipe' ) ->set( 'user_id', $q->bindValue( $this->user_id ) ) ->set( 'portions', $q->bindValue( (int) $this->portions ) ) ->set( 'description', $q->bindValue( $this->description ) ) ->set( 'name', $q->bindValue( $this->name ) ); $s = $q->prepare(); $s->execute(); $newId = $d->lastInsertId(); $res = new ezcMvcResult; $res->status = new ezcMvcExternalRedirect( '/recipe/' . $newId ); return $res; } } ?>]]></example> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/ezc/onr-step3-action-view.xml?view=markup&rev=1.1 Index: presentations/slides/ezc/onr-step3-action-view.xml +++ presentations/slides/ezc/onr-step3-action-view.xml <?xml version="1.0" encoding="utf-8"?> <slide> <title>Step 3: Recipes</title> <subtitle>Adding actions: view</subtitle> <blurb>%lib/controllers/recipe.php%:</blurb> <example><![CDATA[<?php class onrRecipeController extends ezcMvcController { public function doView() { $id = (int) $this->id; $res = new ezcMvcResult; $d = ezcDbInstance::get(); $q = $d->createSelectQuery(); $q->select( '*' ) ->from( 'recipe' ) ->where( $q->expr->eq( 'id', $q->bindValue( $id ) ) ); $s = $q->prepare(); $s->execute(); $data = $s->fetchAll(); if ( empty ( $data ) ) { $res->status = new ezcMvcExternalRedirect( '/' ); return $res; } // render rest recipe as HTML $desc = $data[0]['description']; $document = new ezcDocumentRst(); $document->loadString( $desc ); $document->options->xhtmlVisitor = 'ezcDocumentRstXhtmlBodyVisitor'; $xhtml = $document->getAsXhtml(); $xml = $xhtml->save(); $data[0]['description'] = $xml; $res->variables['data'] = $data[0]; return $res; } } ?>]]></example> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/ezc/onr-step3-add-recipe.xml?view=markup&rev=1.1 Index: presentations/slides/ezc/onr-step3-add-recipe.xml +++ presentations/slides/ezc/onr-step3-add-recipe.xml <?xml version="1.0" encoding="utf-8"?> <slide> <title>Step 3: Recipes</title> <subtitle>Overview</subtitle> <list> <bullet>Add the new routes (/recipe/*) to the router.</bullet> <bullet>Add the onrRecipeController class to the autoload file.</bullet> <bullet>Update configuration.</bullet> <bullet>Create templates</bullet> <bullet>Add the actions.</bullet> </list> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/ezc/onr-step3-configuration.xml?view=markup&rev=1.1 Index: presentations/slides/ezc/onr-step3-configuration.xml +++ presentations/slides/ezc/onr-step3-configuration.xml <?xml version="1.0" encoding="utf-8"?> <slide> <title>Step 3: Recipes</title> <subtitle>Setting up auth rules</subtitle> <blurb>%lib/config.php%:</blurb> <example><![CDATA[<?php function runRequestFilters( ezcMvcRoutingInformation $routeInfo, ezcMvcRequest $request ) { switch ( $routeInfo->matchedRoute ) { case '/recipe/add': case '/recipe/submit': return $this->runAuthRequiredFilter( $request ); break; case '/register/submit': case '/register': case '/login-required': case '/login': case '/logout': case '/fatal': break; default: return $this->runAuthCheckLoggedIn( $request ); } } ]]></example> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/ezc/onr-step3-result.xml?view=markup&rev=1.1 Index: presentations/slides/ezc/onr-step3-result.xml +++ presentations/slides/ezc/onr-step3-result.xml <?xml version="1.0" encoding="utf-8"?> <slide> <title>Step 3: Recipes</title> <subtitle>Viewing recipes</subtitle> <image align="center" filename="onr-step3.jpg"/> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/ezc/onr-step3-routes-autoload.php?view=markup&rev=1.1 Index: presentations/slides/ezc/onr-step3-routes-autoload.php +++ presentations/slides/ezc/onr-step3-routes-autoload.php <?xml version="1.0" encoding="utf-8"?> <slide> <title>Step 2: Adding authentication</title> <subtitle>New routes and autoload entries</subtitle> <blurb>%lib/router.php%:</blurb> <example><![CDATA[<?php class onrRouter extends ezcMvcRouter { public function createRoutes() { return array( // Recipes new ezcMvcRailsRoute( '/recipes', 'onrRecipeController', 'list' ), new ezcMvcRailsRoute( '/recipe/list', 'onrRecipeController', 'list' ), new ezcMvcRailsRoute( '/recipe/:id', 'onrRecipeController', 'view' ), new ezcMvcRailsRoute( '/recipe/add', 'onrRecipeController', 'add' ), ); } }]]></example> <blurb>%lib/autoload/autoload.php%:</blurb> <example><![CDATA[<?php return array( 'onrAuthController' => 'controllers/auth.php', 'onrRecipeController' => 'controllers/recipe.php', ); ?>]]></example> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/ezc/onr-step3-routes-autoload.xml?view=markup&rev=1.1 Index: presentations/slides/ezc/onr-step3-routes-autoload.xml +++ presentations/slides/ezc/onr-step3-routes-autoload.xml <?xml version="1.0" encoding="utf-8"?> <slide> <title>Step 3: Recipes</title> <subtitle>New routes and autoload entries</subtitle> <blurb>%lib/router.php%:</blurb> <example><![CDATA[<?php class onrRouter extends ezcMvcRouter { public function createRoutes() { return array( // Recipes new ezcMvcRailsRoute( '/recipes', 'onrRecipeController', 'list' ), new ezcMvcRailsRoute( '/recipe/list', 'onrRecipeController', 'list' ), new ezcMvcRailsRoute( '/recipe/add', 'onrRecipeController', 'add' ), new ezcMvcRailsRoute( '/recipe/submit', 'onrRecipeController', 'submit' ), new ezcMvcRailsRoute( '/recipe/:id', 'onrRecipeController', 'view' ), ); } }]]></example> <blurb>%lib/autoload/autoload.php%:</blurb> <example><![CDATA[<?php return array( 'onrAuthController' => 'controllers/auth.php', 'onrRecipeController' => 'controllers/recipe.php', ); ?>]]></example> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/ezc/onr-step3-template.xml?view=markup&rev=1.1 Index: presentations/slides/ezc/onr-step3-template.xml +++ presentations/slides/ezc/onr-step3-template.xml <?xml version="1.0" encoding="utf-8"?> <slide> <title>Step 3: Recipes</title> <subtitle>Adding view templates</subtitle> <blurb>%templates/recipes/list.ezt%:</blurb> <example><![CDATA[{use $recipes} <h1>Recipes</h1> <div class="list"> {foreach $recipes as $recipe} <div class="recipe-short"> <h1><a href="/recipe/{$recipe['id']}">{$recipe['name']}</a></h1> <hr /> </div> {/foreach} </div>]]></example> <blurb>%templates/recipes/view.ezt%:</blurb> <example><![CDATA[{use $data, $ingredients} <h1>{$data['name']}</h1> <div class="description"> {raw $data['description']} </div> <div class="ingredients"> {foreach $ingredients as $ingredient} <div class="ingredient"> {$ingredient['id']} </div> {/foreach} </div>]]></example> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/ezc/onr-step3-template2.xml?view=markup&rev=1.1 Index: presentations/slides/ezc/onr-step3-template2.xml +++ presentations/slides/ezc/onr-step3-template2.xml <?xml version="1.0" encoding="utf-8"?> <slide> <title>Step 3: Recipes</title> <subtitle>Adding view templates</subtitle> <blurb>%templates/recipes/add.ezt%:</blurb> <example><![CDATA[<h1>Adding a recipe</h1> <div class="pres"> <form class="prefs" action='/recipe/submit' method='post'> <div> Recipe name: <input type='text' name='name' value=''/><br/> Portions: <input type='text' size='2' maxlength='2' name='portions' value='4'/>< <br/> Description:<br/> <textarea cols="60" rows="10" name="description"> </textarea> <br/> <br/> <input type='submit' name='add' value="Add"/> </div> </form> </div>]]></example> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/ezc/onr-step3-views.xml?view=markup&rev=1.1 Index: presentations/slides/ezc/onr-step3-views.xml +++ presentations/slides/ezc/onr-step3-views.xml <?xml version="1.0" encoding="utf-8"?> <slide> <title>Step 3: Recipes</title> <subtitle>Adding view configuration</subtitle> <blurb>%lib/config.php%:</blurb> <example><![CDATA[<?php function createView( ezcMvcRoutingInformation $routeInfo, ezcMvcRequest $request, ezcMvcResult $result ) { switch ( $routeInfo->matchedRoute ) { case '/': $view->contentTemplate = 'home.ezt'; break; // auth: case '/register/submit': $view->contentTemplate = 'register-submit.ezt'; break; case '/register': $view->contentTemplate = 'register.ezt'; break; case '/login-required': $view->contentTemplate = 'login.ezt'; break; // recipes: case '/recipes': case '/recipe/list': $view->contentTemplate = 'recipes/list.ezt'; break; case '/recipe/:id': $view->contentTemplate = 'recipes/view.ezt'; break; case '/recipe/add': $view->contentTemplate = 'recipes/add.ezt'; break; } } ?>]]></example> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/ezc/onr-template-home1.xml?view=markup&rev=1.1 Index: presentations/slides/ezc/onr-template-home1.xml +++ presentations/slides/ezc/onr-template-home1.xml <?xml version="1.0" encoding="utf-8"?> <slide> <title>Step 1: The home controller and view</title> <subtitle>Home template</subtitle> <blurb>%templates/home.ezt%:</blurb> <example><![CDATA[<h1>OmNomR</h1> <p> Welcome! </p>]]></example> <break lines="3"/> <blurb>Current result:</blurb> <image align="center" filename="onr-step1.jpg"/> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/ezc/onr-template-main.xml?view=markup&rev=1.1 Index: presentations/slides/ezc/onr-template-main.xml +++ presentations/slides/ezc/onr-template-main.xml <?xml version="1.0" encoding="utf-8"?> <slide> <title>Step 1: The home controller and view</title> <subtitle>Main template</subtitle> <blurb>%templates/main.ezt%:</blurb> <example><![CDATA[{use $installDomain = 'dev.omnomr', $user = 'Anonymous', $content} <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>OmNomR</title> <link type="text/css" rel="stylesheet" href="http://{$installDomain}/stylesheets/core.css"/> </head> <body> <div id="everything"> <ul id="menu"> {if $user != 'Anonymous'} <li><a href='http://{$installDomain}/'>Home</a></li> <li><a href='http://{$installDomain}/add'>Add Recipe</a></li> {else} <li><a href='http://{$installDomain}/'>Login</a></li> <li><a href='http://{$installDomain}/register'>Register</a></li> {/if} </ul> <br/> <div id="main"> {raw $content} </div> <div style="float: right"> <div id="user"> <div class="username">{$user}</div> {if $user != 'Anonymous'} <div><a href='http://{$installDomain}/prefs'>Preferences</a></div> {/if} </div> </div> </body> </html>]]></example> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/ezc/router.xml?view=markup&rev=1.1 Index: presentations/slides/ezc/router.xml +++ presentations/slides/ezc/router.xml <?xml version="1.0" encoding="utf-8"?> <slide> <title>Dispatcher</title> <list> <bullet>Is responsible for the processing of the request</bullet> <bullet>Implements the %ezcMvcDispatcher% interface</bullet> <bullet>The current (and only) implementation right now is configured through a configuration object</bullet> <bullet>Configuration objects implement the %ezcMvcDispatcherConfiguration% interface</bullet> </list> </slide>
« previous php.pres (#1540) next »