Upgrade usage of global methods

This commit is contained in:
Damian Mooyman 2017-06-20 17:12:07 +12:00
parent 7fe808da29
commit 95e304a4ca
3 changed files with 5 additions and 14 deletions

View File

@ -7,6 +7,7 @@ use SilverStripe\Admin\CMSBatchActionHandler;
use SilverStripe\Admin\LeftAndMain_SearchFilter; use SilverStripe\Admin\LeftAndMain_SearchFilter;
use SilverStripe\Admin\LeftAndMainFormRequestHandler; use SilverStripe\Admin\LeftAndMainFormRequestHandler;
use SilverStripe\CMS\Model\VirtualPage; use SilverStripe\CMS\Model\VirtualPage;
use SilverStripe\Core\Environment;
use SilverStripe\Forms\Tab; use SilverStripe\Forms\Tab;
use SilverStripe\ORM\CMSPreviewable; use SilverStripe\ORM\CMSPreviewable;
use SilverStripe\Admin\LeftAndMain; use SilverStripe\Admin\LeftAndMain;
@ -1883,8 +1884,8 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
return Security::permissionFailure($this); return Security::permissionFailure($this);
} }
increase_time_limit_to(); Environment::increaseTimeLimitTo();
increase_memory_limit_to(); Environment::increaseMemoryLimitTo();
$response = ""; $response = "";
@ -2026,7 +2027,7 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
if (!SecurityToken::inst()->checkRequest($request)) { if (!SecurityToken::inst()->checkRequest($request)) {
return $this->httpError(400); return $this->httpError(400);
} }
increase_time_limit_to(); Environment::increaseTimeLimitTo();
if (($id = $this->urlParams['ID']) && is_numeric($id)) { if (($id = $this->urlParams['ID']) && is_numeric($id)) {
/** @var SiteTree $page */ /** @var SiteTree $page */
$page = SiteTree::get()->byID($id); $page = SiteTree::get()->byID($id);

View File

@ -11,6 +11,7 @@ use SilverStripe\Control\HTTPRequest;
use SilverStripe\Control\HTTPResponse; use SilverStripe\Control\HTTPResponse;
use SilverStripe\Core\Config\Config; use SilverStripe\Core\Config\Config;
use SilverStripe\Core\Injector\Injector; use SilverStripe\Core\Injector\Injector;
use SilverStripe\Dev\Debug;
use SilverStripe\Forms\DropdownField; use SilverStripe\Forms\DropdownField;
use SilverStripe\Forms\FieldList; use SilverStripe\Forms\FieldList;
use SilverStripe\ORM\DB; use SilverStripe\ORM\DB;

View File

@ -53,17 +53,6 @@ class SiteTreeTest extends SapphireTest
SiteTreeTest_StageStatusInherit::class, SiteTreeTest_StageStatusInherit::class,
); );
/**
* Ensure any current member is logged out
*/
public function logOut()
{
if ($member = Security::getCurrentUser()) {
Session::clear('loggedInAs');
Security::setCurrentUser(null);
}
}
public function testCreateDefaultpages() public function testCreateDefaultpages()
{ {
$remove = SiteTree::get(); $remove = SiteTree::get();