Giter Club home page Giter Club logo

framework's Introduction

Igni logo

Build Status Scrutinizer Code Quality Code Coverage

Igni is a mini php7 framework with modular architecture support that helps you quickly write scalable PSR-7 and PSR-15 compilant REST services.

<?php
require 'vendor/autoload.php';

use Igni\Http\Application;
use Igni\Http\Response;
use Psr\Http\Message\ServerRequestInterface as Request;

$application = new Application();

// Routing
$application->get('/hello/{name}', function (Request $request) : Response {
    return Response::fromText("Hello {$request->getAttribute('name')}.");
});

// Middleware
$application->use(function($request, $next) {
    $response = $next->handle($request);
    return $response->withAddedHeader('Version', $this->getConfig()->get('version'));
});

// Modules
$application->extend(new class implements ConfigProvider {
    public function provideConfig(Config $config): void {
        $config->set('version', '1.0');
    }
});

$application->run();

Installation and requirements

Recommended installation way of the Igni Framework is with composer:

composer install igniphp/framework

Requirements:

  • php 7.1 or better
  • swoole extension for build-in http server support

Features

Routing

Igni router is based on the fastest routing library (nikic/fastroute).

PSR-7, PSR-15 Support

Igni fully supports PSR message standards for both manipulating http response, request and http middlwares.

Dependency Injection and Autoresolving

Igni autoresolves dependencies for you and provides intuitive dependency container. It also allows you to use any PSR compatible container of your choice.

Modular architecture

Modular and scalable solution is one of the most important aspects why this framework was born. Simply create a module class, implement required interfaces and extend application by your module.

Performant, production ready http server

No nginx nor apache is required with Igni. Now you can run your php applications the same manner you run node application:

php examples/build_in_server_example.php

Igni http server is as fast as express.js application with almost 0 configuration.

Detailed documentation

Detailed documentation and more examples can be found here and in examples directory.

framework's People

Contributors

dkraczkowski avatar

Stargazers

markgiul avatar

Watchers

Massimiliano Arione avatar markgiul avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.