Download the PHP package pstaender/silverstripe-serve without Composer
On this page you can find all versions of the php package pstaender/silverstripe-serve. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download pstaender/silverstripe-serve
More information about pstaender/silverstripe-serve
Files in pstaender/silverstripe-serve
Package silverstripe-serve
Short Description Connects the PHP development server to SilverStripe
License MIT
Informations about the package silverstripe-serve
SilverStripe Serve
A simple dev task, to start a development server for your SilverStripe app.
Getting started
This will start the server at http://localhost:8080
.
You can override the host/port:
Including a bootstrap file
The bootstrap-file argument lets you include a custom PHP file after composer has been loaded (which includes Silverstripe’s Constants.php) but before main.php has been loaded.
This can be used for any number of things, but the primary use-case is to pull in any stub code & config that wouldn’t normally be included by SilverStripe in the current execution session, such as test stubs.
Using as a library
You can also use serve as a library, to start a SilverStripe server from some other tool such as a test suite:
Assuming that BASE_PATH
is defined, you can use it like this:
If BASE_PATH
is not defined, e.g. if you are not running a SapphireTest,
you can provide an alternative path to the factory constructor:
launchServer allows the following options to be passed to it:
- host: The host to listen on, defaulting to 0.0.0.0
- preferredPort: The preferred port. If this port isn't available, the next highest one will be used
- bootstrapFile: The bootstrap file, as described above
All versions of silverstripe-serve with dependencies
symfony/process Version ^3.0 || ^4.0
silverstripe/framework Version ^4