Manual:WebStart.php

This does the initial setup for a web request, it should be called by all web access points (including index.php). It does some security checks, starts the profiler, verify that LocalSettings.php exists and prints an error if not.

It includes LocalSettings.php, starts the output buffer and includes Setup.php if the  constant is not defined.