Giter Club home page Giter Club logo

zend-expressive-swoole's Introduction

zend-expressive-swoole

Build Status Coverage Status

This library provides the support of Swoole into an Expressive application. This means you can execute your Expressive application using Swoole directly from the command line.

Installation

Run the following to install this library:

$ composer require zendframework/zend-expressive-swoole

Configuration

After installing zend-expressive-swoole, you will need to first enable the component, and then optionally configure it.

We recommend adding a new configuration file to your autoload directory, config/autoload/swoole.local.php. To begin with, use the following contents:

<?php

use Zend\Expressive\Swoole\ConfigProvider;

return array_merge((new ConfigProvider())(), []);

The above will setup the Swoole integration for your application.

By default, Swoole executes the HTTP server with host 127.0.0.1 on port 8080. You can change these values via configuration. Assuming you have the above, modify it to read as follows:

<?php

use Zend\Expressive\Swoole\ConfigProvider;

return array_merge((new ConfigProvider())(), [
    'zend-expressive-swoole' => [
        'swoole-http-server' => [
            'host' => 'insert hostname to use here',
            'port' => 80, // use an integer value here
        ],
    ],
]);

Expressive skeleton 3.1.0 and later

If you have built your application on the 3.1.0 or later version of the Expressive skeleton, you do not need to instantiate and invoke the package's ConfigProvider, as the skeleton supports it out of the box.

You will only need to provide any additional configuration of the HTTP server.

Execute

Once you have performed the configuration steps as outlined above, you can run an Expressive application with Swoole using the following command:

$ ./vendor/bin/zend-expressive-swoole start

Call the command without arguments to get a list of available commands, and use the help meta-argument to get help on individual commands:

$ ./vendor/bin/zend-expressive-swoole help start

Documentation

Browse the documentation online at https://docs.zendframework.com/zend-expressive-swoole/

Support

zend-expressive-swoole's People

Contributors

acelaya avatar achevillard avatar codeliner avatar ezimuel avatar gsteel avatar huangzhhui avatar massiathg avatar michalbundyra avatar thomasvargiu avatar weierophinney avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.