Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

dispatcher.php
Go to the documentation of this file.
1 <?php
12 class ezpMvcConfigurableDispatcher extends ezcMvcConfigurableDispatcher
13 {
14
22 public function run()
23 {
24 // initialize infinite loop counter
25 $redirects = 0;
26
27 // create the request
28 $requestParser = $this->getRequestParser();
29 $request = $requestParser->createRequest();
30
31 // start of the request loop
32 do
33 {
34 // do the infinite loop check
35 $this->checkRedirectLimit( $redirects );
36 $continue = false;
37
38 // run pre-routing filters
39 $this->configuration->runPreRoutingFilters( $request );
40
41 // create the router from the configuration
42 $router = $this->getRouter( $request );
43
44 // router creates routing information
45 try
46 {
47 $routingInformation = $router->getRoutingInformation();
48 }
49 catch ( ezcMvcRouteNotFoundException $e )
50 {
51 $request = $this->getFatalRedirectRequest( $request, new ezcMvcResult, $e );
52 $continue = true;
53 continue;
54 }
55 // here's the reason to override ezcMvcConfigurableDispatcher::run()
56 catch ( ezpRouteMethodNotAllowedException $e )
57 {
58 $request = $this->getFatalRedirectRequest( $request, new ezcMvcResult, $e );
59 $continue = true;
60 continue;
61 }
62 // end diff
63
64
65 // run request filters
66 $filterResult = $this->configuration->runRequestFilters( $routingInformation, $request );
67
68 if ( $filterResult instanceof ezcMvcInternalRedirect )
69 {
70 $request = $filterResult->request;
71 $continue = true;
72 continue;
73 }
74
75 // create the controller
76 $controller = $this->getController( $routingInformation, $request );
77
78 // run the controller
79 try
80 {
81 $result = $controller->createResult();
82 }
83 catch ( Exception $e )
84 {
85 $request = $this->getFatalRedirectRequest( $request, new ezcMvcResult, $e );
86 $continue = true;
87 continue;
88 }
89
90 if ( $result instanceof ezcMvcInternalRedirect )
91 {
92 $request = $result->request;
93 $continue = true;
94 continue;
95 }
96 if ( !$result instanceof ezcMvcResult )
97 {
98 throw new ezcMvcControllerException( "The action '{$routingInformation->action}' of controller '{$routingInformation->controllerClass}' did not return an ezcMvcResult object." );
99 }
100
101 $this->configuration->runResultFilters( $routingInformation, $request, $result );
102
103 if ( $result->status !== 0 )
104 {
105 $response = new ezcMvcResponse;
106 $response->status = $result->status;
107 }
108 else
109 {
110 // want the view manager to use my filters
111 $view = $this->getView( $routingInformation, $request, $result );
112
113 // create the response
114 try
115 {
116 $response = $view->createResponse();
117 }
118 catch ( Exception $e )
119 {
120 $request = $this->getFatalRedirectRequest( $request, $result, $e );
121 $continue = true;
122 continue;
123 }
124 }
125 $this->configuration->runResponseFilters( $routingInformation, $request, $result, $response );
126
127 // create the response writer
128 $responseWriter = $this->getResponseWriter( $routingInformation, $request, $result, $response );
129
130 // handle the response
131 $responseWriter->handleResponse();
132 }
133 while ( $continue );
134 }
135 }
ezpMvcConfigurableDispatcher
Definition: dispatcher.php:13
ezpMvcConfigurableDispatcher\run
run()
Definition: dispatcher.php:22
ezpRouteMethodNotAllowedException
Definition: route_method_not_allowed.php:13
$result
$result
Definition: companysearch.php:94
$response
while(!feof($socket)) $response
Definition: paypalnotify.php:196
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.