Changeset 1568
- Timestamp:
- 01/24/07 15:45:37 (2 years ago)
- Location:
- branches/0.11
- Files:
-
- 8 removed
- 91 modified
- 17 copied
-
RELEASE_NOTES (modified) (2 diffs)
-
docs/docbook/introduction.xml (modified) (1 diff)
-
docs/docbook/manual.xml (modified) (6 diffs)
-
etc/olson/agavi/app/config/factories.xml (modified) (1 diff)
-
samples/app/config/factories.xml (modified) (2 diffs)
-
samples/app/config/logging.xml (modified) (3 diffs)
-
samples/app/config/output_types.xml (modified) (3 diffs)
-
samples/app/config/rendering_filters.xml (deleted)
-
samples/app/config/routing.xml (modified) (1 diff)
-
samples/app/lib/filter/AgaviSampleAppCookieLoginFilter.class.php (modified) (3 diffs)
-
samples/app/lib/routing/AgaviSampleAppLanguageRoutingCallback.class.php (modified) (4 diffs)
-
samples/app/modules/Default/actions/Error404Action.class.php (modified) (2 diffs)
-
samples/app/modules/Default/actions/IndexAction.class.php (modified) (2 diffs)
-
samples/app/modules/Default/actions/LoginAction.class.php (modified) (3 diffs)
-
samples/app/modules/Default/actions/LogoutAction.class.php (modified) (2 diffs)
-
samples/app/modules/Default/actions/ModuleDisabledAction.class.php (modified) (2 diffs)
-
samples/app/modules/Default/actions/SearchEngineSpamAction.class.php (modified) (1 diff)
-
samples/app/modules/Default/actions/Secure1Action.class.php (modified) (2 diffs)
-
samples/app/modules/Default/actions/Secure2Action.class.php (modified) (2 diffs)
-
samples/app/modules/Default/actions/SecureAction.class.php (modified) (2 diffs)
-
samples/app/modules/Default/actions/UnavailableAction.class.php (modified) (2 diffs)
-
samples/app/modules/Default/config/autoload.xml (copied) (copied from branches/david-execution_flow/samples/app/modules/Default/config/autoload.xml)
-
samples/app/modules/Default/lib/action (copied) (copied from branches/david-execution_flow/samples/app/modules/Default/lib/action)
-
samples/app/modules/Default/lib/action/AgaviSampleAppDefaultBaseAction.class.php (copied) (copied from branches/david-execution_flow/samples/app/modules/Default/lib/action/AgaviSampleAppDefaultBaseAction.class.php)
-
samples/app/modules/Default/lib/view (copied) (copied from branches/david-execution_flow/samples/app/modules/Default/lib/view)
-
samples/app/modules/Default/lib/view/AgaviSampleAppDefaultBaseView.class.php (copied) (copied from branches/david-execution_flow/samples/app/modules/Default/lib/view/AgaviSampleAppDefaultBaseView.class.php)
-
samples/app/modules/Default/templates/Master.php (modified) (2 diffs)
-
samples/app/modules/Default/views/Error404SuccessView.class.php (modified) (2 diffs)
-
samples/app/modules/Default/views/IndexSuccessView.class.php (modified) (2 diffs)
-
samples/app/modules/Default/views/LoginInputView.class.php (modified) (2 diffs)
-
samples/app/modules/Default/views/LoginSuccessView.class.php (modified) (2 diffs)
-
samples/app/modules/Default/views/LogoutSuccessView.class.php (modified) (2 diffs)
-
samples/app/modules/Default/views/ModuleDisabledSuccessView.class.php (modified) (2 diffs)
-
samples/app/modules/Default/views/SearchEngineSpamErrorView.class.php (modified) (3 diffs)
-
samples/app/modules/Default/views/SearchEngineSpamSuccessView.class.php (modified) (3 diffs)
-
samples/app/modules/Default/views/Secure1SuccessView.class.php (modified) (2 diffs)
-
samples/app/modules/Default/views/Secure2SuccessView.class.php (modified) (2 diffs)
-
samples/app/modules/Default/views/SecureSuccessView.class.php (modified) (2 diffs)
-
samples/app/modules/Default/views/UnavailableSuccessView.class.php (modified) (2 diffs)
-
samples/app/modules/Disabled/actions/IndexAction.class.php (modified) (1 diff)
-
samples/app/modules/Disabled/views/IndexSuccessView.class.php (modified) (1 diff)
-
samples/pub/index.php (modified) (1 diff)
-
src/action/AgaviAction.class.php (modified) (7 diffs)
-
src/action/AgaviActionStack.class.php (deleted)
-
src/action/AgaviActionStackEntry.class.php (deleted)
-
src/buildtools/code_templates/View.class.php.tmpl (modified) (1 diff)
-
src/buildtools/code_templates/config/factories.xml (modified) (2 diffs)
-
src/buildtools/code_templates/config/output_types.xml (modified) (1 diff)
-
src/buildtools/code_templates/config/rendering_filters.xml (deleted)
-
src/config/AgaviFactoryConfigHandler.class.php (modified) (3 diffs)
-
src/config/AgaviOutputTypeConfigHandler.class.php (modified) (1 diff)
-
src/config/defaults/autoload.xml (modified) (7 diffs)
-
src/config/defaults/compile.xml (modified) (3 diffs)
-
src/config/defaults/config_handlers.xml (modified) (2 diffs)
-
src/config/xsd/factories.xsd (modified) (2 diffs)
-
src/config/xsd/output_types.xsd (modified) (2 diffs)
-
src/controller/AgaviConsoleController.class.php (deleted)
-
src/controller/AgaviController.class.php (modified) (17 diffs)
-
src/controller/AgaviExecutionContainer.class.php (copied) (copied from branches/david-execution_flow/src/controller/AgaviExecutionContainer.class.php)
-
src/controller/AgaviOutputType.class.php (copied) (copied from branches/david-execution_flow/src/controller/AgaviOutputType.class.php)
-
src/controller/AgaviWebController.class.php (deleted)
-
src/core/AgaviContext.class.php (modified) (4 diffs)
-
src/exception/AgaviException.class.php (modified) (1 diff)
-
src/exception/AgaviForwardException.class.php (deleted)
-
src/filter/AgaviDispatchFilter.class.php (modified) (2 diffs)
-
src/filter/AgaviExecutionFilter.class.php (modified) (10 diffs)
-
src/filter/AgaviExecutionTimeFilter.class.php (modified) (3 diffs)
-
src/filter/AgaviFilter.class.php (modified) (2 diffs)
-
src/filter/AgaviFilterChain.class.php (modified) (4 diffs)
-
src/filter/AgaviFormPopulationFilter.class.php (modified) (4 diffs)
-
src/filter/AgaviIFilter.interface.php (modified) (2 diffs)
-
src/filter/AgaviIRenderingFilter.interface.php (deleted)
-
src/filter/AgaviSecurityFilter.class.php (modified) (5 diffs)
-
src/renderer/AgaviIReusableRenderer.interface.php (copied) (copied from branches/david-execution_flow/src/renderer/AgaviIReusableRenderer.interface.php)
-
src/renderer/AgaviPhpRenderer.class.php (modified) (2 diffs)
-
src/renderer/AgaviPhptalRenderer.class.php (modified) (4 diffs)
-
src/renderer/AgaviRenderer.class.php (modified) (7 diffs)
-
src/renderer/AgaviSmartyRenderer.class.php (modified) (3 diffs)
-
src/renderer/AgaviXslRenderer.class.php (modified) (4 diffs)
-
src/request/AgaviICookiesRequestDataHolder.interface.php (copied) (copied from branches/david-execution_flow/src/request/AgaviICookiesRequestDataHolder.interface.php)
-
src/request/AgaviIFilesRequestDataHolder.interface.php (copied) (copied from branches/david-execution_flow/src/request/AgaviIFilesRequestDataHolder.interface.php)
-
src/request/AgaviIHeadersRequestDataHolder.interface.php (copied) (copied from branches/david-execution_flow/src/request/AgaviIHeadersRequestDataHolder.interface.php)
-
src/request/AgaviRequest.class.php (modified) (6 diffs)
-
src/request/AgaviRequestDataHolder.class.php (copied) (copied from branches/david-execution_flow/src/request/AgaviRequestDataHolder.class.php)
-
src/request/AgaviUploadedFile.class.php (copied) (copied from branches/david-execution_flow/src/request/AgaviUploadedFile.class.php)
-
src/request/AgaviWebRequest.class.php (modified) (4 diffs)
-
src/request/AgaviWebRequestDataHolder.class.php (copied) (copied from branches/david-execution_flow/src/request/AgaviWebRequestDataHolder.class.php)
-
src/response/AgaviResponse.class.php (modified) (5 diffs)
-
src/response/AgaviWebResponse.class.php (modified) (11 diffs)
-
src/response/AgaviXmlrpcepiphpResponse.class.php (modified) (3 diffs)
-
src/routing/AgaviRouting.class.php (modified) (10 diffs)
-
src/routing/AgaviRoutingCallback.class.php (modified) (5 diffs)
-
src/routing/AgaviWebRouting.class.php (modified) (1 diff)
-
src/util/AgaviInflector.class.php (modified) (1 diff)
-
src/util/AgaviParameterHolder.class.php (modified) (1 diff)
-
src/util/AgaviToolkit.class.php (modified) (1 diff)
-
src/validator/AgaviBaseFileValidator.class.php (modified) (4 diffs)
-
src/validator/AgaviIValidationManager.interface.php (modified) (2 diffs)
-
src/validator/AgaviImageFileValidator.class.php (modified) (1 diff)
-
src/validator/AgaviIssetValidator.class.php (modified) (2 diffs)
-
src/validator/AgaviOperatorValidator.class.php (modified) (2 diffs)
-
src/validator/AgaviValidationManager.class.php (modified) (8 diffs)
-
src/validator/AgaviValidator.class.php (modified) (8 diffs)
-
src/view/AgaviFileTemplateLayer.class.php (copied) (copied from branches/david-execution_flow/src/view/AgaviFileTemplateLayer.class.php)
-
src/view/AgaviStreamTemplateLayer.class.php (copied) (copied from branches/david-execution_flow/src/view/AgaviStreamTemplateLayer.class.php)
-
src/view/AgaviTemplateLayer.class.php (copied) (copied from branches/david-execution_flow/src/view/AgaviTemplateLayer.class.php)
-
src/view/AgaviView.class.php (modified) (6 diffs)
-
tests2/AllTests/ActionTests.php (modified) (2 diffs)
-
tests2/action/ActionTest.php (modified) (1 diff)
-
tests2/config/FilterConfigHandlerTest.php (modified) (1 diff)
-
tests2/controller/ControllerTest.php (modified) (5 diffs)
-
tests2/core/ContextTest.php (modified) (3 diffs)
-
tests2/renderer/RendererTest.php (modified) (2 diffs)
-
tests2/sandbox2/config/factories.xml (modified) (2 diffs)
-
tests2/sandbox2/config/tests/factories.xml (modified) (2 diffs)
-
tests2/view/ViewTest.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/0.11/RELEASE_NOTES
r1332 r1568 36 36 Inside Actions and Views, it is not possible to access request parameters directly. Instead, a ParameterHolder passed to the execute() method will contain the request parameters. The idea behind this decision is that these parameters are safe for use if they have been filtered and normalized by validation or by some generic preprocessing filter (which, for instance, could remove any XSS related stuff). Also, with any strict validation mode enabled, only those variables that have been validated will be available for use. 37 37 38 Inside a controller's dispatch() method, global filters now run first. This finally allows to implement features such as cookie based auto-logins etc, and also guarantees that these filters modify the actual final output of a request. The now-called "Action Filters" are identical to filters in 0.10 and earlier. Also, it is now possible to filter the rendering of templates via rendering filters. The result of these rendering filters are also included in any caching.38 Inside a controller's dispatch() method, global filters now run first. This finally allows to implement features such as cookie based auto-logins etc, and also guarantees that these filters modify the actual final output of a request. The now-called "Action Filters" are identical to filters in 0.10 and earlier. 39 39 40 40 With the new concept of output types, Views may implement execute() methods specifically for an output type by containing an executeSomething() methods, with "something" being the name of the output type. … … 59 59 All configuration settings can either be valid under all situations, or only in one or more specific environments and/or contexts. This allows for very fine-grained control over what's happening. For instance, you can enable debug mode for the 'production' environment, or enable certain filters only in the 'web' context. 60 60 61 'contexts.ini' is gone, and we re-introduced 'factories.xml'. New config files are 'output_types.xml', 'routing.xml' and 'translation.xml'. 'filters.xml' was split up into separate files for global- , rendering-and action filters.61 'contexts.ini' is gone, and we re-introduced 'factories.xml'. New config files are 'output_types.xml', 'routing.xml' and 'translation.xml'. 'filters.xml' was split up into separate files for global- and action filters. 62 62 63 63 'autoload.xml' 'compile.xml' and 'config_handlers.xml' use the "global" Agavi configuration files as their parents so it's not necessary anymore to sync them after each upgrade of Agavi. -
branches/0.11/docs/docbook/introduction.xml
r1336 r1568 207 207 the Action (or skip execution if the Action doesn't serve the Request 208 208 method), determine the View to execute and then execute the View and, 209 after that, start the rendering of the output by creating another filter 210 chain containing all the defined Rendering Filters and, as the last 211 element, the designated Renderer instance that will take care of 212 rendering the template. This functionality might be extended by other 213 Execution Filter implementations; for example, the 214 CachingExecutionFilter will try to load a cached version of the Action 215 and skip execution altogether if possible, resulting in a massive 216 performance increase.</para> 209 after that, start the rendering of the output.</para> 217 210 </section> 218 211 </chapter> -
branches/0.11/docs/docbook/manual.xml
r1546 r1568 572 572 the Action (or skip execution if the Action doesn't serve the Request 573 573 method), determine the View to execute and then execute the View and, 574 after that, start the rendering of the output by creating another filter 575 chain containing all the defined Rendering Filters and, as the last 576 element, the designated Renderer instance that will take care of 577 rendering the template. This functionality might be extended by other 578 Execution Filter implementations; for example, the 579 CachingExecutionFilter will try to load a cached version of the Action 580 and skip execution altogether if possible, resulting in a massive 581 performance increase.</para> 574 after that, start the rendering of the output.</para> 582 575 </section> 583 576 … … 1410 1403 1411 1404 <listitem> 1412 <para> action_stack, controller, database_manager,1413 dispatch_filter, execution_filter, filter_chain,1405 <para>controller, database_manager, dispatch_filter 1406 execution_container, execution_filter, filter_chain, 1414 1407 logger_manager, request, response, routing, security_filter, 1415 1408 storage, translation_manager, user, validator_manager</para> … … 1642 1635 1643 1636 <handlers> 1644 <handler pattern="%core.module_dir%/*/config/ rendering_filters.xml" validate="%core.agavi_dir%/config/xsd/filters.xsd" class="AgaviFilterConfigHandler" />1637 <handler pattern="%core.module_dir%/*/config/action_filters.xml" validate="%core.agavi_dir%/config/xsd/filters.xsd" class="AgaviFilterConfigHandler" /> 1645 1638 <handler pattern="%core.module_dir%/*/config/module.xml" validate="%core.agavi_dir%/config/xsd/module.xsd" class="AgaviModuleConfigHandler" /> 1646 1639 <handler pattern="%core.module_dir%/*/validate/*.xml" class="AgaviValidatorConfigHandler" /> … … 1851 1844 1852 1845 <para>Available elements are <simplelist type="inline"> 1853 <member>"action_stack"</member>1854 1855 1846 <member>"controller"</member> 1856 1847 … … 1858 1849 1859 1850 <member>"dispatch_filter"</member> 1851 1852 <member>"execution_container"</member> 1860 1853 1861 1854 <member>"execution_filter"</member> … … 1909 1902 <title>FilterConfigHandler Tags (*_filters.xml)</title> 1910 1903 1911 <para>You may use <filename>action_filters.xml</filename>, 1912 <filename>global_filters.xml</filename> and 1913 <filename>rendering_filters.xml</filename> to configure Action, global 1914 or rendering filters. Action and rendering filters may also be specified 1915 on a per-module basis by putting them into the 1904 <para>You may use <filename>action_filters.xml</filename> and 1905 <filename>global_filters.xml</filename> to configure filters that wrap 1906 either the global execution flow or individual actions. Action filters 1907 may also be specified on a per-module basis by putting them into the 1916 1908 <filename>app/modules/ModuleName/config/</filename> folder.</para> 1917 1909 -
branches/0.11/etc/olson/agavi/app/config/factories.xml
r1223 r1568 9 9 | The default configuration must at least define: | 10 10 | | 11 | action_stack - The ActionStack class implementation. |12 11 | controller - The Controller class implementation. | 13 12 | dispatch_filter - The DispatchFilter class implementation. | 13 | execution_container - The ExecutionContainer class implementation. | 14 14 | execution_filter - The ExecutionFilter class implementation. | 15 15 | filter_chain - The FilterChain class implementation. | -
branches/0.11/samples/app/config/factories.xml
r1487 r1568 9 9 | The default configuration must at least define: | 10 10 | | 11 | action_stack - The ActionStack class implementation. |12 11 | controller - The Controller class implementation. | 12 | execution_container - The ExecutionContainer class implementation. | 13 13 | execution_filter - The ExecutionFilter class implementation. | 14 14 | request - The Request class implementation. | … … 26 26 <configuration> 27 27 28 <action_stack class="AgaviActionStack" /> 29 30 <controller class="AgaviWebController" /> 28 <controller class="AgaviController" /> 31 29 32 30 <database_manager class="AgaviDatabaseManager" /> 33 31 34 32 <dispatch_filter class="AgaviDispatchFilter" /> 33 34 <execution_container class="AgaviExecutionContainer" /> 35 35 36 36 <execution_filter class="AgaviExecutionFilter" /> -
branches/0.11/samples/app/config/logging.xml
r1433 r1568 16 16 <configuration> 17 17 18 <loggers default=" default">18 <loggers default="any"> 19 19 20 20 <!-- logs only DEBUG messages --> 21 <logger name=" debug" class="AgaviLogger" level="AgaviLogger::DEBUG">21 <logger name="any" class="AgaviLogger" level="AgaviLogger::ALL"> 22 22 <appenders> 23 23 <appender>DebugLogAppender</appender> … … 25 25 </logger> 26 26 27 <!-- logs only INFO messages -->28 <logger name="default" class="AgaviLogger" level="AgaviLogger::INFO">29 <appenders>30 <appender>ApplicationLogAppender</appender>31 </appenders>32 </logger>33 34 <!-- logs everything but DEBUG and INFO messages -->35 <logger name="error" class="AgaviLogger" level="AgaviLogger::ALL ^ AgaviLogger::DEBUG ^ AgaviLogger::INFO">36 <appenders>37 <appender>ErrorLogAppender</appender>38 </appenders>39 </logger>40 27 </loggers> 41 28 <appenders> … … 51 38 </parameters> 52 39 </appender> 53 54 <appender name="ApplicationLogAppender" class="AgaviFileLoggerAppender" layout="PassthruLayout">55 <parameters>56 <parameter name="file">%core.app_dir%/log/application.log</parameter>57 </parameters>58 </appender>59 60 <appender name="ErrorLogAppender" class="AgaviRotatingFileLoggerAppender" layout="PassthruLayout">61 <parameters>62 <parameter name="file">%core.app_dir%/log/error.log</parameter>63 </parameters>64 </appender>65 66 40 </appenders> 67 41 68 42 <layouts> 69 <layout name="PassthruLayout" class="Agavi PassthruLoggerLayout" />43 <layout name="PassthruLayout" class="AgaviTimestampLoggerLayout" /> 70 44 </layouts> 71 45 -
branches/0.11/samples/app/config/output_types.xml
r1166 r1568 12 12 +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+ 13 13 --> 14 <configurations >14 <configurations xmlns:xi="http://www.w3.org/2001/XInclude"> 15 15 16 16 <configuration context="web"> … … 18 18 19 19 <output_type name="html"> 20 <renderer class="AgaviPhpRenderer"> 21 <parameters> 22 <parameter name="assigns"> 23 <parameters> 24 <parameter name="routing">r</parameter> 25 <parameter name="request">req</parameter> 26 <parameter name="controller">ctl</parameter> 27 <parameter name="user">usr</parameter> 28 <parameter name="translation_manager">tm</parameter> 29 </parameters> 30 </parameter> 31 <parameter name="i18n"> 32 <parameters> 33 <parameter name="mode">subdir</parameter> 34 </parameters> 35 </parameter> 36 </parameters> 37 </renderer> 20 <renderers default="php"> 21 <renderer name="php" class="AgaviPhpRenderer"> 22 <parameters> 23 <parameter name="assigns"> 24 <parameters> 25 <parameter name="routing">r</parameter> 26 <parameter name="request">req</parameter> 27 <parameter name="controller">ctl</parameter> 28 <parameter name="user">usr</parameter> 29 <parameter name="translation_manager">tm</parameter> 30 </parameters> 31 </parameter> 32 </parameters> 33 </renderer> 34 </renderers> 35 <layouts default="default"> 36 <layout name="default"> 37 <layers> 38 <layer name="content" class="AgaviFileTemplateLayer" /> 39 <layer name="decorator" class="AgaviFileTemplateLayer"> 40 <parameters> 41 <parameter name="template">Master</parameter> 42 </parameters> 43 </layer> 44 </layers> 45 </layout> 46 </layouts> 38 47 <parameters> 39 48 <parameter name="Content-Type">text/html; charset=UTF-8</parameter> … … 42 51 43 52 <output_type name="xhtml"> 44 <renderer class="AgaviPhpRenderer"> 45 <parameters> 46 <parameter name="assigns"> 47 <parameters> 48 <parameter name="routing">r</parameter> 49 <parameter name="request">req</parameter> 50 <parameter name="controller">ctl</parameter> 51 <parameter name="user">usr</parameter> 52 <parameter name="translation_manager">tm</parameter> 53 </parameters> 54 </parameter> 55 </parameters> 56 </renderer> 53 <xi:include href="#xpointer(//configurations/configuration[@context='web']/output_types/output_type[@name='html']/renderers)" /> 54 <xi:include href="#xpointer(//configurations/configuration[@context='web']/output_types/output_type[@name='html']/layouts)" /> 57 55 <parameters> 58 56 <parameter name="Content-Type">application/xhtml+xml; charset=UTF-8</parameter> -
branches/0.11/samples/app/config/routing.xml
r1165 r1568 35 35 <!-- If the HTTP Accept: header contains "application/xhtml+xml", set the output type to "xhtml". Look at output_types.xml for the declaration of that output type. Execution will not stop if this route matches. --> 36 36 <route pattern="application/xhtml+xml" source="_SERVER[HTTP_ACCEPT]" output_type="xhtml" stop="false" /> 37 37 38 38 <route name="disabled" pattern="^/disabled" module="Disabled" action="Index" /> 39 39 -
branches/0.11/samples/app/lib/filter/AgaviSampleAppCookieLoginFilter.class.php
r908 r1568 21 21 * 22 22 * @param AgaviFilterChain The filter chain. 23 * @param AgaviExecutionContainer The current execution container. 23 24 * 24 25 * @throws <b>AgaviFilterException</b> If an error occurs during execution. … … 27 28 * @since 0.11.0 28 29 */ 29 public function execute(AgaviFilterChain $filterChain, Agavi Response $response)30 public function execute(AgaviFilterChain $filterChain, AgaviExecutionContainer $container) 30 31 { 31 $req = $this->getContext()->getRequest();32 $reqData = $this->getContext()->getRequest()->getRequestData(); 32 33 $usr = $this->getContext()->getUser(); 33 34 34 if(!$usr->isAuthenticated() && $req ->hasCookie('autologon')) {35 $login = $req ->getCookie('autologon');35 if(!$usr->isAuthenticated() && $reqData->hasCookie('autologon')) { 36 $login = $reqData->getCookie('autologon'); 36 37 try { 37 38 $usr->login($login['username'], $login['password']); … … 43 44 } 44 45 45 $filterChain->execute($ filterChain, $response);46 $filterChain->execute($container); 46 47 } 47 48 } -
branches/0.11/samples/app/lib/routing/AgaviSampleAppLanguageRoutingCallback.class.php
r1154 r1568 5 5 protected $availableLocales = array(); 6 6 7 public function initialize(Agavi Response $response, array &$route)7 public function initialize(AgaviContext $context, array &$route) 8 8 {
