TYPO3 CMS  TYPO3_8-7
OpenidExtractionUpdate.php
Go to the documentation of this file.
1 <?php
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
16 
19 
24 {
28  protected $title = 'Installs extension "openid" from TER if openid is used.';
29 
33  protected $extensionKey = 'openid';
34 
38  protected $extensionDetails = [
39  'openid' => [
40  'title' => 'OpenID authentication',
41  'description' => 'Adds OpenID authentication to TYPO3',
42  'versionString' => '7.6.4',
43  'composerName' => 'friendsoftypo3/openid',
44  ],
45  ];
46 
53  public function checkForUpdate(&$description)
54  {
55  $updateNeeded = false;
56 
57  if (!$this->isWizardDone()) {
58  $columnsExists = false;
59 
60  $connectionPool = GeneralUtility::makeInstance(ConnectionPool::class);
61  $schemaManager = $connectionPool->getConnectionForTable('fe_users')->getSchemaManager();
62 
63  if ($schemaManager->listTableDetails('fe_users')->hasColumn('tx_openid_openid')) {
64  $columnsExists = true;
65  }
66 
67  // Reinitialize schemaManager, since be_users could be on another connection
68  $schemaManager = $connectionPool->getConnectionForTable('be_users')->getSchemaManager();
69 
70  if ($schemaManager->listTableDetails('be_users')->hasColumn('tx_openid_openid')) {
71  $columnsExists = true;
72  }
73  if ($columnsExists) {
74  $updateNeeded = true;
75  }
76  }
77 
78  $description = 'The extension "openid" (OpenID authentication) was extracted into '
79  . 'the TYPO3 Extension Repository. This update checks if openid id used and '
80  . 'downloads the TYPO3 Extension from the TER.';
81 
82  return $updateNeeded;
83  }
84 
92  public function performUpdate(array &$databaseQueries, &$customMessage)
93  {
94  $updateSuccessful = $this->installExtension($this->extensionKey, $customMessage);
95  if ($updateSuccessful) {
96  $this->markWizardAsDone();
97  }
98  return $updateSuccessful;
99  }
100 }
performUpdate(array &$databaseQueries, &$customMessage)
static makeInstance($className,... $constructorArguments)