lord/middleman-php — pull request #7 by svicalifornia (2014-07-13 11:16:09+00:00)
Title: Three new features, one pull request

@lord Thanks for starting this gem. It's been pretty useful to my company on an existing codebase with some PHP. However, we ran into a couple of issues that prevented us from accessing the full functionality of the existing scripts. This pull request resolves those issues making middleman-php more useful for everyone. Specifically, the pull request enables middleman-php to:

- Inject a $_REQUEST variable, created by merging $_ENV, $_GET, $_POST, $_COOKIE, and _$SERVER. Of course, middleman-php only supplies $_GET and $_POST, and only when certain conditions are met. Fortunately, PHP initializes all of these variables, so we can safely merge whatever it has into $_REQUEST. (Later we can think about adding $_COOKIE and $_SERVER.)
- Change the working directory of the PHP execution context to match the directory containing the script, as this is the norm when running PHP scripts from typical web servers such as Apache. This allows PHP scripts to access files using paths relative to the script location, just as they would when running from Apache.
- Set the debug mode based on a user setting in the Middleman project's config.rb file.

Please let me know if you have any questions or concerns, or go ahead and merge this and publish 0.0.4. :)