1<?PHP2 /**3 * This makes we easier when dealing with paths. Everything is relative4 * to the application root now.5 */6 chdir(dirname(__dir__)); //Toggle current directory to Active Directory 7 8 //decline static file requests back to the PHP built-in webserver9 if(Php_sapi_name() = = = ' Cli-server ' &&Is_file(__dir__.Parse_url($_server[' Request_uri '],Php_url_path)) {
//intercept access to other static files in the current directory Ten return false; One } A - //Setup autoloading - require' Init_autoloader.php '; //Initialize load the - //Run the application! -Zend\mvc\application::init (require' config/application.config.php ')->run ();//Initialize complete application framework to start running
Summary: index.php is the original version of the installation, without any modification, the content is simple, automatically loaded to the application framework to do the pre-run preparation, and then use the Application:init () mode to initialize, init parameters are introduced in the configuration directory application.config.php the application configuration file, the run () method runs the framework after initialization is complete.
ZENDFRAMEWORK2 Source Analysis index.php