2017 © Pedro Peláez
 

library minimalfw

PHP performance-oriented framework

image

minimalfw/minimalfw

PHP performance-oriented framework

  • Wednesday, May 10, 2017
  • by marco476
  • Repository
  • 1 Watchers
  • 2 Stars
  • 17 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 30 Versions
  • 0 % Grown

The README.md

Packagist Code Climate Issue Count PHP Version Packagist, (*1)

MinimalFw - PHP performance-oriented framework

MinimalFw is a PHP performance-oriented framework., (*2)

Installation

You can install it with Composer:, (*3)

composer require minimalfw/minimalfw

Configuration

Configure your front-controller page (assumed index.php) it's extreme simple:, (*4)

<?php
//Into web/index.php
require_once __DIR__ . '/../vendor/autoload.php';

use Kernel\Kernel;
use Providers\AdminProviders;
use Providers\TemplateEngine\TemplateEngine;

//Set TemplateEngine provider. See next chapter.
AdminProviders::setProvider(new TemplateEngine(), array(
    'name' => TemplateEngine::TWIG,
    'cache' => false
));

$kernel = new Kernel();
$kernel->start();

Providers

Template Engine

The setProvider AdminProviders's static method set a provider. The only one provider that (for now!) you can use is TemplateEngine. You can pass an istance of TemplateEngine as first argument, and an array of options as second argument. This array must include the name key, that specific the name engine:, (*5)

  • Twig - TemplateEngine::TWIG
  • Smarty - TemplateEngine::SMARTY
  • Base (default) - TemplateEngine::BASE

In Twig (only, at the moment) you can set another keys in the options array (you can see this list): * debug * charset * strict_variables * autoescape * optimizations, (*6)

You can also use the key cache and set it to true or false, for enable or disable cache in Twig and Smarty., (*7)

Note: for Smarty, the config directory is in src/Views/smartyConfig, (*8)

Routing

MinimalFw implements marco476/routing-manager repository as routing manager. For use it, you must set your routes in YML config file named routes.yml into config directory (from the document root)., (*9)

See an example:, (*10)

 #Into config/routes.yml
homepage: #Name route
    expression: / #Route matchable with URI
    controller: IndexController #Controller invoked if matched
    action:     showHomeAction #Action invoked if matched
    params:     [extraParams] #Extra params for controller

Controller and Views

All controller must be insert in src/Controller and use PSR-4 rules., (*11)

All views must be insert in src/Views., (*12)

See an example for create a controller:, (*13)

<?php
namespace Controller;
use Providers\TemplateEngine\Engine\EngineInterface;

class IndexController
{
    //$params is setting by route settings. 
    //$template is a template engine.
    public function showHomeAction(array $params, EngineInterface $template)
    {
        $template->assign('friend', array(
            'name'      => 'Marco',
            'gender'    => 'male'
        ));

        $template->render('test.twig'); //Single render
        $template->render(array('primo.twig', 'secondo.twig')); //Multi render
    }
}

A controller have two arguments: an array of options, setted by setRoutes for any route, and a instance of template engine. Whether template engine you use, you can use a assign method for assign variables from PHP to template, and render method, for view one (as a string) or multi (as an array, included with FIFO approach) templates., (*14)

Filesystem Cache

MinimalFw implements minimalfw/filesystemCache repository for filesystem cache., (*15)

Server web

For enable the front-controller and redirect all URL on it, you must change your web server's configure. With Apache, you can use a mod_rewrite module for rewrite all URL and redirect in your front-controller:, (*16)

<IfModule mod_rewrite.c>
    RewriteEngine On

    RewriteRule ^(.*)$ /web/index.php [L]
</IfModule>

The Versions

10/05 2017

dev-master

9999999-dev

PHP performance-oriented framework

  Sources   Download

MIT

The Requires

 

The Development Requires

by Marco Cante

minimal minimal framework

10/05 2017

0.11.2

0.11.2.0

PHP performance-oriented framework

  Sources   Download

MIT

The Requires

 

The Development Requires

by Marco Cante

minimal minimal framework

04/03 2017

0.11.1

0.11.1.0

PHP performance-oriented framework

  Sources   Download

MIT

The Requires

 

The Development Requires

by Marco Cante

minimal minimal framework

25/02 2017

0.11.0

0.11.0.0

PHP performance-oriented framework

  Sources   Download

MIT

The Requires

 

The Development Requires

by Marco Cante

minimal minimal framework

24/02 2017

0.10.2

0.10.2.0

PHP performance-oriented framework

  Sources   Download

MIT

The Requires

  • php >=5.3.3
  • minimalfw/filesystem-cache >=1.0.0

 

The Development Requires

by Marco Cante

minimal minimal framework

23/02 2017

0.10.1

0.10.1.0

PHP performance-oriented framework

  Sources   Download

MIT

The Requires

  • php >=5.3.3
  • minimalfw/filesystem-cache >=1.0.0

 

The Development Requires

by Marco Cante

minimal minimal framework

23/02 2017

0.10.0

0.10.0.0

PHP performance-oriented framework

  Sources   Download

MIT

The Requires

  • php >=5.3.3
  • minimalfw/filesystem-cache >=1.0.0

 

The Development Requires

by Marco Cante

minimal minimal framework

22/02 2017

0.9.4

0.9.4.0

PHP performance-oriented framework

  Sources   Download

MIT

The Requires

  • php >=5.3
  • minimalfw/filesystem-cache >=1.0.0

 

The Development Requires

by Marco Cante

minimal minimal framework

20/02 2017

0.9.3

0.9.3.0

PHP performance-oriented framework

  Sources   Download

MIT

The Requires

  • php >=5.3
  • minimalfw/filesystem-cache >=1.0.0

 

by Marco Cante

minimal minimal framework

20/02 2017

0.9.2

0.9.2.0

PHP performance-oriented framework

  Sources   Download

MIT

The Requires

  • php >=5.3
  • minimalfw/filesystem-cache >=1.0.0

 

by Marco Cante

minimal minimal framework

20/02 2017

0.9.1

0.9.1.0

PHP performance-oriented framework

  Sources   Download

MIT

The Requires

  • php >=5.3
  • minimalfw/filesystem-cache >=1.0.0

 

by Marco Cante

minimal minimal framework

18/02 2017

0.9.0

0.9.0.0

PHP performance-oriented framework

  Sources   Download

MIT

The Requires

  • php >=5.3
  • minimalfw/filesystem-cache >=1.0.0

 

by Marco Cante

minimal minimal framework

17/02 2017

0.8.0

0.8.0.0

PHP performance-oriented framework

  Sources   Download

MIT

The Requires

  • php >=5.3

 

by Marco Cante

minimal minimal framework

16/02 2017

0.7.1

0.7.1.0

PHP performance-oriented framework

  Sources   Download

MIT

The Requires

  • php >=5.3

 

by Marco Cante

minimal minimal framework

16/02 2017

0.7.0

0.7.0.0

PHP performance-oriented framework

  Sources   Download

MIT

The Requires

  • php >=5.3

 

by Marco Cante

minimal minimal framework

13/02 2017

0.6.0

0.6.0.0

PHP performance-oriented framework

  Sources   Download

MIT

The Requires

  • php >=5.3

 

by Marco Cante

minimal minimal framework

13/02 2017

0.5.5

0.5.5.0

PHP performance-oriented framework

  Sources   Download

MIT

The Requires

  • php >=7.0.0

 

by Marco Cante

minimal minimal framework

13/02 2017

0.5.4

0.5.4.0

PHP performance-oriented framework

  Sources   Download

MIT

The Requires

  • php >=7.0.0

 

by Marco Cante

minimal minimal framework

12/02 2017

0.5.3

0.5.3.0

PHP performance-oriented framework

  Sources   Download

MIT

The Requires

  • php >=7.0.0

 

by Marco Cante

minimal minimal framework

12/02 2017

0.5.2

0.5.2.0

PHP performance-oriented framework

  Sources   Download

MIT

The Requires

 

by Marco Cante

minimal minimal framework

12/02 2017

0.5.1

0.5.1.0

PHP performance-oriented framework

  Sources   Download

MIT

The Requires

 

by Marco Cante

minimal minimal framework

08/02 2017

0.5.0

0.5.0.0

PHP performance-oriented framework

  Sources   Download

MIT

The Requires

  • php >=7.0.0

 

by Marco Cante

minimal minimal framework

07/02 2017

0.4.0

0.4.0.0

Minimal framework per piccoli progetti

  Sources   Download

MIT

The Requires

  • php >=7.0.0

 

by Marco Cante

minimal minimal framework

02/02 2017

0.3.1

0.3.1.0

Minimal framework per piccoli progetti

  Sources   Download

MIT

The Requires

  • php >=7.0.0

 

by Marco Cante

minimal minimal framework

02/02 2017

0.3.0

0.3.0.0

Minimal framework per piccoli progetti

  Sources   Download

MIT

The Requires

  • php >=7.0.0

 

by Marco Cante

minimal minimal framework

30/01 2017

0.2.0

0.2.0.0

Minimal framework per piccoli progetti

  Sources   Download

MIT

The Requires

  • php >=7.0.0

 

by Marco Cante

minimal minimal framework

28/01 2017

0.1.3

0.1.3.0

Minimal framework per piccoli progetti

  Sources   Download

MIT

The Requires

  • php >=7.0.0

 

by Marco Cante

minimal minimal framework

28/01 2017

0.1.2

0.1.2.0

Minimal framework per piccoli progetti

  Sources   Download

MIT

The Requires

  • php >=7.0.0

 

by Marco Cante

minimal minimal framework

28/01 2017

0.1.1

0.1.1.0

Minimal framework per piccoli progetti

  Sources   Download

MIT

The Requires

  • php >=7.0.0

 

by Marco Cante

minimal minimal framework

28/01 2017

0.1.0

0.1.0.0

Minimal framework per piccoli progetti

  Sources   Download

MIT

The Requires

  • php >=7.0.0

 

by Marco Cante

minimal minimal framework