Structure
The Inphinit application structure provides an easy-to-understand organization without sacrificing flexibility, which can be adjusted as needed.
Folder structure
index.php
index.php is the script that starts the application. It allows you to configure the autoload system and even change the folder structure, if necessary. Note that changing the folder structure is not recommended. If you want to add other PHP projects, such as a blog or similar, you can place them in the public folder or add a DocumentRoot for each project.
.htaccess
.htaccess is used by Apache web servers to configure routes and the main error codes that can be issued by the server, allowing to customize pages or generic error responses.
web.config
web.config is used by IIS web servers to configure routes and the main error codes that can be issued by the server, allowing to customize pages or generic error responses.
run
run is a PHP command-line interface (CLI) script that lets you execute commands defined in system/console.php, as well as built-in commands for tasks such as optimization, running the built-in web server, and enabling or disabling maintenance mode. See more details in Checkup.
run.bat
run.bat is a shortcut for running the run script in a Windows environment.
public/
public/ is the folder where other scripts, PHP applications and static files should be stored to be served without the need for the routing system.
public/.htaccess
public/.htaccess file is used by Apache web servers to configure script behavior, cache static files, and set up other systems that can be used alongside Inphinit.
public/checkup.php
public/checkup.php is a script used to check the conditions generally required to run your application. See more details in Checkup.
system/
system/ is folder containing your application.
dev.php
system/dev.php serves the same purpose as system/main.php, however it only runs in development mode and should not be used for production. You can define routes and other instructions as required for the environment type. See more details in Debugging.
errors.php
system/errors.php should contain error page settings, such as when a 404 or 405 error occurs, you can call static files or use views. See more details in Error pages.
main.php
system/main.php is a script used to define routes, route scopes, implicit controllers and other instructions.
boot/
system/boot/ is contain settings for inphinit_autoload, similar to composer_autoload.
importpackages.php
system/boot/importpackages.php is a script used to import packages installed via composer into inphinit_autoload. This script is automatically executed by composer.json on every update, such as when installing or removing packages.
namespaces.php
system/boot/namespaces.php indexes all packages installed via composer and should not be changed manually, the data in this file is generated by system/bottom/importpackages.php.
configs/
system/configs/ is contain varied configuration files, it is recommended that you do not version this folder. See more details in Configurations.
debug.php
system/configs/debug.php contains settings for the debugging system used by development mode, these settings allow you to configure an editor to open files that cause errors or integrate possible error messages with search engines from other sites. See more details in Debugging.
Controllers/
system/Controllers/ is must contain the classes that will be controllers used in the routes. See more details in Controllers.
Commands/
system/Commands/ is must contain the classes that will be controllers used in the routes. See more details in Console Commands.
storage/
system/storage/ directory is intended to contain all directories that need to be writable at runtime, such as those used for caching, logging, and handling user-uploaded files.
vendor/
system/vendor/ is contain third-party packages and the framework
views/
system/views/ is should contain your views