The problem is the client told us we could go live with any OS we wanted, so we developed on CentOS as usual, and when we went to go live, they said "oh, new policy is RHEL only, sorry". Our application works perfectly on CentOS, but not on RHEL.
Main Problem:
Configuration Info:
I have a fix, but it makes NO sense: in vendor/laravel/framework/src/Illuminate/Routing/Router.php
at line 1398, change this:
public function filtersEnabled()
{
return $this->runFilters;
}
to this:
public function filtersEnabled()
{
return true;//$this->runFilters;
}
Do you have any idea what's going on here? I can't find a config option anywhere that would be setting runFilters = false.
I finally found the issue. A while ago I was getting unit tests running, and in app/tests i saw this:
class TestCase extends Illuminate\Foundation\Testing\TestCase {
public function createApplication(){
$unitTesting = true;
$testEnvironment = 'testing';
return require __DIR__.'/../../bootstrap/start.php';
}
So I thought "Awesome! The $testENvironment is configurable. I hated the 'testing' default because that's what we call our QA environment, so I changed it to "phpunit", and then created app/config/phpunit/* files. It ran like a charm in development.
When I pushed the code to our testing environment, I started getting errors about sessions being empty. At first i thought laravel's array session handler was broken, so i tried native, but it was broken too. But then I put some logging throughout the code, and discovered that in fact beforeFilters were not getting run, so authentication wasn't happening, so the session was rightfully empty. So then I traced the code execution from index to start to autoinclude to dispatching, and way down in the routing i found this little hard-coded gem:
vendor/laravel/framework/src/Illuminate/Routing/RoutingServiceProvider.php
35 if ($app['env'] == 'testing')
36 {
37: $router->disableFilters();
38 }
renaming our testing environment to 'test' and our 'phpunit' environment to 'testing' fixed the issue.
maybe i'll do a pull request to make that env name configurable :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With