Skip to content

Instantly share code, notes, and snippets.

@Golpha

Golpha/app.php Secret

Created October 26, 2014 09:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Golpha/b80c484991745877876b to your computer and use it in GitHub Desktop.
Save Golpha/b80c484991745877876b to your computer and use it in GitHub Desktop.
Custom Request-Objects in Baud Neph for development stage
<?php
use Baud\Http\Server;
# Bootstrap Baud Application
Baud\Application::bootstrap(function(App\Main $main) {
# Implement custom frame "main"
$this->implement($main);
# set environments
$this->environment('test', function() {
# limit environment "test" to a ip pattern
$this->address('192.168.*.*');
# create server global value injection
$server = ['PATH_INFO' => '/foo/bar'];
# inject to server superglobal copy and morph to request
return Server::inject($server)->asRequest();
});
})->run();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment