[TASK] Fix typos & grammar issues in Install Tool
[Packages/TYPO3.CMS.git] / typo3 / sysext / install / Classes / Updates / CompressionLevelUpdate.php
1 <?php
2 namespace TYPO3\CMS\Install\Updates;
3
4 /***************************************************************
5 * Copyright notice
6 *
7 * (c) 2010-2013 Steffen Ritter (info@rs-websystems.de)
8 * All rights reserved
9 *
10 * This script is part of the TYPO3 project. The TYPO3 project is
11 * free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 * The GNU General Public License can be found at
17 * http://www.gnu.org/copyleft/gpl.html.
18 * A copy is found in the text file GPL.txt and important notices to the license
19 * from the author is found in LICENSE.txt distributed with these scripts.
20 *
21 *
22 * This script is distributed in the hope that it will be useful,
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 * GNU General Public License for more details.
26 *
27 * This copyright notice MUST APPEAR in all copies of the script!
28 ***************************************************************/
29 /**
30 * Contains the update class checking against configured compressionlevel. Used by the update wizard in the install tool.
31 *
32 * @author Steffen Ritter <info@rs-websystems.de>
33 */
34 class CompressionLevelUpdate extends AbstractUpdate {
35
36 /**
37 * @var string
38 */
39 protected $title = 'Check Compression Level';
40
41 /**
42 * Checks if there there is an compression level configured which may break the BE.
43 *
44 * @param string &$description The description for the update
45 * @return boolean Whether an update is needed (TRUE) or not (FALSE)
46 */
47 public function checkForUpdate(&$description) {
48 $description = '<p><strong>TYPO3_CONF_VARS[BE][compressionLevel] is enabled.</strong><br />
49 In TYPO3 4.4, compressionLevel was expanded to include automatic gzip compression of JavaScript and CSS stylesheet files.
50 <strong>To prevent the TYPO3 backend from being unusable, you must include the relevant lines from _.htaccess.</strong></p>';
51 if (!$this->isWizardDone() && intval($GLOBALS['TYPO3_CONF_VARS']['BE']['compressionLevel']) > 0) {
52 return TRUE;
53 }
54 return FALSE;
55 }
56
57 /**
58 * second step: get user info
59 *
60 * @param string Input prefix, all names of form fields have to start with this. Append custom name in [ ... ]
61 * @return string HTML output
62 */
63 public function getUserInput($inputPrefix) {
64 $content = '<p><strong>This configuration cannot be fixed automatically and requires a manual update.</strong> Please include the following lines from _.htaccess on top of your .htacess file.
65 <br /><br />
66 <pre>
67 &lt;FilesMatch "\\.js\\.gzip$"&gt;
68 AddType "text/javascript" .gzip
69 &lt;/FilesMatch&gt;
70 &lt;FilesMatch "\\.css\\.gzip$"&gt;
71 AddType "text/css" .gzip
72 &lt;/FilesMatch&gt;
73 AddEncoding gzip .gzip
74 </pre></p>';
75 return $content;
76 }
77
78 /**
79 * performs the action of the UpdateManager
80 *
81 * @param array &$dbQueries Queries done in this update
82 * @param mixed &$customMessages Custom messages
83 * @return boolean Whether everything went smoothly or not
84 */
85 public function performUpdate(array &$dbQueries, &$customMessages) {
86 $customMessages = 'Cannot automatically fix this problem! Please check manually.';
87 $this->markWizardAsDone();
88 return FALSE;
89 }
90
91 }