Laravel 4 中服务器.php文件的目的是什么?
在Laravel 4的目录中,有一个名为.此文件的内容如下所示:/app/
server.php
<?php
$uri = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
$uri = urldecode($uri);
$paths = require __DIR__.'/bootstrap/paths.php';
$requested = $paths['public'].$uri;
// This file allows us to emulate Apache's "mod_rewrite" functionality from the
// built-in PHP web server. This provides a convenient way to test a Laravel
// application without having installed a "real" web server software here.
if ($uri !== '/' and file_exists($requested))
{
return false;
}
require_once $paths['public'].'/index.php';
似乎这个文件在某种程度上被用来模仿Apache的功能,但是我在Laravel文档中找不到任何提到它或它的用途的东西。mod_rewrite
我目前正在尝试在不管理的IIS服务器上使用Laravel。我无法修改IIS上的URL重写模块选项(我将来会这样做),但如果可能的话,我想现在就开始使用框架。此文件似乎可能是执行此操作的权宜之计。server.php
任何人都可以阐明文件的目的,以及如果目的真的是模仿Apache的功能,如何使用/激活它?server.php
mod_rewrite