The PPI Framework Engine

Related tags

Frameworks framework
Overview

PPI Framework

Gitter Latest Stable Version Latest Unstable Version Travis-CI Build Status Scrutinizer Code Quality License

PPI is the PHP Interoperability Framework. It provides an equal and open platform to empower PHP developers to pick the best tools from the best PHP frameworks

PPI bootstraps framework components for you from the top frameworks such as ZendFramework2, Symfony2, Laravel4 and FuelPHP.

Requirements

  • PHP 5.4.0 or above

Installation

There is no actual "installation" of PPI, you can download it from http://www.ppi.io/downloads and drop it in your document root.

Contributing

PPI is an open source, community-driven project. If you'd like to contribute, check out our issues list. You can find us on IRC, Google Plus or Twitter (@ppi_framework).

If you're submitting a pull request, please do so on your own branch on GitHub.

Start by forking the PPI Framework repository and cloning your fork locally:

$ git clone [email protected]:YOUR_USERNAME/framework.git
$ git remote add upstream git://github.com/ppi/framework.git
$ git checkout -b feature/BRANCH_NAME master

Apply PPI Coding Standards using the PHP-CS-Fixer tool (uses PPI custom fixers):

$ ./vendor/bin/php-cs-fixer fix -v

After your work is finished rebase the feature branch and push it:

$ git checkout master
$ git fetch upstream
$ git merge upstream/master
$ git checkout feature/BRANCH_NAME
$ git rebase master
$ git push --force origin feature/BRANCH_NAME

Go to GitHub again and make a pull request on the ppi/framework repository. Thank you for making PPI better!

Comments
  • New Config System

    New Config System

    Looking to re-use an existing component library if its simple and fast enough then we can cherry-pick from it.

    Usually PPI doesn't need all the fancy features from configuration that zf/symfony ship with. In the past this has lead PPI to create a similar but very trimmed down and faster version.

    This is no longer a project goal for PPI to make its own components completely so re-using existing code is important.

    The wiki for this part of the system is here: https://github.com/ppi/framework/wiki/PPI-v2-Configuration

    ** Please read the wiki document before commenting on this discussion

    opened by dragoonis 27
  • PPI Logger

    PPI Logger

    We need a logging class. Does it deserve to be its own component ?

    My initial use case for this internally is to throw a deprecated notice for functionality that we want to phase out gradually.

    More thoughts required here

    @BenTheDesigner you built the exception component.. any thoughts here?

    Needs Docs Logging High Priority 
    opened by dragoonis 15
  • PPI should support Mustaches!

    PPI should support Mustaches!

    I've gone and done the hard work for you:

    https://github.com/bobthecow/mustache.php

    https://github.com/bobthecow/BobthecowMustacheBundle

    If you don't beat me to it, I'll plug it in and send a pull request. But I'm super busy these days, so no promises :)

    task 
    opened by bobthecow 14
  • App and user-level configuration - v2.0

    App and user-level configuration - v2.0

    Current status

    User config comes from app.config.php

    Currently we load configuration from app/app.config.php:

    <?php
    $config = array(
        'environment'            => 'development',
        'templating.engines'     => array('php', 'smarty', 'twig'),
        'templating.globals'     => array(
            'ga_tracking' => 'UA-XXXXX-X'),
        'datasource.connections' => include (__DIR__ . '/datasource.config.php')
    );
    
    // Are we in debug mode ?
    if ($config['environment'] !== 'development') {
        $config['debug']     = $config['environment'] === 'development';
        $config['cache_dir'] = __DIR__ . '/cache';
    }
    return $config; // Very important
    

    Setting App properties is how we do this

    we let the user set App properties using magic setters after the PPI\App instance is created:

    $app = new PPI\App();
    $app->moduleConfig = include 'app/modules.config.php';
    $app->config = include 'app/app.config.php';
    
    // Do you want twig engine enabled?
    //$app->templatingEngine = 'twig';
    
    // If you are using the DataSource component, enable this
    $app->useDataSource = true;
    

    Everything is stored in AppOptions (aka ParameterBag)

    app and module configuration is store in App::$options['config'] and App::$options['moduleConfig'] respectively being $options an instance of PPI\ServiceManager\Options\AppOptions which is based on Symfony ParameterBag.

    Some ParameterBag characteristics:

    • Allows the usage of placeholders (example: %app.cache_dir%) which are later resolved.
    • All keys are lowercased ('moduleConfig' becomes 'moduleconfig').
    • It is not designed to store n-levels of config keys. One-level only.

    App internal configuration is also stored in AppOptions

    This means parameters that identify which class to use for a given component is stored alongside user configuration.

        'app.session.class'                  => 'Symfony\Component\HttpFoundation\Session\Session',
        'app.session.storage.class'      => 'Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage',
    

    Where to go now?

    • Should we store everything in the same AppOptions instance?
    • Should we allow users to set a App property like we do now or centralize all user configuration?
    • Can we work with a single-level (array deepness) implementation like ParameterBag. This class resolves placeholders automatically but only for root-level keys.
    Needs Docs High Priority 
    opened by vitorbrandao 11
  • Making PPI Module Routing Multi-Vendor

    Making PPI Module Routing Multi-Vendor

    One of the key points about PPI is to alleviate vendor-lockin. This means your PPI module can be using ZF2 routing, SF2 routing or li3 routing (to name a few).

    As demonstrated in this example, $module->getRoutes() will always return a symfony2 RouteCollection: https://github.com/ppi/skeletonapp/blob/master/modules/Application/Module.php#L18

    This is great as an initially working implementation, but the idea is to let the developer on a per-module basis choose which routing he/she wants.

    I'm keen to hear people's ideas/patterns on making an extensible matching system that will do, "oh this module is using symfony, lets ask symfony to match it", which is what it currently does. It must detect a Zend2 route collection and ask ZF2 to match it.. and so on.

    Routing Low Priority 
    opened by dragoonis 10
  • Cache component

    Cache component

    I am doing a quick review about the state of PHP caching libraries in order to build/integrate a cache component in PPI 2.1.

    @dragoonis has been moderating the PSR Cache Proposal for a while and should have a good background on this matter. The FIG has not yet reached a consensus about how the cache interface should look like.

    Following our approach of picking the best tool for the job I don't want to implement a Cache component and rather use a solid PHP library that already provides this functionality.

    After reading:

    • https://github.com/dragoonis/fig-standards/blob/master/proposed/psr-cache.md
    • https://github.com/symfony/symfony/pull/3211
    • https://github.com/symfony/symfony/pull/5902
    • https://groups.google.com/forum/#!topic/symfony-devs/EJr6XhawJTE
    • ...

    I've reached the conclusion the following are the most relevant PHP Cache libraries to build our component upon:

    What are your preferences? What libraries are missing from this list? Should we wait until FIG agrees on the Cache proposal?

    opened by vitorbrandao 9
  • Set up PPI\MicroApp

    Set up PPI\MicroApp

    This will allow closures against routes.

    You will still be able to talk to all standard components, use all functionality you'd expect from a controller, but no more routing since you specify it in your microapp call.

    Think of how to still access the service locator here, perhaps $app is still available and you can do $app->getService('UserStorage').

    task 
    opened by dragoonis 9
  • PPI SmartyEngine Plugin

    PPI SmartyEngine Plugin

    @noisebleed is interested in making a PPI Module for registering the SmartyEngine

    I have currently developed the code necessary for SmartyEngine. Futher development on this is required such as Extensions, Filters and Plugins for Smarty3 and I believe this is where @noisebleed comes in.

    Modules can create 'services' which are globally shared using the ServiceLocator.

    The default templating service is here: https://github.com/ppi/framework/blob/2.0/PPI/App.php#L198

    The modules can create their own service in their /modules/<module>/Module.php class on the initServices method. An example of this is here: https://github.com/ppi/skeletonapp/blob/2.0/modules/User/Module.php#L38

    Now any controller can perform $this->getService('mailerClass') if they wanted to.

    The SmartyEngine Module in question should register a 'templating' service key in its initServices method, holding an instance of PPI\Templating\Smarty\SmartyEngine.php

    An example of setting up SmartyEngine is here: https://github.com/ppi/framework/blob/2.0/PPI/App.php#L276 The code is also below for easy reference, the class names are 'use' statements at the top of PPI\App:

    <?php
    defined('SMARTY_DIR') || define('SMARTY_DIR', PPI_VENDOR_PATH . 'Smarty/');
    $smartyDriver = new \PPI\Templating\Smarty\Smarty();
    $engine = new SmartyEngine(
        $smartyDriver,
        new TemplateNameParser(),
        new FileSystemLoader($templateLocator)
    );
    
    opened by dragoonis 9
  • Modularity

    Modularity

    Big topic, going to be calling them 'Extensions' instead of Plugins/Modules..etc

    Trying to keep consistency with PHP project, since our names are similar.

    PHP Extension PPI Extension <-- consistency

    PPI's approach is to embrace, not replace so who's got the most effective but fast plugin system.

    How is SF2's ? (sfEvent)

    How is ZF2's ? (also, stability?)

    Who else has a good one?

    @seldaek are you good to elaborate on symfony here? @bittarman, @juozas being zf guys, are you yet aquiainted with v2?

    opened by dragoonis 9
  • New View Layer

    New View Layer

    Currently in PPI there is a PPI\View component.

    1. It supports specifying a 'layout file'.
    2. Then you have an 'action file' which is specified by your controller's action.
    3. You can pass parameters into your template process from the controller.
    4. You can pass options to the rendering process to tell it wether this is a 'parital' load, to just load the action file, or load the entire template as normal.
    5. It has multiple "Template Adapters" which consist of PHP, Smarty, Twig.

    I would much prefer to re-use an existing libraries implementation of the above, have something to connect my controller to.

    I looked at ZF2's View implementation, it looked a bit crazy and over-complicated, but maybe theres parts we can cherry pick ? What about symfony?

    opened by dragoonis 7
  • Composer Integration With Vendor Libraries

    Composer Integration With Vendor Libraries

    We need to be able to manage our vendor libraries in different versions, so that Composer can tie things up nicely.

    @elazar would you like to recap on what you discussed with me earlier? just detailing the high level steps required so we can get a discussion going, with say @seldaek ?

    • Paul.
    opened by dragoonis 7
  • [Create Module Wizard] Show proposed composer update calls

    [Create Module Wizard] Show proposed composer update calls

    When you request new technologies that aren't included, currently you're asked to manually run "compose require" commands.

    The suggested change, by @BenExile, is to inform the user that composer changes are going to be made and if they want PPI to run them for you, or you do it yourself.

    cd $appRoot && composer require <package>

    opened by dragoonis 0
  • Update controllers to received Request and Response PSR-7 objects so they can be used as middleware.

    Update controllers to received Request and Response PSR-7 objects so they can be used as middleware.

    https://github.com/ppi/framework/blob/master/src/Module/AbstractModule.php#L322

    and

    https://github.com/ppi/framework/blob/master/src/App.php#L293

    To test this Need to test this from SkeletonApp, by accepting a RequestInterface, ResponseInterface and then setting the body content of that PSR-7 object and then returning $response back from the controller action.

    opened by dragoonis 0
  • Support Module::getServiceConfig() returning a Configuration instance

    Support Module::getServiceConfig() returning a Configuration instance

    From http://framework.zend.com/manual/2.0/en/modules/zend.service-manager.quick-start.html#modules-as-service-providers

    Module Returning an Array

    The following demonstrates returning an array of configuration from a module class. It can be substantively the same as the array configuration from the previous example.

    namespace SomeModule;
    
    class Module
    {
        public function getServiceConfig()
        {
            return array(
                'abstract_factories' => array(),
                'aliases' => array(),
                'factories' => array(),
                'invokables' => array(),
                'services' => array(),
                'shared' => array(),
            );
        }
    }
    

    Returning a Configuration instance

    First, let’s create a class that holds configuration.

    namespace SomeModule\Service;
    
    use SomeModule\Authentication;
    use SomeModule\Form;
    use Zend\ServiceManager\Config;
    use Zend\ServiceManager\ServiceManager;
    
    class ServiceConfiguration extends Config
    {
        /**
         * This is hard-coded for brevity.
         */
        public function configureServiceManager(ServiceManager $serviceManager)
        {
            $serviceManager->setFactory('User', 'SomeModule\Service\UserFactory');
            $serviceManager->setFactory('UserForm', function ($serviceManager) {
                $form = new Form\User();
    
                // Retrieve a dependency from the service manager and inject it!
                $form->setInputFilter($serviceManager->get('UserInputFilter'));
                return $form;
            });
            $serviceManager->setInvokableClass('UserInputFilter', 'SomeModule\InputFilter\User');
            $serviceManager->setService('Auth', new Authentication\AuthenticationService());
            $serviceManager->setAlias('SomeModule\Model\User', 'User');
            $serviceManager->setAlias('AdminUser', 'User');
            $serviceManager->setAlias('SuperUser', 'AdminUser');
            $serviceManager->setShared('UserForm', false);
        }
    }
    

    Now, we’ll consume it from our Module.

    namespace SomeModule;
    
    // We could implement Zend\ModuleManager\Feature\ServiceProviderInterface.
    // However, the module manager will still find the method without doing so.
    class Module
    {
        public function getServiceConfig()
        {
            return new Service\ServiceConfiguration();
            // OR:
            // return 'SomeModule\Service\ServiceConfiguration';
        }
    }
    

    End of citation.

    We need to support all of these alternatives.

    High Priority 
    opened by vitorbrandao 5
Releases(2.1.2)
Owner
PPI Framework
PPI Framework
A static analysis engine

A static analysis engine... Usage: bin/tuli analyze file1 file2 path Installation Install it as a composer dependency!!! $ composer require ircmaxell

Anthony Ferrara 171 Jan 31, 2022
Pug template engine adapter for Slim

Pug for Slim For details about the template engine see phug-lang.com Installation Install with Composer: composer require pug/slim Usage with Slim 3 u

Pug PHP 5 May 18, 2022
CleverStyle Framework is simple, scalable, fast and secure full-stack PHP framework

CleverStyle Framework is simple, scalable, fast and secure full-stack PHP framework. It is free, Open Source and is distributed under Free Public Lice

Nazar Mokrynskyi 150 Apr 12, 2022
I made my own simple php framework inspired from laravel framework.

Simple MVC About Since 2019, I started learning the php programming language and have worked on many projects using the php framework. Laravel is one

null 14 Aug 14, 2022
PHPR or PHP Array Framework is a framework highly dependent to an array structure.

this is new repository for php-framework Introduction PHPR or PHP Array Framework is a framework highly dependent to an array structure. PHPR Framewor

Agung Zon Blade 2 Feb 12, 2022
I made my own simple php framework inspired from laravel framework.

Simple MVC About Since 2019, I started learning the php programming language and have worked on many projects using the php framework. Laravel is one

Rizky Alamsyah 14 Aug 14, 2022
Framework X – the simple and fast micro framework for building reactive web applications that run anywhere.

Framework X Framework X – the simple and fast micro framework for building reactive web applications that run anywhere. Quickstart Documentation Tests

Christian Lück 620 Jan 7, 2023
Framework X is a simple and fast micro framework based on PHP

Framework X is a simple and fast micro framework based on PHP. I've created a simple CRUD application to understand how it works. I used twig and I created a custom middleware to handle PUT, DELETE methods.

Mahmut Bayri 6 Oct 14, 2022
Spiral Framework is a High-Performance PHP/Go Full-Stack framework and group of over sixty PSR-compatible components

Spiral HTTP Application Skeleton Spiral Framework is a High-Performance PHP/Go Full-Stack framework and group of over sixty PSR-compatible components.

Spiral Scout 152 Dec 18, 2022
Sunhill Framework is a simple, fast, and powerful PHP App Development Framework

Sunhill Framework is a simple, fast, and powerful PHP App Development Framework that enables you to develop more modern applications by using MVC (Model - View - Controller) pattern.

Mehmet Selcuk Batal 3 Dec 29, 2022
A PHP framework for web artisans.

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

The Laravel Framework 72k Jan 7, 2023
The Symfony PHP framework

Symfony is a PHP framework for web and console applications and a set of reusable PHP components. Symfony is used by thousands of web applications (in

Symfony 27.8k Jan 2, 2023
Open Source PHP Framework (originally from EllisLab)

What is CodeIgniter CodeIgniter is an Application Development Framework - a toolkit - for people who build web sites using PHP. Its goal is to enable

B.C. Institute of Technology 18.2k Dec 29, 2022
Yii 2: The Fast, Secure and Professional PHP Framework

Yii 2 is a modern framework designed to be a solid foundation for your PHP application. It is fast, secure and efficient and works right out of the bo

Yii Software 14k Dec 31, 2022
CakePHP: The Rapid Development Framework for PHP - Official Repository

CakePHP is a rapid development framework for PHP which uses commonly known design patterns like Associative Data Mapping, Front Controller, and MVC. O

CakePHP 8.6k Dec 31, 2022
Slim is a PHP micro framework that helps you quickly write simple yet powerful web applications and APIs.

Slim Framework Slim is a PHP micro-framework that helps you quickly write simple yet powerful web applications and APIs. Installation It's recommended

Slim Framework 11.5k Jan 4, 2023
High performance, full-stack PHP framework delivered as a C extension.

Phalcon Framework Phalcon is an open source web framework delivered as a C extension for the PHP language providing high performance and lower resourc

The Phalcon PHP Framework 10.7k Jan 8, 2023
Official Zend Framework repository

Welcome to the Zend Framework 3.0 Release! RELEASE INFORMATION Zend Framework 3.0.1dev This is the first maintenance release for the Zend Framework 3

Zend Framework 5.6k Dec 29, 2022
🚀 PHP Microservice Full Coroutine Framework

PHP microservice coroutine framework 中文说明 Introduction Swoft is a PHP microservices coroutine framework based on the Swoole extension. Like Go, Swoft

Swoft Cloud 5.5k Dec 28, 2022