bhittani/web-server
Composer 安装命令:
composer require bhittani/web-server
包简介
Run a web server programmatically.
README 文档
README
Run and/or control a web server programmatically.
Install
You may install this package using composer.
$ composer require bhittani/web-server --prefer-dist
Usage
By default, this package offers a php web server that uses the built-in development server.
PHP Web Server
This uses the built-in development server.
<?php require_once __DIR__ . '/vendor/autoload.php'; $webServer = new \Bhittani\WebServer\Php('/path/to/www/public/index.php');
Public path
<?php $webServer->path('/path/to/www/public');
The default path is set to the directory of the server file.
Host
<?php $webServer->host('127.0.0.1');
The default host is set to
localhost.
Port
<?php $webServer->port(3000);
The default port is set to
9001.
URL
<?php $webServer->url('https://localhost');
The default url is set to
http://<host>:<port>.
API
The following API will be available for any web server adhering to the contract/interface.
Start a web server
<?php $webServer->start();
Stop a web server
<?php $webServer->stop();
Check the running state of a web server
<?php $webServer->isRunning();
Get the path to the server
<?php $webServer->getPath();
Get the URL of the server
<?php $webServer->getUrl();
Changelog
Please see CHANGELOG for more information on what has changed.
Testing
git clone https://github.com/kamalkhan/web-server cd web-server composer install composer test
Contributing
Please see CONTRIBUTING and CONDUCT for details.
Security
If you discover any security related issues, please email shout@bhittani.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see the License File for more information.
统计信息
- 总下载量: 98
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-09-22