Sha256: 3bd5db95b830d03dc815475caaaf715b54fc212205abf585d00fdec72f0f00ec

Contents?: true

Size: 584 Bytes

Versions: 14

Compression:

Stored size: 584 Bytes

Contents

<?php

/**
* WordPress routing for PHP buit in web server
**/

$root = $_SERVER['DOCUMENT_ROOT'];
chdir( $root );

$path = '/'. ltrim( parse_url( $_SERVER['REQUEST_URI'] )['path'], '/' );
set_include_path( get_include_path() .':'. __DIR__ );

if( file_exists( $root.$path ) ) {

	if( is_dir( $root.$path ) && substr( $path, strlen( $path ) - 1, 1 ) !== '/' ) {
		$path = rtrim( $path, '/' ) .'/index.php';
	}

	if( strpos( $path, '.php' ) === false ) {
		return false;
	}
	else {
		chdir( dirname( $root.$path ) );
		require_once $root.$path;
	}
}
else {
	include_once 'index.php';
}

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
marv-0.8.2 layouts/config/router.php
marv-0.8.0 layouts/config/router.php
marv-0.7.3 layouts/config/router.php
marv-0.7.2 layouts/config/router.php
marv-0.7.1 layouts/config/router.php
marv-0.7.0 layouts/config/router.php
marv-0.6.5 layouts/config/router.php
marv-0.6.4 layouts/config/router.php
marv-0.6.3 layouts/config/router.php
marv-0.6.2 layouts/config/router.php
marv-0.6.1 layouts/config/router.php
marv-0.6.0 layouts/config/router.php
marv-0.5.0 layouts/config/router.php
marv-0.4.0 layouts/config/router.php