TYPO3 CMS  TYPO3_6-2
AbstractUpdate.php
Go to the documentation of this file.
1 <?php
3 
23 abstract class AbstractUpdate {
24 
30  protected $title;
31 
37  protected $identifier;
38 
44  public $pObj;
45 
51  public $userInput;
52 
60 
66  public function getTitle() {
67  if ($this->title) {
68  return $this->title;
69  } else {
70  return $this->identifier;
71  }
72  }
73 
80  public function setTitle($title) {
81  $this->title = $title;
82  }
83 
89  public function getIdentifier() {
90  return $this->identifier;
91  }
92 
99  public function setIdentifier($identifier) {
100  $this->identifier = $identifier;
101  }
102 
111  public function shouldRenderWizard() {
112  $showUpdate = 0;
113  $explanation = '';
114  $result = $this->checkForUpdate($explanation, $showUpdate);
115  return $showUpdate > 0 || $result == TRUE;
116  }
117 
126  public function shouldRenderNextButton() {
127  $showUpdate = 0;
128  $explanation = '';
129  $result = $this->checkForUpdate($explanation, $showUpdate);
130  return $showUpdate != 2 || $result == TRUE;
131  }
132 
139  public function checkIfTableExists($table) {
140  $databaseTables = $GLOBALS['TYPO3_DB']->admin_get_tables();
141  if (array_key_exists($table, $databaseTables)) {
142  return TRUE;
143  }
144  return FALSE;
145  }
146 
153  abstract public function checkForUpdate(&$description);
154 
162  abstract public function performUpdate(array &$dbQueries, &$customMessages);
163 
171  protected function installExtensions(array $extensionKeys) {
174  'TYPO3\\CMS\\Extensionmanager\\Utility\\InstallUtility'
175  );
176  foreach ($extensionKeys as $extension) {
177  $installUtility->install($extension);
178  }
179  }
180 
189  protected function markWizardAsDone($confValue = 1) {
190  \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Configuration\\ConfigurationManager')->setLocalConfigurationValueByPath('INSTALL/wizardDone/' . get_class($this), $confValue);
191  }
192 
198  protected function isWizardDone() {
199  $wizardClassName = get_class($this);
200  $done = FALSE;
201  if (
202  isset($GLOBALS['TYPO3_CONF_VARS']['INSTALL']['wizardDone'][$wizardClassName])
203  && $GLOBALS['TYPO3_CONF_VARS']['INSTALL']['wizardDone'][$wizardClassName]
204  ) {
205  $done = TRUE;
206  }
207  return $done;
208  }
209 
213  protected function getDatabaseConnection() {
214  return $GLOBALS['TYPO3_DB'];
215  }
216 
217 }
performUpdate(array &$dbQueries, &$customMessages)
if($list_of_literals) if(!empty($literals)) if(!empty($literals)) $result
Analyse literals to prepend the N char to them if their contents aren&#39;t numeric.
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]