Blink is a micro web framework for building long-running and high performance services

Overview

Blink - A high performance web framework and application server in PHP

Build Status Latest Stable Version Latest Unstable Version

Blink is a micro web framework for building long-running and high performance services, the design heavily inspired by Yii2 and Laravel. Blink aims to provide the most expressive and elegant API and try to make the experience of web development as pleasant as possible.

Besides, Blink is also an application server that can serve requests directly in PHP, without php-fpm or Apache's mod_php. we use the Swoole extension as the underlying networking library. This can easily make our PHP application 100% faster in just a blink.

Community

  • Gitter (Worldwide): Join the chat at https://gitter.im/bixuehujin/blink
  • QQ群 (China): 114632054 (暗号: blink)

Why build this?

In php-fpm or mod_php, all resources like objects and database connections only live within a single request, all these resources will be freed once the request terminates. This works fine with simple applications without much traffic, but for large scale applications, the performance impact of reallocating resources on every request is really huge.

Because of this, we are always trying to find a way to reduce unnecessary resources reallocating on every request, and I'm finally very glad to announce that Blink is exactly the answer!

Features

  • Powered by Swoole, serve requests in PHP directly
  • Dependency Injection & Service Locator
  • Routing for Restful APIs
  • Authentication & Authorization abstraction
  • Session Management abstraction
  • Middleware support for Request and Response
  • Plugins support
  • PHPUnit integration for unit tests

Installation

Install the latest version with

composer create-project --prefer-dist blink/seed your-app

Documentation

Blink is fully documented in both English and Chinese:

For the documentation of v0.3, please visit https://docs.rethinkphp.com/blink-framework/v0.3/

Related Projects

Participating

Blink is still in active development, so your participation is very welcome!

You may participate in the following ways:

Author

Follow me on Twitter or Weibo (Mainland China) to receive news and updates about the framework.

License

The Blink framework is open-sourced software licensed under the MIT license

You might also like...
Larasymf - mini framework for medium sized projects based on laravel and symfony packages

Larasymf, PHP Framework Larasymf, as its says is a mini framework for medium sized projects based on laravel and symfony packages We have not yet writ

The Laravel Lumen Framework.

Lumen PHP Framework Laravel Lumen is a stunningly fast PHP micro-framework for building web applications with expressive, elegant syntax. We believe d

Slim Framework 4 Skeleton Application

Slim Framework 4 Skeleton Application Use this skeleton application to quickly setup and start working on a new Slim Framework 4 application. This app

PHP微服务框架即Micro Service Framework For PHP
PHP微服务框架即Micro Service Framework For PHP

Micro Service Framework For PHP PHP微服务框架即“Micro Service Framework For PHP”,是Camera360社区服务器端团队基于Swoole自主研发现代化的PHP协程服务框架,简称msf或者php-msf,是Swoole的工程级企业应用框

A PHP client for (Spring Cloud) Netflix Eureka service registration and discovery.

PHP Netflix Eureka Client A PHP client for (Spring Cloud) Netflix Eureka service registration and discovery. Installation You can install this package

High-Performance Long-Living PHP Framework for modern enterprise application development
High-Performance Long-Living PHP Framework for modern enterprise application development

Documentation · Discord · Telegram · Twitter Spiral Framework is a High-Performance Long-Living Full-Stack framework and group of over sixty PSR-compa

Kit is a lightweight, high-performance and event-driven web services framework that provides core components such as config, container, http, log and route.

Kit What is it Kit is a lightweight, high-performance and event-driven web services framework that provides core components such as config, container,

Durable workflow engine that allows users to write long running persistent distributed workflows in PHP powered by Laravel queues

Durable workflow engine that allows users to write long running persistent distributed workflows (orchestrations) in PHP powered by Laravel queues. Inspired by Temporal and Azure Durable Functions.

A cross-language remote procedure call(RPC) framework for rapid development of high performance distributed services.

Motan Overview Motan is a cross-language remote procedure call(RPC) framework for rapid development of high performance distributed services. Related

Motan - a cross-language remote procedure call(RPC) framework for rapid development of high performance distributed services

Motan-PHP Overview Motan is a cross-language remote procedure call(RPC) framework for rapid development of high performance distributed services.

Notejam demo application using Blink framework

Notejam: Blink framework Notejam demo application using Blink framework Installation Clone the repository to you machine. Run vagrant up to create the

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

An application for building micro-services in PHP ^8.

Restolia An application for building micro-services in PHP ^8. Install composer create-project restolia/restolia my-app Services Each service lives i

Leaf's very own high-speed, high-performance server
Leaf's very own high-speed, high-performance server

[WIP] Leaf Eien Server Eien is Leaf's implementation of a high-speed, high-performance server based on powerful tools like Open Swoole and Swoole. Eie

Some Joomla! 4.x Web Services Api Examples and Experiments to raise the level of awareness of the huge potiental of Joomla! 4.x Web Services.

j4x-api-examples WHY? If you are a Joomla! developer or want to become a Joomla! developer there is a new resource for you The Official New Joomla! Ma

Biny is a tiny, high-performance PHP framework for web applications

Biny is high performance. Framework comes default with response time of less than 1ms. Stand-alone QPS easily up to 3000.

Spiral Framework is a High-Performance PHP/Go Full-Stack framework and group of over sixty PSR-compatible components
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.

Tars is a high-performance RPC framework based on name service and Tars protocol, also integrated administration platform, and implemented hosting-service via flexible schedule.

TARS - A Linux Foundation Project TARS Foundation Official Website TARS Project Official Website WeChat Group: TARS01 WeChat Offical Account: TarsClou

ExEngine is an ultra lightweight micro-services framework for PHP 5.6+

ExEngine is an ultra lightweight micro-services framework for PHP 5.6+. Documentation Checkout the Wiki. Examples Click here to browse examples, also

Releases(v0.4.1)
  • v0.4.1(Jul 28, 2019)

    I am very pleased to announce the release of Blink version 0.4.1, Version 0.4.1 is a minor release of Blink framework that brings several improvements, the following is the changelog:

    • New: Added a Cors middleware for Cross-Origin handling
    • New: Added CookieAuthenticator to set cookie automatically
    • New: Added Request::ip() method to get client IP address
    • New: Added support to retrieve routing parameters through $request->getAttribute('routing')
    • Enh: Upgraded the version of Symfony/Console and psysh
    • Enh: Added the support of PHPUnit 6 and above
    • Bug: Fixed https may not be detected correctly
    • Bug: Fixed the errors on bootstrapping would never return to the client
    • Bug: Fixed Service related command not booted automatically
    • Bug: Fixed unable to Set-Cookie multiple times on SwServer
    Source code(tar.gz)
    Source code(zip)
  • v0.4.0(Jun 23, 2018)

    I am very pleased to announce the release of Blink version 0.4.0. Please refer to the documentation to install or upgrade to this version.

    Version 0.4 is a major release of Blink framework that brings several new feature and improvements:

    1. Blink is now compatible with PSR-7

      With the PSR-7 support, it would be easier to integrate 3rd HTTP related libraries into Blink.

      Because Request::getBody() method is already taken in PSR-7, the original getBody() is renamed to getPayload().

    2. Environment configuration support

      Blink 0.4 introduced a dotenv alike mechanism to store environment specific or sensitive configurations, this helps us to build a unified approach to store these configurations in Blink applications.

    3. Service management utility

      Blink 0.4 introduced a service management utility to help us to run Blink application under systemd as system service.

    Here is the changelog of version 0.4.0:

    • New: Added ENV_FILE(like dotenv) support
    • New: Added service:install command to install blink app as a systemd service
    • New: Compatible with PHP 7.2
    • New: Added SwServer::$dispatchMode config to tune Swoole's dispatch_mode
    • New: Compatible with PSR-7 HTTP message interfaces
    • Chg: The Request::getParams() method will not convert special characters into _ any more, see here for more detail
    • Chg: The Swoole's dispatch_mode is changed to 3 by default
    • Chg: The original Response::getBody() is now renamed to Response::getPayload()
    • Chg: Removed PHP 5.6 support
    • Bug: Null should not be encoded in response
    Source code(tar.gz)
    Source code(zip)
  • v0.3.2(Apr 6, 2018)

    I am very pleased to announce the release of Blink version 0.3.2. Please refer to the documentation to install or upgrade to this version.

    Version 0.3.2 is a minor release of Blink framework that brings several improvements, the following is the changelog:

    • Enh: Bootstrap app automatically in console command
    • Enh: Fixed possible namespace confliction
    • Bug: Fixed duplicated Content-Length header with Swoole
    Source code(tar.gz)
    Source code(zip)
  • v0.3.1(Jul 15, 2017)

    I am very pleased to announce the release of Blink version 0.3.1. Please refer to the documentation to install or upgrade to this version.

    Version 0.3.1 is a minor release of Blink framework that brings several new feature and improvements, the following is the changelog:

    • New: Added CookieAuthenticator for cookie based session handling
    • New: Added blink\session\Manager::$sessionClass configuration to subclass Session class
    • Enh: Suppressed warning triggered by cli_set_process_title on macOS
    • Enh: Added $asArray parameter to RequestActor::asJson() to control json decoding
    • Enh: Improved Auth::who() to accept Session object as argument
    • Bug: Fixed routes lazy loading not working
    • Chg: Deprecated Request::$sessionKey configuration
    Source code(tar.gz)
    Source code(zip)
  • v0.3.0(Mar 19, 2017)

    I am very pleased to announce the release of Blink version 0.3.0. Please refer to the documentation to install or upgrade to this version.

    Version 0.3 is a major release of Blink framework that brings several new feature and improvements:

    1. Plugins Support

      Blink 0.3 introduced the concept of plugins, with the plugin support, it is possible to inject custom code at the application bootstrapping phase, such as registering services, adding routes. It brings possibilities to implement modules or reuse code in a better way.

    2. Route Group

      Blink 0.3 now implemented Route Group, It would be great for large projects to split routes into multiple groups, make the routes management more efficiently.

    3. RequestActor for API testing

      Blink 0.3 implemented RequestActor for API testing, it would make API testing more easier and fun.

    4. New server management commands

      Blink 0.3 introduced several server management command and enhanced server:serve to support live reloading.

    5. Integrated to PsySH

      Blink 0.3 now integrated PsySH, we can interact with Blink application with a simple ./blink shell command.

    Here is the changelog of version 0.3.0:

    • New: Added application plugins support
    • New: Added grouped routes support
    • New: Added RequestActor for easier functional testing cases
    • New: Integrated PsySH for better debug experience
    • New: Added CookieBag::all() to return all cookies
    • New: Added the new server management commands(server:start server:stop server:restart server:serve server:reload)
    • Enh: Better PHP7 exception support
    • Enh: Added Custom PID file path support
    • Enh: Improved automatically handling of Content-Type
    • Enh: Added SwServer::$outputBufferSize parameter
    • Enh: Improved Request::secure() to handle X-Forwarded-* headers
    • End: Improved live reload support
    • Chg: Removed php 5.5 support
    • Bug: Fixed "Expected array for frame 0" error for PHP7+Xdebug
    Source code(tar.gz)
    Source code(zip)
  • v0.2.1(Feb 3, 2016)

    I am very pleased to announce the 0.2.1 release of Blink Framework. Please refer to the documentation to install or upgrade to this version.

    Version 0.2.1 is a minor release of Blink framework that brings the following improvements:

    • Improved blink\session\Manager::get() with empty value
    • Improved support for PHP7
    • Added SwServer::$maxPackageLength configuration
    Source code(tar.gz)
    Source code(zip)
  • v0.2.0(Dec 5, 2015)

    I am very pleased to announce the release of Blink version 0.2.0. Please refer to the documetation to install or upgrade to this version.

    Version 0.2 is a major release of Blink framework that brings several new feature and improvements:

    1. Blink now is compatible with php-fpm and mod_php

      Blink 0.2.0 introduced CgiServer for php-fpm and mod_php, now it is possible to run your Blink application under php-fpm or Apache without changing a single line of code.

    2. Better support for non-API applications

      Blink 0.2.0 added support for cookie handling and request redirecting, it would be easier to adopt Blink for non-API applications.

    3. File uploading support

      Blink 0.2.0 implemented an unified file uploading API that compatible with both Swoole and CGI envrionment.

    Here is the changelog of version 0.2.0:

    • Bug #10: Fixed get body value with blink\http\Request::input()
    • Enh: Added blink\core\Application::currentRequest property
    • Enh: Added automatically session directory creation support
    • New: Added file uploading support
    • New: Added CgiServer for php-fpm or Apache's mod_php support
    • New: Added logger() helper function to get log service
    • New: Added file uploading support
    • New: Added Cookie handling support
    • New: Added blink\http\Request::redirect() method
    Source code(tar.gz)
    Source code(zip)
  • v0.1.0(Oct 19, 2015)

Owner
Jin Hu
Author of the Blink Framework, Creator of the @rethinkphp community.
Jin Hu
TidyPHP is a micro php framework to build web applications

TidyPHP is a micro MVC PHP Framework made to understand how PHP Frameworks work behind the scense and build fast and tidy php web applications.

Amin 15 Jul 28, 2022
🐺 Lightweight and easy to use framework for building web apps.

Wolff Web development made just right. Wolff is a ridiculously small and lightweight PHP framework, intended for those who want to build web applicati

Alejandro 216 Dec 8, 2022
[DEPRECATED -- Use Symfony instead] The PHP micro-framework based on the Symfony Components

Silex, a simple Web Framework WARNING: Silex is in maintenance mode only. Ends of life is set to June 2018. Read more on Symfony's blog. Silex is a PH

Silex 3.6k Dec 22, 2022
A resource-oriented micro PHP framework

Bullet Bullet is a resource-oriented micro PHP framework built around HTTP URIs. Bullet takes a unique functional-style approach to URL routing by par

Vance Lucas 415 Dec 27, 2022
Silly CLI micro-framework based on Symfony Console

currentMenu home Silly CLI micro-framework based on Symfony Console. Professional support for Silly is available via Tidelift Video introduction in fr

Matthieu Napoli 862 Dec 23, 2022
Lemon is php micro framework built for simple applications.

Lemon is simple micro framework that provides routing, etc.

Lemon 20 Dec 16, 2022
Frankie - A frankenstein micro-framework for PHP

Frankie - A frankenstein micro-framework for PHP Features Frankie is a micro-framework focused on annotation. The goal is to use annotation in order t

null 19 Dec 10, 2020
REST-like PHP micro-framework.

Phprest Description REST-like PHP micro-framework. It's based on the Proton (StackPhp compatible) micro-framework. Phprest gives you only the very bas

Phprest 312 Dec 30, 2022
⚡ Flat-files and plain-old PHP functions rockin'on as a set of general purpose high-level abstractions.

Siler is a set of general purpose high-level abstractions aiming an API for declarative programming in PHP. ?? Files and functions as first-class citi

Leo Cavalcante 1.1k Dec 30, 2022
StackSync is a simple, lightweight and native fullstack PHP mini-framework.

StackSync is a fullstack PHP mini framework, with an MVC structure, custom API system with a Middleware and JWT authentication, components based views, flexible routing, PSR4 autoloading. Essential files generation (migrations, seeders, controllers and models) and other operations can be executed through custom commands.

Khomsi Adam 3 Jul 24, 2022