Download the PHP package phonetworks/pho-server-rest without Composer

On this page you can find all versions of the php package phonetworks/pho-server-rest. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package pho-server-rest

pho-server-rest

An event-driven non-blocking REST API for the Phở Kernel.

Pho-Server-Rest does not rely on a third party HTTP Server such as NGINX or Apache HTTPD. But it is recommended that you run it behind a proxy server for static assets and caching.

Requirements

Installation

The recommended way to install pho-server-rest is through git. MacOS and most UNIX operating system come with git equipped.

If you are on Windows or don't have git preinstalled, you may download and install git from https://git-scm.com/, or just download the pho-server-rest zip tarball from https://github.com/phonetworks/pho-server-rest/archive/master.zip and extract.

Once the REST Server is installed, you need a Phở Kernel to run it. You can install the standard Phở Kernel simply by typing:

Alternatively you may create your own kernel with a custom recipe, and copy/paste it under the kernel directory. For instructions on how to create a custom kernel, check out the README.md file of pho-kernel.

Once the kernel is set up, you should install the dependencies using Composer as follows:

Do not forget to install such dependencies for the submodule kernel as well. You would need to copy the composer.json from one of the presets which determine the structure of the graph you are to build.

To run the server, you must execute the run.php file. Alternatively, you may call the server programmatically:

Usage

Sessions

Unit Testing

In order to run tests, make sure the REST server is running. For that, you'll need to type in php run.php while in the root folder, ensuring the kernel submodule was initialized and set up with the right recipe, and environment variables are properly entered.

Once the server is up and running, you may run the unit tests by typing vendor/bin/phpunit, assuming that you have already installed the dependencies.

FAQ

How do I change the port?

By default, pho-server-rest is designed to serve through port 1337. You may change it from the file run.php by changing the line that corresponds to

How can I use Pho Server as part of a real-time application?

Phở Server uses React's core reactor event loop, and can work with any application that uses the same infrastructure. To achieve that, one has to construct the Phở server object with the custom event loop as the second argument;

Once the server object is initialized, you can start the event loop separately using the serve() call by passing the false argument as follows: . This starts the server in a non-blocking way, so you can initialize the loop at a different point and time of your application's lifetime.

License

MIT, see LICENSE.


All versions of pho-server-rest with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package phonetworks/pho-server-rest contains the following files

Loading the files please wait ....