PHPackages                             boneframework/skeleton - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. boneframework/skeleton

ActiveLibrary[Framework](/categories/framework)

boneframework/skeleton
======================

Bone Framework

v3.11.12(4mo ago)215MITJavaScriptPHP ^8.2CI passing

Since Sep 13Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/boneframework/skeleton)[ Packagist](https://packagist.org/packages/boneframework/skeleton)[ Docs](https://github.com/boneframework)[ RSS](/packages/boneframework-skeleton/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (5)Versions (106)Used By (0)

bone framework
==============

[](#bone-framework)

[![Latest Stable Version](https://camo.githubusercontent.com/8b6c0c1b097bac36558af9c066f25674f1afd3bb938e072ae76d3d264e241930/68747470733a2f2f706f7365722e707567782e6f72672f626f6e656672616d65776f726b2f736b656c65746f6e2f762f737461626c65)](https://packagist.org/packages/delboy1978uk/boneframework) [![Total Downloads](https://camo.githubusercontent.com/63583be3a55240ac77255baf2e9c9beaa27a167218fccc75196f6b75ccd0b71f/68747470733a2f2f706f7365722e707567782e6f72672f626f6e656672616d65776f726b2f736b656c65746f6e2f646f776e6c6f616473)](https://packagist.org/packages/boneframework/skeleton) [![License](https://camo.githubusercontent.com/b3577d8dea54590cd620b9028d54646bf378de57d1a81cb7bfd88eb71a36b69d/68747470733a2f2f706f7365722e707567782e6f72672f64656c626f7931393738756b2f626f6e656672616d65776f726b2f6c6963656e7365)](https://packagist.org/packages/delboy1978uk/boneframework)
[![build status](https://github.com/boneframework/skeleton/actions/workflows/master.yml/badge.svg)](https://github.com/boneframework/skeleton/actions/workflows/master.yml/badge.svg) [![Code Coverage](https://camo.githubusercontent.com/c3ce97767ec87e37bda20ebf306f256a72057f83304dc53066d6750d46f9a705/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f626f6e656672616d65776f726b2f736b656c65746f6e2f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/boneframework/skeleton/?branch=master) [![Scrutinizer Code Quality](https://camo.githubusercontent.com/d70f36a5598e135d3e74bf43887bfc3b8525873b13289e8bccbfd8c068bd736c/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f626f6e656672616d65776f726b2f736b656c65746f6e2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/boneframework/skeleton/?branch=master)
Be ye wantin a PHP framework peppered with local pirate lingo?
It be the most fearsome framework in the seven seas!

features
--------

[](#features)

- PSR-7 http messaging
- PSR-11 dependency injection container configuration
- PSR-15 middleware routing
- i18n translator
- Self contained package based architecture
- Built in optional Docker dev environment
- Extendable Command Line Interface

installation
------------

[](#installation)

#### via composer

[](#via-composer)

We recommend using our Docker environment, however you can use your own setup, install via composer:

```
composer create-project boneframework/skeleton your/path/here
cp your/path/here/.env.example your/path/here/.env

```

#### via docker

[](#via-docker)

The Docker dev environment saves you from all the usual devops nonsense. Clone `boneframework/lamp`, then replace the code folder `boneframework/skeleton`, then start it up.

```
git clone https://github.com/boneframework/lamp myproject
cd myproject
rm -fr code  // remove lamp stack default placeholder page
git clone https://github.com/boneframework/skeleton code
cp code/.env.example code .env
bin/setdomain yourdomain.com  // optional, default dev domain is boneframework.docker

```

Add `127.0.0.1 boneframework.docker` to your `/etc/hosts` (or your custom domain). To start the docker server environment:

```
bin/start

```

Then browse to `https://boneframework.docker`, and you will see the site running.

The development also has Mailhog running at `http://boneframework.docker:8025`, so you can configure any dev emails to use SMTP port `1025` and all outgoing mails will appear in the Mailhog outbox.

MariaDB is running, on host `mariadb` (see `docker-compose.yml`), and `config/bone-db.php`).

To "SSH" into your server in order to run PHP commands like composer etc, type the following in a fresh terminal window.

```
bin/terminal php       // for the PHP container
bin/terminal mariadb   // for the DB container

```

To shut down your server, CTRL-C out, then type `bin/stop`.

a quick introduction to bone framework
--------------------------------------

[](#a-quick-introduction-to-bone-framework)

#### skeleton project files

[](#skeleton-project-files)

There are a few folders and files in your project, here's a quick description:

- config (Configuration for your application)
- data (Files your project will use (translations, cache, uploads, etc))
- public (The usual index.php endpoint and front end assets like css and images and js)
- src (Your application packages live in here)
- tests (Because it's nice knowing your code works)
- vendor (Third party composer libs, don't edit, don't commit!)

#### bone framework application cycle

[](#bone-framework-application-cycle)

Upon launching Bone Framework (`public/index.php`), the application does a few things:

- Starts a session
- Loads the config from the config folder (different folders for different environments can be used, or environment vars)
- Registers bone framework core packages
- Registers packages from the `config/packages.php` into the DI container
- Adds any site wide middleware configured in `config/middleware.php`
- Dispatches a Request, returns a Response

config
------

[](#config)

You can drop in any number of `.php` files into the `config/` folder. Make sure they return an array with the config . You can override configuration based on environment var `APPLICATION_ENV`, so for instance if the environment was production it would load the additional config the production subdirectory.

There are several config files included, some are for optional bone packages and may be removed :

```
bone-db.php
bone-firewall.php
bone-i18n.php
bone-log.php
layouts.php
middleware.php
packages.php
paginator.php
paths.php
site.php
views.php

```

In your config files, you can add anything you want.

the package class
-----------------

[](#the-package-class)

Packages are a key component in a Bone Framework application. You will see in the `config/packages.php`which Packages are currently running on the framework. Take note that the order is important, as packages may have a dependency which it needs defined from another package. Have a look inside `src/App/AppPackage.php`:

```
