titon / framework

A modular Hack framework that runs on HHVM.
http://titon.io
BSD 2-Clause "Simplified" License
206 stars 23 forks source link

Fix error if a super global array is null #91

Closed belka-ew closed 8 years ago

belka-ew commented 9 years ago

After requiring autoload.php I get the following error:

nCatchable fatal error: Argument 1 passed to Titon\Utility\State\Request::initialize() must be an instance of array, null given in titon/framework/src/Titon/Utility/State/Request.hh on line 84

milesj commented 9 years ago

I think the bigger question is, why would a super global be null?

belka-ew commented 9 years ago

I've just checked and $_SESSION is NULL

belka-ew commented 9 years ago

And if I call session_start() just before require_once(DIR . '/../vendor/autoload.php');

the error disappears. Shouldn't session_start() be called somewhere in bootstrap?

milesj commented 9 years ago

Starting the session is up to the application, not the packages.

bwhitty commented 9 years ago

Fyi as I saw this in my feed: #82 is this same issue.

milesj commented 9 years ago

Nice find. I'll think of a way to handle this.