2017 © Pedro Peláez
 

library silex-adapter

An adapter to integrate PHPFastCGI with the Silex micro-framework

image

phpfastcgi/silex-adapter

An adapter to integrate PHPFastCGI with the Silex micro-framework

  • Wednesday, January 13, 2016
  • by AndrewCarterUK
  • Repository
  • 3 Watchers
  • 13 Stars
  • 146 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 6 Versions
  • 0 % Grown

The README.md

PHPFastCGI Silex Adapter

Latest Stable Version Build Status Coverage Status Scrutinizer Code Quality Total Downloads, (*1)

A PHP package which allows Silex applications to reduce overheads by exposing their Request-Response structure to a FastCGI daemon., (*2)

Visit the project website., (*3)

Introduction

Using this adapter, Silex applications can stay alive between HTTP requests whilst operating behind the protection of a FastCGI enabled web server., (*4)

Current Status

This project is currently in early stages of development and not considered stable. Importantly, this library currently lacks support for uploaded files., (*5)

Contributions and suggestions are welcome., (*6)

Installing

composer require "phpfastcgi/silex-adapter:^0.5"

Usage

<?php // web/command.php

// Include the composer autoloader
require_once dirname(__FILE__) . '/../vendor/autoload.php';

use PHPFastCGI\FastCGIDaemon\ApplicationFactory;
use PHPFastCGI\Adapter\Silex\ApplicationWrapper;
use Silex\Application;

// Create your Silex application
$app = new Application;
$app->get('/hello/{name}', function ($name) use ($app) {
    return 'Hello ' . $app->escape($name);
});

// Create the kernel for the FastCGIDaemon library (from the Silex application)
$kernel = new ApplicationWrapper($app);

// Create the symfony console application
$consoleApplication = (new ApplicationFactory)->createApplication($kernel);

// Run the symfony console application
$consoleApplication->run();

If you wish to configure your FastCGI application to work with the apache web server, you can use the apache FastCGI module to process manage your application., (*7)

This can be done by creating a FastCGI script that launches your application and inserting a FastCgiServer directive into your virtual host configuration., (*8)

#!/bin/bash
php /path/to/silex/web/command.php run
FastCgiServer /path/to/silex/web/script.fcgi

By default, the daemon will listen on FCGI_LISTENSOCK_FILENO, but it can also be configured to listen on a TCP address. For example:, (*9)

php /path/to/command.php run --port=5000 --host=localhost

If you are using a web server such as NGINX, you will need to use a process manager to monitor and run your application., (*10)

The Versions

13/01 2016

dev-master

9999999-dev

An adapter to integrate PHPFastCGI with the Silex micro-framework

  Sources   Download

MIT

The Requires

 

The Development Requires

silex server daemon fastcgi fast cgi

02/11 2015

v0.5.0

0.5.0.0

An adapter to integrate PHPFastCGI with the Silex micro-framework

  Sources   Download

GPL v2

The Requires

 

The Development Requires

silex server daemon fastcgi fast cgi

21/10 2015

v0.4.0

0.4.0.0

A bundle to integrate a FastCGI daemon with the Silex micro-framework

  Sources   Download

GPL v2

The Requires

 

The Development Requires

silex server daemon fastcgi fast cgi speedex

27/08 2015

v0.3.0

0.3.0.0

A bundle to integrate a FastCGI daemon with the Silex micro-framework

  Sources   Download

GPL v2

The Requires

 

The Development Requires

silex server daemon fastcgi fast cgi speedex

19/08 2015

v0.2.0

0.2.0.0

A bundle to integrate a FastCGI daemon with the Silex micro-framework

  Sources   Download

GPL v2

The Requires

 

The Development Requires

silex server daemon fastcgi fast cgi speedex

15/08 2015

v0.1.0

0.1.0.0

A bundle to integrate a FastCGI daemon with the Silex micro-framework

  Sources   Download

GPL v2

The Requires

 

The Development Requires

silex server daemon fastcgi fast cgi speedex