daily-five / framework
This is a basic php Framework
Requires
- php: >=7.1.3
- ext-mbstring: *
- ext-pdo: *
- illuminate/support: ^5.8
- league/flysystem: ^1.0
- monolog/monolog: ^1.24
- pimple/pimple: ^3.2
- symfony/dotenv: ^4.2
- symfony/http-kernel: ^4.2
- symfony/routing: ^4.2
- symfony/validator: ^4.2
Requires (Dev)
- phpunit/phpunit: ^7.0
- squizlabs/php_codesniffer: 3.*
- symfony/var-dumper: ^4.2
README
>The Framework is in an early stage of development. So, don't use it in a production system. Contributors are welcome.
Yes, it is another lighweight php framework! The DailyFive framework is inspired by the silex and laravel framework. It is build with Symfony Components and Pimple.
The main goal of the framework is an easy to read, develop and testable application structure.
Who should not use the Farmework?
If you want to rapidly prototype an application, don't use this framework. For this purpose use an other framework like laravel.
Table of contents
Installation
Install daily-five framework with Composer
composer require daily-five/framework
If you have permission problems at installation, try this solution
Documentation
Usage
This is a very basic Hello World! example.
Create a new file called index.php
<?php
require_once __DIR__.'/vendor/autoload.php';
// Create a Controller
class HomeController extends \DailyFive\Controller\BasicController
{
protected $msg;
public function __construct($msg)
{
$this->msg = $msg;
}
public function index()
{
return $this->response($this->msg);
}
}
// New Application instance
$app = new \DailyFive\Application();
// Register Service Providers
$app->register(new \DailyFive\Provider\LoggerServiceProvider());
$app['msg'] = 'Hello World';
// Register controller
$app[HomeController::class] = function ($app) {
return new HomeController($app['msg']);
};
// Register Middleware
$app->addMiddleware('logger', function ($app) {
return new \DailyFive\Middleware\LoggerMiddleware(
$app['logger']
);
});
// Register Routes
$app->get('/', 'HomeController::index', array('middleware' => array('logger')));
// Run Application
$app->run();
Service Providers
Available Service Providers
Tests
To run the test suite, you need Composer and PHPUnit:
composer install
vendor/bin/phpunit
Contribution
Any type of feedback, pull request or issue is welcome.
We use the PHP_CodeSniffer to check for Coding Standard Issues.
Check Coding Standard
vendor/bin/phpcs --standard=PSR1,PSR2,PSR12 --colors src
Fix Errors Automatically
vendor/bin/phpcbf --standard=PSR1,PSR2,PSR12 src
License
The DailyFive Framework is licensed under the MIT license.