Installation
Create a New Project#
Pop can install through Composer's create-project command. Create a new project from the
popphp/framework skeleton, and you get the kettle CLI helper and every component with it:
composer create-project popphp/framework my-app
When you run the above command, after it installs everything through Composer, it'll ask you if you want to initialize your application. Now is as good a time as any, but if you decide not too, you can come back to the initialization process with the following commands:
cd my-app
./kettle pop:init
Clone the Repo#
Cloning the skeleton repository directly reaches the same place, and is worth knowing about when you want the project under your own git history from the first commit:
git clone https://github.com/popphp/framework.git my-app
cd my-app
composer install
Using composer require#
You can add it to an existing project with the composer required command:
composer require popphp/framework
or, by manually adding it to the project's composer.json file:
{
"require": {
"popphp/framework": "^7.0.0"
}
}
and running composer update. However, doing it this way means that kettle won't be
installed in the project's root folder. You'll have to copy it over with the commands:
cp vendor/popphp/pop-kettle/kettle .
chmod 755 ./kettle
And you will have to edit the kettle script to make sure it points to the config file. Change this:
$config = include __DIR__ . '/config/app.console.php';
to
$config = include __DIR__ . '/vendor/popphp/pop-kettle/config/app.console.php';
Once kettle is in place, you can run ./kettle pop:init command to initialize your application.
Testing the App#
If your app was installed as a web application, you can start the development server and visit the index page:
./kettle web:serve
Go to http://localhost:8000 in a browser and you should see the application start screen.
If you chose a stand-alone CLI application, you can test that via:
cd script
./app help
Kettle Help#
./kettle help prints every command the tool exposes, and ./kettle help <command> narrows it to one.
See Also#
- Requirements — PHP version, enforced extensions, and the optional ones
- Configuration — the config array,
.env, and the environment helpers - Application Structure — what
pop:initwrites, directory by directory - Your First Application — scaffold, route, controller, view, browser
- pop-kettle README — the full command surface