Skip to main content
Go to homepage
Github

Structure

The Inphinit application structure provides an easy-to-understand organization without sacrificing flexibility, which can be adjusted as needed.

Folder structure

index.php

The 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

The .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

The 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 Console Commands.

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

The 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.

system/

The system/ is folder containing your application.

console.php

The system/console.php is a script used to define custom commands used with ./run.bat (on Windows) and ./run files.

dev.php

The 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

The 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

The system/main.php is a script used to define routes, route scopes, implicit controllers and other instructions.

boot/

The system/boot/ contains settings for inphinit_autoload (similar to composer_autoload), media_types, and metada cache.

importpackages.php

The 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.

media_types.php

The system/boot/media_types.php file maps static file extensions to Content-Type headers for the PHP Built-in Web Server, working like mime.types in Apache or Nginx and allowing custom configurations.

namespaces.php

The 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/

This directory is used to store non-sensitive settings. 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/

The system/Controllers/ is must contain the classes that will be controllers used in the routes. See more details in Controllers.

Commands/

The system/Commands/ is must contain the classes that will be controllers used in the commands. See more details in Console Commands.

storage/

The 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/

The system/vendor/ is contain third-party packages and the framework.

views/

The system/views/ is should contain your views. See more details in Views.