PHPackages                             headio/phalcon-bootstrap - 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. [CLI &amp; Console](/categories/cli)
4. /
5. headio/phalcon-bootstrap

ActiveLibrary[CLI &amp; Console](/categories/cli)

headio/phalcon-bootstrap
========================

A flexible application bootstrap for phalcon projects.

v3.1.0(4y ago)434221MITPHPPHP &gt;=8.0

Since Jan 29Pushed 4y ago1 watchersCompare

[ Source](https://github.com/headio/phalcon-bootstrap)[ Packagist](https://packagist.org/packages/headio/phalcon-bootstrap)[ RSS](/packages/headio-phalcon-bootstrap/feed)WikiDiscussions 5.x Synced 3w ago

READMEChangelogDependencies (10)Versions (24)Used By (1)

Phalcon application bootstrap
=============================

[](#phalcon-application-bootstrap)

A flexible application bootstrap for Phalcon-based projects

[![Build Status](https://camo.githubusercontent.com/c5ee8763a716cb505b302e7c198199319b7075119c75b544be3ef82cfac5bbe2/68747470733a2f2f7472617669732d63692e636f6d2f68656164696f2f7068616c636f6e2d626f6f7473747261702e7376673f6272616e63683d352e78)](https://travis-ci.com/headio/phalcon-bootstrap) [![Coverage Status](https://camo.githubusercontent.com/316097029705ee321f70726530042175dfa1639dc931cc731576ffc01a101624/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f68656164696f2f7068616c636f6e2d626f6f7473747261702f62616467652e7376673f6272616e63683d352e78)](https://coveralls.io/github/headio/phalcon-bootstrap?branch=5.x)

Description
-----------

[](#description)

This library provides flexible application bootstrapping, encapsulating module registration (or handler registration for micro applications), event management and middleware logic assignment for mvc, micro and cli-based applications. A simple factory instantiates the dependency injection container, encapsulating the registration of service dependency definitions defined in the configuration setttings.

Dependencies
------------

[](#dependencies)

- PHP &gt;=8.0
- Phalcon &gt;=5.0.0

See composer.json for more details

Installation
------------

[](#installation)

### Composer

[](#composer)

Open a terminal window and run:

```
composer require headio/phalcon-bootstrap
```

Usage
-----

[](#usage)

### Micro applications (Api, prototype or micro service)

[](#micro-applications-api-prototype-or-micro-service)

First create a config definition file inside your Phalcon project. This file should include the configuration settings, service &amp; middleware definitions and a path to your handlers.

To get started, let's assume the following project structure:

```
├── public
│   ├── index.php
├── src
│   ├── Config
│   │    │── Config.php
│   │    │── Handlers.php
│   │── Controller
│   │── Domain
│   │── Middleware
│   │── Service
│   │── Var
│   │    │── Log
├── tests
├── vendor
├── Boot.php
├── codeception.yml
├── composer.json
├── .gitignore
├── README.md
└── .travis.yml
```

and your PSR-4 autoload declaration is:

```
{
    "autoload": {
        "psr-4": {
            "Foo\\": "src/"
        }
    }
}
```

Create a config file **Config.php** inside the **Config** directory and copy-&amp;-paste the following definition:

```
