Download the PHP package statix/server without Composer

On this page you can find all versions of the php package statix/server. 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 server

Statix Server

Statix Server is a PHP package that provides a simple way to configure and start a local PHP server for your web development needs.

Requirements

Installation

You can install the package via composer:

View on packagist: https://packagist.org/packages/statix/server

Basic Usage

To get started, require the vendor autoload script and create an instance of the Server class. After setting any configuration options, call the start method to start the server.

Configuration

You can configure the several options with the server, such as the host, the port, the root directory and more. Please read more below for a detailed explanation of each configuration method.

Passing configuration via the constructor or Server::new()

You may pass most configuration options via the constructor. For example we are setting the host, port and root options in the code below.

The complete list of configuration items that can be passed via the constructor can be found below.

Setting configuration via named methods

You also have the option of calling named methods to set the configuration options as shown below.

Capturing the output from the server process

If you want to show the output from the server process as it recieves and handles requests, you may call the output method and pass a callback function that will be called and passed any output of the process.

Running the process in the background

You may find it useful to run the server process in the background, you may call runInBackground(). The process will run as long as the parent script is running.

Checking whether the process is running

You may check whether or not the server is currently running by calling the isRunning method.

Stopping the server

You may stop the process running the sever by calling the stop command on an instance of the server class. If the server is not currently running this method will return null otherwise it will return an array container first the process exit code and second the process exit text. Note this command can only be called when the server is running in the background.

Restarting the server

You can restart the server by calling the restart method on an instance of the server class. An example of why you might need to restart the server is detecting when your .env file is changed, you could restart the server and ensure the env vars are loaded.

Contributing

Installation

  1. Clone repo

  2. Install php dependencies

Testing

We use Pest PHP for the test suite, please ensure before pushing changes you confirm there are no breaking changes by running the command below. Additionally, tests for new features are highly encouraged, changes will be considered without tests but it will increase the time to accept / merge.

Style

We use Laravel Pint to automatically standardize code styling, before pushing changes please run pint using the command below.


All versions of server with dependencies

PHP Build Version
Package Version
Requires php Version >=8
symfony/process Version ^6.0
vlucas/phpdotenv Version ^5.4
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 statix/server contains the following files

Loading the files please wait ....