Skip to content

Request response lifecycle

Greg Bowler edited this page Jun 8, 2018 · 22 revisions

When working with any tool, it is important to understand how the tool works. Here we can look under the bonnet at what makes WebEngine work so you can use the knowledge to make the best decisions in writing applications.

Within PHP.Gt, everything is broken down into its own repository of single responsibility. The PHP.Gt WebEngine brings all of these components together to produce a full application framework. As the name suggests, this framework utilises web technologies and the purpose of this page of the documentation is to walk through what goes into the whole lifecycle of the application.

Step 0: Web server

Before any code is executed, a web request will be handled by the web server. This can be any server, such as NGINX, Apache or the inbuilt server.

The job of the server is to listen for HTTP requests from web browsers across the internet and send back the correct response. A valid response can be a static file, such as an image, a WebEngine page handled by your code, or a 404 Not Found message.

For a web server to handle WebEngine pages, the request/response lifecycle begins. The entry point of all WebEngien requests is the go.php file in the root of the WebEngine directory. If WebEngine is installed using Composer, the path will be vendor/phpgt/webengine/go.php.

See the web servers section for more information about configuring servers and using the inbuilt server.

Step 1: Go!

The go.php file

Clone this wiki locally