Inphinit is a minimalist web framework for PHP

Inphinit is a small and fast framework with a simple router, built-in tools and no heavy dependencies. Start a project in minutes.

composer create-project inphinit/inphinit:^2.1 my-app

Optionally, you can download:

Simple router

Define routes, patterns and filters with a few lines of code.

HTTP cache

Cache responses with ETag, Expires and 304 support.

Scheduler

Run tasks by interval, cron expression or just once.

CSS selectors

Query XML and HTML documents using familiar selectors.

Cookie jars

Group cookies and control their attributes easily.

Proxy & load balancer

Handle forwarded headers from trusted proxies.

Diagnostics

Validate your app and find problems before deploy.

Lightweight

No external requirements, just PHP and your code.

Faster

Small core, low overhead and quick startup.

Simpler

Fewer concepts to learn and less code to write.

Flexible

Use only the parts you need in your project.

The things people ask before they start.

Does Inphinit need Composer?

No. You can use it with plain PHP files. Composer is optional if you want extra packages.

Which PHP versions are supported?

Compatible with PHP 8, with backward compatibility for PHP 5.4.

Can I use it with an existing project?

Yes. You can add it gradually, one route at a time.

Does it work on shared hosting?

Yes. It runs on Apache, FrankenPHP, lighttpd, Nginx and IIS.

How do I contribute?

Open an issue or a pull request on GitHub .

Your next project can start today.

Install Inphinit, create your first route and see it running.

  • Open source
  • No dependencies

What's new?

2.1 version

Changelog between versions 2.0 and 2.1:

2.1-beta.21 version
  • Inphinit\Experimental\Http\Method class refactored.
  • x-forwarded-prefix header can now be used with RFC7239 (eg.: $forwarded->setFlags(Forwarded::PREFIX|Forwarded::RFC7239)).
  • Fixed Forwarded::getPrefix().
  • Fixed Inphinit\Dom\Selector class.
  • Fixed Inphinit\Filesystem\File.
  • Improved behavior of Scheduler::prioritizeBackgroundTasks() in PHP<8.
  • New method: Storage:temp().
  • The Config::commit() method has been removed, as its use could otherwise result in the loss of information regarding file permissions and ownership.
  • Renamed commands:
    • create:command -> make:command.
    • create:controller -> make:controller.
    • create:view -> make:view.
2.1-beta.20 version

Built-in commands:

  • New run create:command command.
  • New run create:controller command.
  • New run create:view command.
  • The run server command now checks whether the port is already in use.

FileGenerator improved:

  • Support header templates.
  • Fixed bugs.

Forwarded support:

  • Refactored and added support to the framework core.
  • By default, a 403 code will be sent if unknown proxies are detected.