launch.php addition and readme.md changes

pull/42/head
Ali Gajani 2017-09-16 01:20:14 +01:00
parent 67d0c7606a
commit 9367bdb137
2 changed files with 25 additions and 0 deletions

16
launch.php Normal file
View File

@ -0,0 +1,16 @@
<?php
$uri = urldecode(
parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)
);
$tokens = explode('/', $uri);
$handler = __DIR__.'/'.$tokens[1].'.php';
if ($uri !== '/' && file_exists(__DIR__.'/'.$uri)) {
// If requesting the root page, or raw files/folders
// Return as is
return false;
} elseif (file_exists($handler)) {
// This is for /api and /admin
include_once $handler;
} else {
include_once __DIR__.'/index.php';
}

View File

@ -1,3 +1,12 @@
#### How to launch with one command?
* Step 1: `composer install`
* Step 2: `php -S localhost:9999 launch.php`
`launch.php` is a custom script that gives you a reproducable development environment.
##### By Ali Gajani
---
![Flarum](http://flarum.org/img/logo.png)
**[Flarum](http://flarum.org) is free, open-source forum software** built with PHP and [Mithril.js](http://mithril.js.org). It is: