Added method to get real IP address
Added support for optional route parameters
Added section about optional parameters
Fixed problem regexes in optional parameters
Parameters should be URL decoded.
Removed error filtering and fixed notice errors.
Only raise errors from error_reporting()
Fixed PHP notice error
Update flight/template/View.php

using basename instead of testing with strpos.
Merge pull request #21 from kafene/master

using basename instead of substr.
Code cleanup
Allow framework to be reinitialized
Merge pull request #1 from mikecao/master

merging master
Added unit tests
Made event parameters optional
Merge pull request #2 from mikecao/master

this is a required field
a few enhancements to request.php

- added "secure" parameter to avoid boilerplate "if https && https != 'off'"
- added "accept" parameter containing request's HTTP_ACCEPT value if any
- Changed IP to always be REMOTE_ADDR, as this is the only "real" ip of the request.
- Added 'proxy' parameter containing any proxy-forwarded IP
- Changed getIpAddress to getProxyIpAddress
- renamed $vars to $forwarded to be a bit more explicit
- Removed REMOTE_ADDR from proxy forwarded addresses to detect
- change explode() to sscanf, will explain this later.
- added flags to the filter_var, will also explain later
- added getMethodOverride function to detect request method overrides

I did some research because I was wondering why it would be necessary to check
for a comma, and apparently some proxies do send a comma separated list of IP
addresses, with the originating client IP as the first one. It had a feeling
that instead of using explode() where the first value would always be returned,
there must be another way to get the first value of a token-delimited string,
or just the whole string if there was no token, and I bumped in to my old
friend sscanf. So the loop is now 3 levels.

As far as the flags, see: http://php.net/manual/en/filter.filters.flags.php

These ensure that any IP detected is not a useless IP behind a remote NAT.
For example, a corporate proxy might send HTTP_X_FORWARDED_FOR using the
internal IP of the user, but the only useful IP in this case is that of
the proxy, which PHP gets as REMOTE_ADDR.

If you find any of these changes acceptable but don't want to merge them
all, do feel free to implement whichever you like.

I was thinking of adding a getRequestMethod() function to check for
`$_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE']` or `$_POST['_method']`
to allow clients to negotiate PUT/DELETE requests,
but personally I am indifferent to these, as I never use
methods beyond GET and POST (I'm not very RESTful I guess),
and it's not really my place to be writing an implementation
of either. Other frameworks seem to just overwrite the method
parameter so that it appears to be the overridden one.
Fixed never-returned proxy IP
Merge pull request #22 from kafene/master

a few changes to request.php
Minor code changes