Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/dzooli/phalcon-appfactory
- Owner: dzooli
- Created: 2022-01-31T12:05:42.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2022-10-12T23:21:53.000Z (over 2 years ago)
- Last Synced: 2024-11-21T05:16:27.116Z (2 months ago)
- Topics: composer-library, composer-package, library, phalcon-framework, phalcon4, php, php-framework, php-library, php7
- Language: PHP
- Homepage:
- Size: 18.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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.