Skip to content

Commit

Permalink
Merge pull request #28 from SidRoberts/response
Browse files Browse the repository at this point in the history
$application->handle() returns $response
  • Loading branch information
sergeyklay committed Apr 9, 2019
2 parents 558a0dc + 275fd9a commit 7b3e092
Show file tree
Hide file tree
Showing 16 changed files with 44 additions and 18 deletions.
6 changes: 5 additions & 1 deletion hmvc/public/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,8 @@ public function request(array $location, $data = null)

$app = new HMVCApplication($di);

echo $app->handle()->getContent();


$response = $app->handle();

$response->send();
4 changes: 3 additions & 1 deletion multiple-factory-default/public/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@
]
);

echo $application->handle()->getContent();
$response = $application->handle();

$response->send();
} catch (Phalcon\Exception $e) {
echo $e->getMessage();
} catch (PDOException $e) {
Expand Down
4 changes: 3 additions & 1 deletion multiple-service-layer-model/public/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@
*/
require __DIR__ . '/../apps/config/modules.php';

echo $application->handle()->getContent();
$response = $application->handle();

$response->send();
} catch (Phalcon\Exception $e) {
echo $e->getMessage();
} catch (PDOException $e) {
Expand Down
4 changes: 3 additions & 1 deletion multiple-shared-layouts/public/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@
]
);

echo $application->handle()->getContent();
$response = $application->handle();

$response->send();
} catch (Phalcon\Exception $e) {
echo $e->getMessage();
} catch (PDOException $e) {
Expand Down
2 changes: 1 addition & 1 deletion multiple-shared-views/public/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,4 @@ function () {

$response = $application->handle();

echo $response->getContent();
$response->send();
2 changes: 1 addition & 1 deletion multiple-volt/public/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

$response = $application->handle();

echo $response->getContent();
$response->send();
} catch (Exception $e) {
echo $e->getMessage();
}
4 changes: 3 additions & 1 deletion multiple/public/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ public function main()
]
]);

echo $this->handle()->getContent();
$response = $this->handle();

$response->send();
}
}

Expand Down
4 changes: 3 additions & 1 deletion simple-subcontrollers/public/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
*/
$application = new Application($di);

echo $application->handle()->getContent();
$response = $application->handle();

$response->send();
} catch (\Exception $e) {
echo $e->getMessage();
}
5 changes: 4 additions & 1 deletion simple-volt/public/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@
*/
$application = new \Phalcon\Mvc\Application();
$application->setDI($di);
echo $application->handle()->getContent();

$response = $application->handle();

$response->send();
} catch (Phalcon\Exception $e) {
echo $e->getMessage();
} catch (PDOException $e) {
Expand Down
4 changes: 1 addition & 3 deletions simple-without-application/public/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,7 @@
// Pass the output of the view to the response
$response->setContent($view->getContent());

$response->sendHeaders();

echo $response->getContent();
$response->send();
} catch (\Exception $e) {
echo $e->getMessage();
}
2 changes: 1 addition & 1 deletion simple/public/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ function () {

$response = $application->handle();

echo $response->getContent();
$response->send();
} catch (Exception $e) {
echo $e->getMessage();
}
4 changes: 3 additions & 1 deletion single-camelized-dirs/public/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ function ($event, $application, $view) use ($di) {

$application->setEventsManager($eventsManager);

echo $application->handle()->getContent();
$response = $application->handle();

$response->send();
} catch (\Exception $e) {
echo $e->getMessage();
}
5 changes: 4 additions & 1 deletion single-factory-default/public/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@
* Handle the request
*/
$application = new Application($di);
echo $application->handle()->getContent();

$response = $application->handle();

$response->send();
} catch (\Exception $e) {
echo $e->getMessage();
}
4 changes: 3 additions & 1 deletion single-namespaces/public/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ public function main()
$this->registerServices();
$this->registerAutoloaders();

echo $this->handle()->getContent();
$response = $this->handle();

$response->send();
}
}

Expand Down
4 changes: 3 additions & 1 deletion single-service-provider/app/Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ public function run()
protected function getOutput()
{
if ($this->app instanceof Application) {
return $this->app->handle()->getContent();
$response = $this->app->handle();

return $response->getContent();
}

return $this->app->handle();
Expand Down
4 changes: 3 additions & 1 deletion single/public/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ public function main()
$this->registerServices();
$this->registerAutoloaders();

echo $this->handle()->getContent();
$response = $this->handle();

$response->send();
}
}

Expand Down

0 comments on commit 7b3e092

Please sign in to comment.