public
Fork of KrisJordan/recess
Description: Recess is a REST oriented, full-stack PHP framework.
Homepage: http://www.recessframework.org
Clone URL: git://github.com/recess/recess.git
recess / index.php
100644 23 lines (20 sloc) 0.772 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php
/**
* This file allows your recess application to work without .htaccess
* by using the following url: http://www.somehost.com/index.php/path/to/your/app
*
* This is discouraged over using a proper .htaccess rewrite.
*
* Once .htaccess is working go ahead and delete this file.
*
* @author Kris Jordan <krisjordan@gmail.com>
*/
 
define('INDEX_PHP','index.php');
$pos = strpos($_SERVER['PHP_SELF'], INDEX_PHP);
$base = substr($_SERVER['PHP_SELF'], 0, $pos + strlen(INDEX_PHP));
$_ENV['url.assetbase'] = str_replace(INDEX_PHP,'',$base);
$_SERVER['PHP_SELF'] = $base . '/bootstrap.php';
 
$pos = strpos($_SERVER['REQUEST_URI'], INDEX_PHP);
$_SERVER['REQUEST_URI'] = substr($_SERVER['REQUEST_URI'],$pos + strlen(INDEX_PHP));
 
require_once('bootstrap.php');
?>