2017 © Pedro Peláez
 

library drupal-adapter

image

php-pm/drupal-adapter

  • Friday, March 10, 2017
  • by MArcJ
  • Repository
  • 8 Watchers
  • 30 Stars
  • 30 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 7 Open issues
  • 9 Versions
  • 0 % Grown

The README.md

PHP-PM DrupalKernel Adapter

Overview

This is a fork of PHP-PM's HttpKernel adapter for integrating Drupal with PHP-PM (therefore, also with ReactPHP)., (*1)

The primary components are a bootstrap and bridge., (*2)

See: * https://github.com/php-pm/php-pm * https://github.com/php-pm/php-pm-httpkernel * http://marcjschmidt.de/blog/2014/02/08/php-high-performance.html, (*3)

The code is in alpha -- very experimental. Last tested against drupal-8.0.2., (*4)

View / report issues at https://github.com/php-pm/php-pm-drupal/issues., (*5)

Setup / Usage

  1. Install Drupal., (*6)

  2. From the Drupal web root, install this project with composer: composer require php-pm/drupal-adapter., (*7)

    This will also install PHP-PM and the default React Symfony bridge (php-pm/httpkernel-adapter)., (*8)

  3. Apply these patches to Drupal core:, (*9)

    • vendor/kentr/php-pm-drupal-adapter/patches/kentr-allow-repeated-setSitePath-in-DrupalKernel.patch
    • vendor/kentr/php-pm-drupal-adapter/patches/stop_using-2505339-24.patch
  4. Start php-pm with, (*10)

<absolute path to web root>/vendor/bin/ppm \
start \
<absolute path to web root> \
--bridge=httpKernel \
--bootstrap=PHPPM\\Bootstraps\\Drupal

Example:, (*11)

/var/www/html/vendor/bin/ppm \
start \
/var/www/html/ \
--bridge=httpKernel \
--bootstrap=PHPPM\\Bootstraps\\Drupal

DrupalKernel bridge

By default, PHP-PM uses the \PHPPM\Bridges\HttpKernel bridge to convert a ReactPHP request into a Symfony request and the Symfony response into a ReactPHP response., (*12)

The included \PHPPM\Bridges\DrupalKernel bridge extends \PHPPM\Bridges\HttpKernel to populate various request meta-variables specified by CGI/1.1 (RFC 3875)., (*13)

Setup / Usage

  1. Install as described above., (*14)

  2. Include the environment variables and the --bridge option in the php-pm start command., (*15)

    Supported environment variables:, (*16)

    • SCRIPT_NAME: '/index.php' to emulate a standard setup where web requests execute Drupal's index.php script.
    • SERVER_NAME: Your site's server / domain name. If you're using trusted host settings ($settings['trusted_host_patterns'] in settings.php), this must match one of the trusted hosts.
    • SERVER_ADDRESS: IP address of the server.
    • DOCUMENT_ROOT: Absolute filepath of the web root directory.

Example:, (*17)

SCRIPT_NAME=/index.php \
SERVER_NAME=localhost \
SERVER_ADDRESS=127.0.0.1 \
DOCUMENT_ROOT=/var/www/html \
/var/www/html/vendor/bin/ppm start /var/www/html \
--bridge=PHPPM\\Bridges\\DrupalKernel \
--bootstrap=PHPPM\\Bootstraps\\Drupal

The Versions

10/03 2017

dev-php-fpm

dev-php-fpm

  Sources   Download

The Requires

 

21/11 2016

dev-master

9999999-dev

  Sources   Download

The Requires

 

02/02 2016

dev-kentr-add-drupal-bridge

dev-kentr-add-drupal-bridge

  Sources   Download

The Requires

 

26/01 2016

dev-kentr-convert-to-composer-standalone

dev-kentr-convert-to-composer-standalone

  Sources   Download

The Requires

 

26/01 2016

dev-kentr-add-server-vars

dev-kentr-add-server-vars

  Sources   Download

The Requires

 

26/01 2016

dev-kentr-drupal-bootstrap

dev-kentr-drupal-bootstrap

  Sources   Download

The Requires

 

25/01 2016

dev-kentr-add-cookie-support

dev-kentr-add-cookie-support

  Sources   Download

The Requires

 

26/06 2015
05/06 2015