-
-
Save Golpha/b80c484991745877876b to your computer and use it in GitHub Desktop.
Custom Request-Objects in Baud Neph for development stage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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