Overview
Pop is a PHP framework built on the idea that you should be able to read your own application and know what
it does. No hidden container wiring, no annotation scanner, no convention that only works if you named a
file correctly. An application is an object you construct, hand a config array to, and call run() on.
It has been in continuous development since 2009, and v7 is the current line. Every component requires
PHP 8.4 or newer and declares strict_types=1 throughout.
The Core#
The core package is popphp/popphp, and it's small on purpose. It holds Pop\Application and six things it
coordinates: a router, a dispatch layer, a module manager, an event manager, a middleware manager and a
service locator. Nothing about a database, a template engine or a mail transport lives there.
<?php
$autoloader = include __DIR__ . '/../vendor/autoload.php';
$app = new Pop\Application($autoloader);
$app->get('/hello[/:name]', function($name = 'World') {
echo 'Hello ' . $name;
});
$app->run();
That's a complete, working HTTP application. The same Pop\Application object runs a CLI application —
the difference is which route table you give it and which matcher it picks, not a different class or a
different bootstrap.
Components#
Everything else is a component: an independent Composer package under the popphp/ vendor namespace, with
its own repository, version number and test suite. popphp/pop-db is the database layer, popphp/pop-view
renders templates, popphp/pop-mail sends mail. They depend on each other only through Composer — you can
pull popphp/pop-csv into a project built on another framework entirely and it works.
That independence is what makes the framework two products rather than one. Require popphp/popphp on
its own and you get a small handful of packages: the core, its direct requirements, and two more
behind pop-http. Or install the full framework and you get all of them in one command:
composer create-project popphp/framework my-app
popphp/framework is the installer skeleton. It brings the metapackage — the core plus every component —
and the kettle CLI helper, which scaffolds your application, runs migrations, manages queues and serves
the project while you develop. This site documents that full install, so every page after this one
assumes the component it covers is already present.
A component you add later behaves the same as one that shipped with the install. There's no registration
step and no service provider to write: composer require popphp/pop-storage, then new Pop\Storage\Storage(...) where you need it. Wiring one into the application is a few lines in load().
Where to Start#
Three places to go from here, depending on what you came for.
Getting Started is the path to a running application: installation, the
config array and .env, what the scaffolder writes, and a first route-controller-view round trip end to
end. The pages are meant to be read in order and take about an hour with a terminal open. Requirements sits
alongside them as reference rather than a step.
The Basics is the framework itself, one concept per page: the application object and its bootstrap, routing, controllers, models, requests and responses, views, sessions, forms, error handling, modules, services, events and middleware. This is the section you come back to.
Components is the map: every package, grouped by what it does, each linked to its guide page here and to its README for the complete API. The Database, Console and Toolkit sections of this site are the guides those entries point at.
If you are arriving from v6, two pages are written for you specifically: What's New in v7 covers what the release adds, and Upgrading from v6 covers what it breaks and what to do about each one.