Quick Setup

If you just want to clone a git repo and get going with Bullet, check out this bullet quickstart repository (thanks, Jannik Zappe!). It has all the steps below completed for you in a package that is ready to go.

Installing with Composer

Composer is the only supported way to install Bullet, and it is available on Packagist.

Use the composer basic usage guide, or follow the steps below:

Setup your composer.json file at the root of your project

    "require": {
        "vlucas/bulletphp": "*"

Install Composer

curl -s http://getcomposer.org/installer | php

Install Dependencies (will download Bullet and dependencies)

php composer.phar install

Create index.php in root directory (use the minimal example below to get started)

require __DIR__ . '/vendor/autoload.php';
// Your App
$app = new Bullet\App();
$app->path('/', function($request) {
    return "Hello World!";
// Run the app! (takes $method, $url or Bullet\Request object)
echo $app->run(new Bullet\Request());

Use an .htaccess file for mod_rewrite (if you’re using Apache)

<IfModule mod_rewrite.c>
  RewriteEngine On

  # Reroute any incoming requestst that is not an existing directory or file
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule ^(.*)$ index.php?u=$1 [L,QSA]

Now view it in your browser.

You should see “Hello World” in your browser if everything is working correctly.

Fork me on GitHub