PHPackages                             phossa2/framework - 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. phossa2/framework

ActiveProject[Framework](/categories/framework)

phossa2/framework
=================

A modern PHP framework built-upon configuration, dependency injection and middlewares.

117PHP

Since Oct 11Pushed 9y ago1 watchersCompare

[ Source](https://github.com/phossa2/framework)[ Packagist](https://packagist.org/packages/phossa2/framework)[ RSS](/packages/phossa2-framework/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

phossa2/framework
=================

[](#phossa2framework)

**phossa2/framework** is a modern PHP framework built-upon configuration, dependency injection and middlewares.

It requires PHP 5.4, supports PHP 7.0+ and HHVM. It is compliant with [PSR-1](http://www.php-fig.org/psr/psr-1/ "PSR-1: Basic Coding Standard"), [PSR-2](http://www.php-fig.org/psr/psr-2/ "PSR-2: Coding Style Guide"), [PSR-3](http://www.php-fig.org/psr/psr-3/ "PSR-3: Logger Interface"), [PSR-4](http://www.php-fig.org/psr/psr-4/ "PSR-4: Autoloader"), and other proposed PSR standards.

Create the project
------------------

[](#create-the-project)

Install via the `composer` utility.

```
# cd installation_dir/
# composer create-project phossa2/framework PROJECT
```

Directory structure
--------------------------------------------------

[](#directory-structure)

**phossa2/framework** is delivered with [the single server installation](#single)directory structure. It also can be restructured to fit different requirements by modifying directory settings in the [`.env`](#env) file.

- Single server installation

    Default framework distribution is for a single server installation.

    ```
    |--- .env                             the environment file
    +--- PROJECT/                         the project directory
          |--- phossa2                    the utility script
          |--- app/                       app installation dir
          |--- config/                    where all the config files located
          |--- plugin/                    where all the plugins installed
          |--- public/                    where public stuff located
          |      |--- asset/
          |      +--- index.php           single public entry
          |--- runtime/                   runtime related stuff
          |      |--- local/              host-specific storage
          |      |      |--- cache
          |      |      +--- session
          |      +--- log/                log file directory
          |--- system/                    system files
          |      +--- bootstrap.php       bootstrap file
          +--- vendor/                    third-party libs

    ```
- Multiple servers installation

    The framework can also be installed across multiple servers to provide capabilities such as load balancing, central app managment (NFS mounted) etc.

    ```
    |--- .env                             host-specific environments
    |--- local                            host-specific local storage
    |     |--- cache/
    |     +--- session/
    |
    |--- PROJECT/                         shared among servers (NFS mounted)
    |     |--- phossa2
    |     |--- app/
    |     |--- config/
    |     |--- plugin/
    |     |--- public/
    |     |--- system/
    |     +--- vendor/
    |
    +--- runtime/                         shared runtime stuff (NFS mounted)
          |--- log/host1                  host-specific log dir
          |--- upload/                    upload dir
          +--- static/                    generated static html files
    ```

Execution path
---------------------------------------------------

[](#execution-path)

- Application execution path

    1. `public/index.php`

    Single app entry point. Load [`system/bootstrap.php`](#bootstrap) file and then process the app middleware queue defined in `config/middleware.php`

    ```
