Crow PHP Web Framework: Microservice framework for PHP

Recommend this page to a friend!
  Info   View files Example   View files View files (62)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog (1)    
Last Updated Ratings Unique User Downloads Download Rankings
2021-04-15 (5 months ago) RSS 2.0 feedNot enough user ratingsTotal: 66 This week: 1All time: 9,895 This week: 184Up
Version License PHP version Categories
crowphp 1.0.0MIT/X Consortium ...8Libraries, Design Patterns, PHP 8
Description Author

This package is a framework to develop applications using micro-services.

It allows creating an application server based on asynchronous programming using React PHP or using Swoole.

The package allows applications to register handlers to dispatch the expected types of HTTP requests.

It also routes the requests to the handle functions that were registered and the requests are received by the application server.

Innovation Award
PHP Programming Innovation award nominee
April 2021
Number 2


Prize: 1GB Cloud Hosting Server - free for 1 year
Asynchronous programming is a modern approach to develop applications that can make a more efficient use of the CPUs used in the machines on which the applications are running.

There are several solutions to implement asynchronous programming in PHP, like for instance Reach PHP and Swoole.

This package implements a framework that takes advantages of these asynchronous programming solutions to implement Web applications based on micro-services.

Manuel Lemos
Picture of Yousaf Syed
  Performance   Level  
Name: Yousaf Syed <contact>
Classes: 6 packages by
Country: Pakistan Pakistan
Age: 30
All time rank: 238831 in Pakistan Pakistan
Week rank: 186 Up5 in Pakistan Pakistan Up
Innovation award
Innovation award
Nominee: 4x

Winner: 1x

Details

Fast un-opinionated minimalist web framework and server for PHP built on top of Async PHP servers (SwoolePHP and ReactPHP). CrowPHP lets you build real microservices in PHP without the use of PHP-FPM/Nginx or Apache.

Build Status License Coverage

Installation

Requirements

  1. PHP >8.0
  2. Swoole PHP extension
$ pecl install swoole

Installation of CrowPHP via composer, the following command will install the framework and all of its dependencies with it.

composer install crowphp/crow

Hello world microservice using CrowPHP

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

use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface as RequestInterface;
use Crow\Http\Server\Factory as CrowServer;

$app = CrowServer::create(CrowServer::SWOOLE_SERVER);
$router = Crow\Router\Factory::make();

$router->get('/', function (RequestInterface $request, ResponseInterface $response) {
    $response->getBody()->write('Hello World');
    return $response;
});

$app->withRouter($router);

$app->listen(5005);

You may quickly test your newly built service as follows:

$ php index.php

Going to http://localhost:5005 will now display "Hello World".

For more information on how to configure your web server, see the Documentation.

Tests

To execute the test suite, you'll need to install all development dependencies.

$ git clone https://github.com/crowphp/crow
$ composer install
$ composer test

Contributing

Please see CONTRIBUTING for details.

Learn More

Learn more at these links: - Website

Security

If you discover security related issues, please email yousaf@bmail.pk or use the issue tracker.

License

The Crow Framework is licensed under the MIT license. See License File for more information.

  Files folder image Files  
File Role Description
Files folder image.github (1 directory)
Files folder imageCrow (4 directories)
Files folder imageexamples (1 file)
Files folder imageTests (1 directory)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file CONTRIBUTING.md Data Auxiliary data
Accessible without login Plain text file LICENSE.md Lic. License text
Accessible without login Plain text file phpcs.xml.dist Data Auxiliary data
Accessible without login Plain text file phpstan.neon.dist Data Auxiliary data
Accessible without login Plain text file phpunit.xml Data Auxiliary data
Accessible without login Plain text file Readme.md Doc. Read me
Accessible without login Plain text file SECURITY.md Data Auxiliary data

  Files folder image Files  /  .github  
File Role Description
Files folder imageworkflows (1 file)

  Files folder image Files  /  .github  /  workflows  
File Role Description
  Accessible without login Plain text file build.yaml Data Auxiliary data

  Files folder image Files  /  Crow  
File Role Description
Files folder imageHandlers (7 files)
Files folder imageHttp (5 files, 1 directory)
Files folder imageMiddlewares (4 files)
Files folder imageRouter (5 files, 1 directory)

  Files folder image Files  /  Crow  /  Handlers  
File Role Description
  Plain text file CrowRequestHandler.php Class Class source
  Plain text file ErrorHandler.php Class Class source
  Plain text file QueueRequestHandler.php Class Class source
  Plain text file QueueRequestHandlerBuilder.php Class Class source
  Plain text file ReactRequestHandler.php Class Class source
  Plain text file RouteDispatchHandler.php Class Class source
  Plain text file SwooleRequestHandler.php Class Class source

  Files folder image Files  /  Crow  /  Http  
File Role Description
Files folder imageServer (7 files, 1 directory)
  Plain text file DefaultHeaders.php Class Class source
  Plain text file PsrToSwooleResponseBuilder.php Class Class source
  Plain text file RequestFactory.php Class Class source
  Plain text file ResponseBuilder.php Class Class source
  Plain text file SwooleRequest.php Class Class source

  Files folder image Files  /  Crow  /  Http  /  Server  
File Role Description
Files folder imageExceptions (2 files)
  Plain text file BaseServer.php Class Class source
  Plain text file CrowReactServer.php Class Class source
  Plain text file CrowSwooleServer.php Class Class source
  Plain text file Factory.php Class Class source
  Plain text file ReactPHPServer.php Class Class source
  Plain text file ServerInterface.php Class Class source
  Plain text file SwoolePHPServer.php Class Class source

  Files folder image Files  /  Crow  /  Http  /  Server  /  Exceptions  
File Role Description
  Plain text file InvalidEventType.php Class Class source
  Plain text file InvalidServerType.php Class Class source

  Files folder image Files  /  Crow  /  Middlewares  
File Role Description
  Plain text file ErrorMiddleware.php Class Class source
  Plain text file FinalMiddleware.php Class Class source
  Plain text file RoutingMiddleware.php Class Class source
  Plain text file UserMiddlewaresList.php Class Class source

  Files folder image Files  /  Crow  /  Router  
File Role Description
Files folder imageExceptions (1 file)
  Plain text file DispatcherFactoryInterface.php Class Class source
  Plain text file Factory.php Class Class source
  Plain text file FastRouteDispatcher.php Class Class source
  Plain text file FastRouter.php Class Class source
  Plain text file RouterInterface.php Class Class source

  Files folder image Files  /  Crow  /  Router  /  Exceptions  
File Role Description
  Plain text file RoutingLogicException.php Class Class source

  Files folder image Files  /  examples  
File Role Description
  Accessible without login Plain text file index.php Example Example script

  Files folder image Files  /  Tests  
File Role Description
Files folder imageUnit (1 directory)

  Files folder image Files  /  Tests  /  Unit  
File Role Description
Files folder imageCrow (4 directories)

  Files folder image Files  /  Tests  /  Unit  /  Crow  
File Role Description
Files folder imageHandlers (6 files)
Files folder imageHttp (5 files, 1 directory)
Files folder imageMiddlewares (2 files)
Files folder imageRouter (3 files)

  Files folder image Files  /  Tests  /  Unit  /  Crow  /  Handlers  
File Role Description
  Plain text file ErrorHandlerTest.php Class Class source
  Plain text file QueueRequestHandlerBuilderTest.php Class Class source
  Plain text file QueueRequestHandlerTest.php Class Class source
  Plain text file ReactRequestHandlerTest.php Class Class source
  Plain text file RouteDispatchHandlerTest.php Class Class source
  Plain text file SwooleRequestHandlerTest.php Class Class source

  Files folder image Files  /  Tests  /  Unit  /  Crow  /  Http  
File Role Description
Files folder imageServer (5 files)
  Plain text file DefaultHeadersTest.php Class Class source
  Plain text file PsrToSwooleResponseBuilderTest.php Class Class source
  Plain text file RequestFactoryTest.php Class Class source
  Plain text file ResponseBuilderTest.php Class Class source
  Plain text file SwooleRequestTest.php Class Class source

  Files folder image Files  /  Tests  /  Unit  /  Crow  /  Http  /  Server  
File Role Description
  Plain text file CrowReactServerTest.php Class Class source
  Plain text file CrowSwooleServerTest.php Class Class source
  Plain text file FactoryTest.php Class Class source
  Plain text file ReactPHPServerTest.php Class Class source
  Plain text file SwoolePHPServerTest.php Class Class source

  Files folder image Files  /  Tests  /  Unit  /  Crow  /  Middlewares  
File Role Description
  Plain text file ErrorMiddlewareTest.php Class Class source
  Plain text file RoutingMiddlewareTest.php Class Class source

  Files folder image Files  /  Tests  /  Unit  /  Crow  /  Router  
File Role Description
  Plain text file FactoryTest.php Class Class source
  Plain text file FastRouteDispatcherTest.php Class Class source
  Plain text file FastRouterTest.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:66
This week:1
All time:9,895
This week:184Up
User Comments (1)
Great ideia to involve Swoole and focus on PHP 8 for this mic...
5 months ago (Carlos Artur Curvelo da Matos)
77%StarStarStarStar
 
For more information send a message to info at phpclasses dot org.