BUG Fix broken installer assets and session crash

This commit is contained in:
Damian Mooyman 2017-06-30 14:50:58 +12:00
parent a37672f4df
commit 3633947699
No known key found for this signature in database
GPG Key ID: 78B823A10DE27D1A
5 changed files with 8 additions and 5 deletions

View File

@ -3,7 +3,9 @@
namespace SilverStripe\Dev\Install; namespace SilverStripe\Dev\Install;
use Exception; use Exception;
use SilverStripe\Control\Cookie;
use SilverStripe\Control\HTTPRequest; use SilverStripe\Control\HTTPRequest;
use SilverStripe\Control\HTTPRequestBuilder;
use SilverStripe\Control\Session; use SilverStripe\Control\Session;
use SilverStripe\Core\CoreKernel; use SilverStripe\Core\CoreKernel;
use SilverStripe\Control\HTTPApplication; use SilverStripe\Control\HTTPApplication;
@ -199,10 +201,8 @@ PHP
} }
} }
// Mock request // Build request
$session = new Session(isset($_SESSION) ? $_SESSION : array()); $request = HTTPRequestBuilder::createFromEnvironment();
$request = new HTTPRequest('GET', '/');
$request->setSession($session);
// Install kernel (fix to dev) // Install kernel (fix to dev)
$kernel = new CoreKernel(BASE_PATH); $kernel = new CoreKernel(BASE_PATH);
@ -211,6 +211,9 @@ PHP
// Build db within HTTPApplication // Build db within HTTPApplication
$app->execute($request, function (HTTPRequest $request) use ($config) { $app->execute($request, function (HTTPRequest $request) use ($config) {
// Suppress cookie errors on install
Cookie::config()->set('report_errors', false);
// Start session and execute // Start session and execute
$request->getSession()->init($request); $request->getSession()->init($request);

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 343 B

View File

@ -273,7 +273,7 @@
<span id="saving_top" style="display: none"> <span id="saving_top" style="display: none">
&nbsp; &nbsp;
<img src="<?=FRAMEWORK_NAME; ?>/images/network-save.gif" alt="Saving"> <img src="<?=FRAMEWORK_NAME; ?>/src/Dev/Install/client/images/network-save.gif" alt="Saving">
(this will take a minute or so) (this will take a minute or so)
</span> </span>
</p> </p>