2017 © Pedro Peláez
 

library swoole

Compatibility package for Swoole support of Onion applications

image

onion/swoole

Compatibility package for Swoole support of Onion applications

  • Saturday, June 2, 2018
  • by DaGhostman
  • Repository
  • 1 Watchers
  • 0 Stars
  • 44 Installations
  • PHP
  • 0 Dependents
  • 1 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Swoole compatibility layer for onion/framework

This is a minimal wrapper that handles the creation of the Swoole\Http\Server and it's initialization and allows any application already written using onion/framework to "just work" with the app server., (*1)

Configuration

This package's default factories require minor configuration additions in order to get up and running:, (*2)

Config

<?php
### Configuration
return [
    'application' => [
        'server' => [
            'address' => '', // The address on which to bind the app server. Binds on '0.0.0.0' if none is provided
            'port' => 1234, // The port on which the server to listen. A random one will be used if none is provided
            'options' => [ // A list of options that is being passed directly to `Swoole\Http\Server::set()` for configuration

            ]
        ]
    ]
];

Dependencies

<?php
return [
    'factories' => [
        // ... Definitions
        // The base application is still in use, just make sure to register it directly as class name
        \Onion\Framework\Application\Application::class => \Onion\Framework\Application\Factory\ApplicationFactory::class,
        // The app server
        \Swoole\Http\Server::class => \Onion\Extra\Swoole\Factory\HttpServerFactory::class,
        // The definition of the application wrapper
        \Onion\Framework\Application\Interfaces\ApplicationInterface::class => \Onion\Framework\Application\Factory\SwooleApplicationFactory::class,
        // ... More definitions
    ],
];

Note that we assume that you have something similar to the following in your index.php file:, (*3)

<?php

// Bootstrap

/**
 * Note the usage of the ApplicationInterface to fetch the application instance,
 * this (or your equivalent) key should be changed to return the SwooleApplication
 * instance
 */
$container->get(\Onion\Framework\Application\Interfaces\ApplicationInterface::class)
    ->run(); // Note the ServerRequest::fromGlobals() is not necessary here, so it can be omitted

The Versions

02/06 2018

dev-master

9999999-dev

Compatibility package for Swoole support of Onion applications

  Sources   Download

MIT

The Requires

 

The Development Requires

02/06 2018

1.0.0

1.0.0.0

Compatibility package for Swoole support of Onion applications

  Sources   Download

MIT

The Requires

 

The Development Requires

20/05 2018

1.0.0-rc1

1.0.0.0-RC1

Compatibility package for Swoole support of Onion applications

  Sources   Download

MIT

The Requires

 

The Development Requires