mirror of
https://github.com/voc/streaming-website
synced 2024-11-10 06:34:17 +00:00
support php internal webserver
This commit is contained in:
parent
37554e5112
commit
9b8e234c6c
4 changed files with 35 additions and 2 deletions
|
@ -5,4 +5,4 @@ RewriteCond %{REQUEST_FILENAME} !-f
|
|||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteCond %{REQUEST_FILENAME} !-l
|
||||
|
||||
RewriteRule (.*) index.php?route=$1 [L]
|
||||
RewriteRule (.*) index.php?route=$1&htaccess=1 [L]
|
||||
|
|
15
README.md
15
README.md
|
@ -9,6 +9,21 @@ zu haben, die mit wenigen Konfigurationsoptionen und ein paar CSS-Rules an die
|
|||
Gegebenheiten und die Gestaltung der Konferenz angepasst werden können.
|
||||
|
||||
|
||||
## Development
|
||||
|
||||
Während der Entwicklung kann der eingebaute PHP-Webserver verwendet werden:
|
||||
```
|
||||
$ ./serve.sh
|
||||
PHP 7.0.4-7ubuntu2.1 Development Server started at Mon Jun 20 22:40:17 2016
|
||||
Listening on http://localhost:8000
|
||||
Document root is /home/peter/VOC/streaming-website
|
||||
Press Ctrl-C to quit.
|
||||
…
|
||||
```
|
||||
|
||||
Unterstützt wird PHP ab 5.4.
|
||||
|
||||
|
||||
|
||||
## Setup
|
||||
|
||||
|
|
18
index.php
18
index.php
|
@ -28,7 +28,23 @@ require_once('model/Upcoming.php');
|
|||
|
||||
ob_start();
|
||||
try {
|
||||
$route = @$_GET['route'];
|
||||
if(isset($_GET['htaccess']))
|
||||
{
|
||||
$route = @$_GET['route'];
|
||||
}
|
||||
elseif(isset($_SERVER["REQUEST_URI"]))
|
||||
{
|
||||
$route = ltrim(@$_SERVER["REQUEST_URI"], '/');
|
||||
|
||||
// serve static
|
||||
if($route != '' && file_exists($_SERVER["DOCUMENT_ROOT"].'/'.$route))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
else $route = '';
|
||||
|
||||
$route = rtrim($route, '/');
|
||||
|
||||
// generic template
|
||||
|
|
2
serve.sh
Executable file
2
serve.sh
Executable file
|
@ -0,0 +1,2 @@
|
|||
#!/bin/sh
|
||||
php -S localhost:8000 -d short_open_tag=true index.php
|
Loading…
Reference in a new issue