diff --git a/src/_h5ai/server/php/inc/class-bootstrap.php b/src/_h5ai/server/php/inc/class-bootstrap.php index c87881c3..a1b2e086 100644 --- a/src/_h5ai/server/php/inc/class-bootstrap.php +++ b/src/_h5ai/server/php/inc/class-bootstrap.php @@ -22,7 +22,7 @@ class Bootstrap { $this->setup_server(); $this->setup_paths(); $this->setup_cache(); - $this->setup_ext_cmds(); + $this->setup_cmds(); $app = new App(); if (Util::is_post_request()) { @@ -123,7 +123,7 @@ class Bootstrap { define("HAS_WRITABLE_CACHE", @is_writable(CACHE_PATH)); } - private function setup_ext_cmds() { + private function setup_cmds() { define("CMDS_PATH", Util::normalize_path(CACHE_PATH . "/cmds.json", false)); diff --git a/src/_h5ai/server/php/inc/core/class-util.php b/src/_h5ai/server/php/inc/core/class-util.php index 98057c21..44f23d43 100644 --- a/src/_h5ai/server/php/inc/core/class-util.php +++ b/src/_h5ai/server/php/inc/core/class-util.php @@ -53,7 +53,7 @@ class Util { public static function is_post_request() { - return (strtolower($_SERVER["REQUEST_METHOD"]) === "post"); + return (strtolower(getenv("REQUEST_METHOD")) === "post"); } diff --git a/test/tests/unit/view/viewmode.js b/test/tests/unit/view/viewmode.js index fcf64c11..b765c5e2 100644 --- a/test/tests/unit/view/viewmode.js +++ b/test/tests/unit/view/viewmode.js @@ -2,7 +2,7 @@ 'use strict'; var ID = 'view/viewmode'; -var DEPS = ['_', '$', 'core/event', 'core/resource', 'view/sidebar', 'view/topbar', 'view/view']; +var DEPS = ['_', '$', 'core/event', 'core/resource', 'core/settings', 'view/sidebar', 'view/topbar', 'view/view']; describe('module \'' + ID + '\'', function () { @@ -17,6 +17,9 @@ describe('module \'' + ID + '\'', function () { this.xResource = { image: sinon.stub().returns(util.uniqPath('-image.png')) }; + this.xSettings = {view: { + viewmodeToggle: false + }}; this.xSidebar = {$el: null}; this.xTopbar = {$el: null}; this.xView = { @@ -41,7 +44,7 @@ describe('module \'' + ID + '\'', function () { this.xView.getSize.reset(); this.xView.setSize.reset(); - return this.definition.fn(_, $, this.xEvent, this.xResource, this.xSidebar, this.xTopbar, this.xView); + return this.definition.fn(_, $, this.xEvent, this.xResource, this.xSettings, this.xSidebar, this.xTopbar, this.xView); }; });