[TASK] Migrate aboutmodules to extbase
[Packages/TYPO3.CMS.git] / typo3 / sysext / install / updates / class.tx_coreupdates_installfluidextbase.php
1 <?php
2 /***************************************************************
3 * Copyright notice
4 *
5 * (c) 2012 Christian Kuhn <lolli@schwarzbu.ch>
6 * All rights reserved
7 *
8 * This script is part of the TYPO3 project. The TYPO3 project is
9 * free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * The GNU General Public License can be found at
15 * http://www.gnu.org/copyleft/gpl.html.
16 * A copy is found in the textfile GPL.txt and important notices to the license
17 * from the author is found in LICENSE.txt distributed with these scripts.
18 *
19 *
20 * This script is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * This copyright notice MUST APPEAR in all copies of the script!
26 ***************************************************************/
27
28 /**
29 * Contains the update class for installing extbase and fluid
30 * for installed extensions that depend on it now.
31 *
32 * @author Christian Kuhn <lolli@schwarzbu.ch>
33 */
34 class tx_coreupdates_installFluidExtbase extends Tx_Install_Updates_Base {
35
36 /**
37 * @var string Title of this wizard
38 */
39 protected $title = 'Install fluid and extbase to satisfy dependencies of system extensions';
40
41 /**
42 * @var array Extensions keys that depend on fluid / extbase
43 */
44 protected $extensionsDependingOnFluidExtbase = array(
45 'aboutmodules',
46 'workspaces'
47 );
48
49 /**
50 * Checks if an update is needed
51 *
52 * @param string &$description: The description for the update
53 * @return boolean whether an update is needed (TRUE) or not (FALSE)
54 */
55 public function checkForUpdate(&$description) {
56 $result = FALSE;
57
58 $description = 'These loaded extensions depend on fluid and extbase:';
59 $description .= '<ul>';
60 if (!t3lib_extMgm::isLoaded('extbase') || !t3lib_extMgm::isLoaded('fluid')) {
61 foreach($this->extensionsDependingOnFluidExtbase as $extension) {
62 if (t3lib_extMgm::isLoaded($extension)) {
63 $result = TRUE;
64 $description .= '<li>' . $extension . '</li>';
65 }
66 }
67 }
68 $description .= '</ul>';
69
70 return $result;
71 }
72
73 /**
74 * Adds fluid and extbase to the extList in TYPO3_CONF_VARS
75 *
76 * @param array &$dbQueries: Queries done in this update
77 * @param mixed &$customMessages: Custom messages
78 * @return boolean Whether it worked (TRUE) or not (FALSE)
79 */
80 public function performUpdate(array &$dbQueries, &$customMessages) {
81 $this->installExtensions(array('extbase', 'fluid'));
82 return TRUE;
83 }
84 }
85 ?>