Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
magento2-base
setup
src
Magento
Setup
Controller
Maintenance.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Setup\Controller
;
7
8
use
Magento\Framework\App\MaintenanceMode
;
9
use Zend\Mvc\Controller\AbstractActionController;
10
use Zend\View\Model\JsonModel;
11
use Zend\Json\Json;
12
13
class
Maintenance
extends
AbstractActionController
14
{
20
private
$maintenanceMode;
21
27
public
function
__construct
(
MaintenanceMode
$maintenanceMode)
28
{
29
$this->maintenanceMode = $maintenanceMode;
30
}
31
37
public
function
indexAction
()
38
{
39
try
{
40
$params
= Json::decode($this->getRequest()->getContent(), Json::TYPE_ARRAY);
41
$action = isset(
$params
[
'disable'
]) &&
$params
[
'disable'
] ?
false
:
true
;
42
$this->maintenanceMode->set($action);
43
return
new
JsonModel([
'responseType'
=>
ResponseTypeInterface::RESPONSE_TYPE_SUCCESS
]);
44
}
catch
(\
Exception
$e) {
45
return
new
JsonModel(
46
[
47
'responseType'
=>
ResponseTypeInterface::RESPONSE_TYPE_ERROR
,
48
'error'
=> $e->getMessage()
49
]
50
);
51
}
52
}
53
}
false
return false
Definition:
gallery.phtml:36
Magento\Framework\App\MaintenanceMode
Definition:
MaintenanceMode.php:14
Magento\Setup\Controller\ResponseTypeInterface\RESPONSE_TYPE_SUCCESS
const RESPONSE_TYPE_SUCCESS
Definition:
ResponseTypeInterface.php:18
Magento\Setup\Controller\Maintenance\indexAction
indexAction()
Definition:
Maintenance.php:37
Magento\Setup\Controller\Maintenance
Definition:
Maintenance.php:13
Magento\Setup\Controller\Maintenance\__construct
__construct(MaintenanceMode $maintenanceMode)
Definition:
Maintenance.php:27
Magento\Setup\Controller\ResponseTypeInterface\RESPONSE_TYPE_ERROR
const RESPONSE_TYPE_ERROR
Definition:
ResponseTypeInterface.php:19
Magento\Setup\Exception
Definition:
Exception.php:14
$params
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE]
Definition:
website.php:18
Magento\Setup\Controller
Definition:
UrlCheckTest.php:6