Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/dzooli/phalcon-appfactory

Abstract application wrapper for Phalcon4 framework
https://github.com/dzooli/phalcon-appfactory

composer-library composer-package library phalcon-framework phalcon4 php php-framework php-library php7

Last synced: 2 days ago
JSON representation

Abstract application wrapper for Phalcon4 framework

Awesome Lists containing this project

README

        

# Application factories for the Phalcon framework

## Sonarcube analisys

[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=dzooli_phalcon-appfactory&metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=dzooli_phalcon-appfactory)
[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=dzooli_phalcon-appfactory&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=dzooli_phalcon-appfactory)
[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=dzooli_phalcon-appfactory&metric=bugs)](https://sonarcloud.io/summary/new_code?id=dzooli_phalcon-appfactory)
[![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=dzooli_phalcon-appfactory&metric=vulnerabilities)](https://sonarcloud.io/summary/new_code?id=dzooli_phalcon-appfactory)

## Description

Application skeleton for Phalcon CLI and Micro and API application. You can override the service and DI (and routes) configuration and just use your simple preconfigured application.

## Installation

```bash
composer config repositories.phalcon-appfactory vcs https://github.com/dzooli/phalcon-appfactory.git
composer require -o -vv dzooli/phalcon-appfactory:dev-master
```

## Usage

### Example for MicroAppFactory

Create your customized application factory:

```php
app;
$this->app->get('/', function () use ($app) {
echo $app['view']->render('index');
});
return $this;
}
}
```

And use it in your main program (such as `index.php`):

```php
createApp()
->addRoutes()
->getApp()
->handle($_SERVER['REQUEST_URI']);
} catch (\Exception $e) {
echo $e->getMessage() . '
';
echo '

' . $e->getTraceAsString() . '
';
}

```

## Contribution

Pull requests are welcome on the _develop_ branch.