2017 © Pedro PelĂĄez
 

library octophpus

Asynchronous esi:include filter for PHP 7.1+

image

crazygoat/octophpus

Asynchronous esi:include filter for PHP 7.1+

  • Saturday, June 24, 2017
  • by crazy-goat
  • Repository
  • 2 Watchers
  • 1 Stars
  • 5 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 4 Open issues
  • 9 Versions
  • 0 % Grown

The README.md

Build Status Coverage Status Scrutinizer Code Quality, (*1)

Octophpus

Asynchronous ESI filter for PHP 7.1+. Its scans string for esi:include tags and replace with remote content. It's a simple replace for varnish server just for including esi content. The killer feature is that all request are made asynchronous, so it should be faster than varnish., (*2)

No that this version is just proof of concept. For production implementation wait for Octophpus 0.5., (*3)

Requirements

  • PHP 7.1
  • Guzzle 6
  • cURL extension for PHP. Octopus will run without cURL, but multiple request will not work

Installation

The recommended way to install Octophpus is through Composer., (*4)

php composer.phar require crazygoat/octophpus

To upgrade to newest version execute:, (*5)

php composer.phar update crazygoat/octophpus

Example code

include_once "../vendor/autoload.php";

$text = '<esi:include src="http://crazy-goat.com/"/>';

$octophpus = new \CrazyGoat\Octophpus\EsiTentacles();
echo $octophpus->decorate($text);

Limitations

  • Octophpus only handle esi:include from ESI spec.
  • All esi:include tags must contains full uri in src attribute. Uri must contain protocol, domain name and path. See below.
  • If data string contains two or esi:include tags with same src Octophpus will make multiple requests.

ESI tag format

Octophpus does not cover full specification ESI RFC. It also adds some esi:include parameters that are not part of RFC., (*6)

Minimal valid esi:include is listed below:, (*7)

<esi:include src="http://crazy-goat.com/"/>
    ^          ^                         ^
    1          2                         3
  1. esi:include tag name, it is no case sensitive.
  2. src must contains full URI.
  3. Tag must end with />. Tags like this <esi:include ... ></esi:include> will not work

Multi-line tag will work, so if you want to pass more parameters you can split it to more lines:, (*8)

<esi:include 
    src="http://crazy-goat.com/"
/>

Roadmap

List of features to be add in the near feature. This list is not ordered., (*9)

  • New features
    • Add caching - use PSR-7 cache interface
    • Add hxInclude option on timeout
    • Add option to pass headers to requests (for example cookies, x-forwared-proto)
    • Add recurrence ESI requests
  • Deployment and maintenance
    • Prepare roadmap ticket, and remove this stuff
    • Travis - form running tests
  • Docs and examples
    • Create super duper logo
    • Add better docs
    • Add more examples
    • Add basic test

The Versions

24/06 2017

dev-master

9999999-dev

Asynchronous esi:include filter for PHP 7.1+

  Sources   Download

MIT

The Requires

 

The Development Requires

php guzzle asynchronous async esi culr

24/06 2017

0.4.1

0.4.1.0

Asynchronous esi:include filter for PHP 7.1+

  Sources   Download

MIT

The Requires

 

The Development Requires

php guzzle asynchronous async esi culr

22/06 2017

0.4

0.4.0.0

Asynchronous esi:include filter for PHP 7.1+

  Sources   Download

MIT

The Requires

 

The Development Requires

php guzzle asynchronous async esi culr

04/06 2017

0.3.1

0.3.1.0

Asynchronous esi:include filter for PHP 7.1+

  Sources   Download

MIT

The Requires

 

The Development Requires

php guzzle asynchronous async esi culr

04/06 2017

0.3.0

0.3.0.0

Asynchronous esi:include filter for PHP 7.1+

  Sources   Download

MIT

The Requires

 

The Development Requires

php guzzle asynchronous async esi culr

02/06 2017

0.2.0

0.2.0.0

Asynchronous esi:include filter for PHP 7.1+

  Sources   Download

MIT

The Requires

 

The Development Requires

php guzzle asynchronous async esi culr

01/06 2017

0.1.2

0.1.2.0

Asynchronous esi:include filter for PHP 7.1+

  Sources   Download

MIT

The Requires

 

The Development Requires

php guzzle asynchronous async esi culr

01/06 2017