Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Data Fields
Updater Class Reference

Public Member Functions

 __construct (Queue $queue)
 
 createUpdaterTask (array $packages, $type, array $additionalOptions=[])
 

Data Fields

const TASK_TYPE_UPDATE = 'update'
 
const TASK_TYPE_UNINSTALL = 'uninstall'
 
const TASK_TYPE_MAINTENANCE_MODE = 'maintenance_mode'
 

Detailed Description

Class Updater passes information to the updater application

Definition at line 15 of file Updater.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( Queue  $queue)

Constructor

Parameters
Queue$queue

Definition at line 33 of file Updater.php.

34  {
35  $this->queue = $queue;
36  }
$queue
Definition: queue.php:21

Member Function Documentation

◆ createUpdaterTask()

createUpdaterTask ( array  $packages,
  $type,
array  $additionalOptions = [] 
)

Create an update task for Updater app

Parameters
array$packages
string$type
array$additionalOptions
Returns
string

Definition at line 46 of file Updater.php.

47  {
48  try {
49  // write to .update_queue.json file
50  $params = [];
51  if (!empty($packages)) {
52  $params['components'] = $packages;
53  }
54  foreach ($additionalOptions as $key => $value) {
55  $params[$key] = $value;
56  }
57 
58  $this->queue->addJobs([['name' => $type, 'params' => $params]]);
59  return '';
60  } catch (\Exception $e) {
61  return $e->getMessage();
62  }
63  }
$type
Definition: item.phtml:13
$value
Definition: gender.phtml:16
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE]
Definition: website.php:18

Field Documentation

◆ TASK_TYPE_MAINTENANCE_MODE

const TASK_TYPE_MAINTENANCE_MODE = 'maintenance_mode'

Definition at line 22 of file Updater.php.

◆ TASK_TYPE_UNINSTALL

const TASK_TYPE_UNINSTALL = 'uninstall'

Definition at line 21 of file Updater.php.

◆ TASK_TYPE_UPDATE

const TASK_TYPE_UPDATE = 'update'

#+ Task types

Definition at line 20 of file Updater.php.


The documentation for this class was generated from the following file: