2017 © Pedro Peláez
 

lithium-library li3_server

Booting Lithium from the CLI.

image

daschl/li3_server

Booting Lithium from the CLI.

  • Friday, August 10, 2012
  • by daschl
  • Repository
  • 0 Watchers
  • 5 Stars
  • 669 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 5 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Note that this is highly experimental and while it works, a lot of tests in /test seem to fail., (*1)

Requirements

  • PHP 5.4 as it introduces the new built-in HTTP server.
  • Lithium, of course.

Installation

The easiest way to install li3_server is through Composer., (*2)

{
    "require": {
        "daschl/li3_server": "master"
    }
}

Alternatively, you can install it directly from GitHub:, (*3)

$ cd libraries
$ git clone git://github.com/daschl/li3_server.git

Now you need to add it to your Lithium bootstrap file (config/bootstrap/libraries.php):, (*4)

Libraries::add('li3_server');

Usage

Head to the command line and run it through li3 server., (*5)

$ li3 server
--------------------------------------------------------------------------------
Lithium Development Server
--------------------------------------------------------------------------------
Booting: php -S localhost:8000 -t /path/to/webroot
Starting on localhost:8000...

You can also override the following settings:, (*6)

  • --php: The path to your PHP binary. Defaults to php.
  • --host: The hostname to which the server will listen. Defaults to localhost.
  • --port: The port on which the server will listen. Defaults to 8000.
  • --webroot: A custom webroot. Defaults to LITHIUM_APP_PATH/webroot.
  • --router: A custom router script. Defaults to the provided one at config/router.php.

If you are still running mainly PHP 5.3 and want to experiment with the server, you can do it like this:, (*7)

$ li3 server --php=/home/michael/Downloads/php-5.4.0RC6/sapi/cli/php
--------------------------------------------------------------------------------
Lithium Development Server
--------------------------------------------------------------------------------
Booting: /home/michael/Downloads/php-5.4.0RC6/sapi/cli/php -S localhost:8000 -t /home/michael/web/framework/app/webroot
Starting on localhost:8000...

The Versions

10/08 2012

dev-master

9999999-dev https://github.com/daschl/li3_server

Booting Lithium from the CLI.

  Sources   Download

The Requires