Getting Started

All you need to get started with BitFrame

Install

Prerequisites:

  1. PHP 7.1.0+
  2. Webserver with URL Rewriting (such as Apache or nginx)

How to Install BitFrame:

We recommend installing BitFrame using Composer. Simply navigate to your project directory in terminal/command line and run the following command:

composer require designcise/bitframe "^1.0.0"

Using Composer will download the BitFrame microframework and its dependencies into your project's vendor directory. You may include as many packages as you wish based on your project's requirements.

After BitFrame has been downloaded (typically into the vendor folder), you must require the Composer autoloader into your PHP script to be able to start using BitFrame:

<?php
require '../vendor/autoload.php';

If you do not wish to load development-specific dependencies, then you can append --no-dev to the above command.

In case you don't have Composer, you can either download the project directly or get Composer.

How to Install Project Dependencies:

In case your project has other dependencies, you can create a composer.json configuration file containing your project's dependencies (including BitFrame) in the root directory of your project, for example:

{
    "require": {
		"designcise/bitframe": "^1.0.0",
		"monolog/monolog": "^1.23.0"
	},
    "require-dev": {
        "phpunit/phpunit": "^6.4"
    }
}

Then from the command line/terminal find the directory where you saved the composer configuration file and run the following command:

composer install
Middlewares:

BitFrame leverages the PSR-15 request and response interfaces (and PSR-7 as a fallback). This means that you can use any PSR-7 / PSR-15 compatible middleware available on the Packagist. We've developed some essential PSR-15 packages that are typically used in api and web app development:

These can be added to BitFrame easily as per your project's need and are in no way a hard dependency. Also note that, besides these official packages, you can easily use any PSR-15 or PSR-7 based packages, or develop your own.

To add any of these packages to your project as a dependency, you need to include the ones you need, in your project's composer.json file. For example:

{
    "require": {
		"designcise/bitframe": "^1.0.0",
		
		"designcise/bitframe-whoops": "^1.0.0",
		"designcise/bitframe-fastroute": "^1.0.0",
		"designcise/bitframe-diactoros": "^1.0.0",
		
		"monolog/monolog": "^1.23.0"
	},
    "require-dev": {
        "phpunit/phpunit": "^6.4"
    }
}
Add-ons:

Add-ons are helper classes/traits, or classes that provide extended ability beyond what BitFrame provides out-of-the-box. For example; a template engine, cache manager, logger, event manager, etc. would all be add-ons. There's no special way or instruction to make an add-on, almost any class can easily be used as an add-on. This means that you can use any generic package available on the Packagist. We've developed the following essential add-ons that are typically used in api and web app development:

Comments

Let us know if you have something to say or add