mikecao/flight — pull request #21 by kafene (2012-12-23 07:51:02+00:00)
Title: using basename instead of testing with strpos.

I have been tearing flight apart and I like it a lot, I noticed it was testing

`((substr($file, -4) == '.php') ? $file : $file.'.php')`

it is a bit more clear IMO to say

`basename($file, '.php').'.php'`

which accomplishes the same thing pretty much.

also have you considered using `getenv()` instead of testing `isset()` on `$_SERVER` in a lot of places? It returns false or the correct value of most of the stuff in the `$_SERVER` array, so you can do for example `getenv('SERVER_PROTOCOL') ?: 'HTTP/1.1'`