From 98e34ba88315e8218ec203c852d0624ea6a2c911 Mon Sep 17 00:00:00 2001 From: Benjamin Mack <benni@typo3.org> Date: Fri, 22 Jun 2012 15:05:59 +0200 Subject: [PATCH] [TASK] Clean up phpDoc comments in typo3/sysext/ Clean up phpDoc comments for the following classes: * typo3/sysext/info/ext_tables.php * typo3/sysext/info/mod1/conf.php * typo3/sysext/info/mod1/index.php * typo3/sysext/info_pagetsconfig/ class.tx_infopagetsconfig_webinfo.php * typo3/sysext/info_pagetsconfig/ext_tables.php * typo3/sysext/lang/ext_localconf.php * typo3/sysext/lang/hooks/clearcache/class.tx_lang_clearcache.php * typo3/sysext/lang/hooks/clearcache/class.tx_lang_clearcachemenu.php * typo3/sysext/lang/lang.php * typo3/sysext/lang/res/js/be/typo3lang.js * typo3/sysext/lowlevel/admin_cli.php * typo3/sysext/lowlevel/class.tx_lowlevel_admin_core.php * typo3/sysext/lowlevel/class.tx_lowlevel_cleaner_core.php * typo3/sysext/lowlevel/clmods/class.cleanflexform.php * typo3/sysext/lowlevel/clmods/class.deleted.php * typo3/sysext/lowlevel/clmods/class.double_files.php * typo3/sysext/lowlevel/clmods/class.lost_files.php * typo3/sysext/lowlevel/clmods/class.missing_files.php * typo3/sysext/lowlevel/clmods/class.missing_relations.php * typo3/sysext/lowlevel/clmods/class.orphan_records.php * typo3/sysext/lowlevel/clmods/class.rte_images.php * typo3/sysext/lowlevel/clmods/class.syslog.php * typo3/sysext/lowlevel/clmods/class.versions.php * typo3/sysext/lowlevel/config/conf.php * typo3/sysext/lowlevel/config/index.php * typo3/sysext/lowlevel/dbint/cli/cleaner_cli.php * typo3/sysext/lowlevel/dbint/cli/refindex_cli.php * typo3/sysext/lowlevel/dbint/conf.php * typo3/sysext/lowlevel/dbint/index.php * typo3/sysext/lowlevel/ext_localconf.php * typo3/sysext/lowlevel/ext_tables.php Clean up provides: * Provide correct parameter names in phpDoc * Provide correct data types in phpDoc * CGLify phpDoc (remove tabs) Change-Id: Ib348429f98c4f23d9b71028a8024273c78654eec Resolves: #38272 Releases: 6.0 Reviewed-on: http://review.typo3.org/12278 Reviewed-by: Benjamin Mack Tested-by: Benjamin Mack --- typo3/sysext/info/ext_tables.php | 4 +- typo3/sysext/info/mod1/conf.php | 10 +- typo3/sysext/info/mod1/index.php | 52 ++--- .../class.tx_infopagetsconfig_webinfo.php | 27 +-- typo3/sysext/info_pagetsconfig/ext_tables.php | 6 +- typo3/sysext/lang/ext_localconf.php | 4 +- .../clearcache/class.tx_lang_clearcache.php | 5 +- .../class.tx_lang_clearcachemenu.php | 4 +- typo3/sysext/lang/lang.php | 80 ++++---- typo3/sysext/lang/res/js/be/typo3lang.js | 2 +- typo3/sysext/lowlevel/admin_cli.php | 4 +- .../lowlevel/class.tx_lowlevel_admin_core.php | 18 +- .../class.tx_lowlevel_cleaner_core.php | 186 +++++++++--------- .../lowlevel/clmods/class.cleanflexform.php | 55 +++--- .../sysext/lowlevel/clmods/class.deleted.php | 25 +-- .../lowlevel/clmods/class.double_files.php | 22 +-- .../lowlevel/clmods/class.lost_files.php | 18 +- .../lowlevel/clmods/class.missing_files.php | 21 +- .../clmods/class.missing_relations.php | 23 +-- .../lowlevel/clmods/class.orphan_records.php | 28 +-- .../lowlevel/clmods/class.rte_images.php | 35 ++-- typo3/sysext/lowlevel/clmods/class.syslog.php | 15 +- .../sysext/lowlevel/clmods/class.versions.php | 45 ++--- typo3/sysext/lowlevel/config/conf.php | 10 +- typo3/sysext/lowlevel/config/index.php | 43 ++-- .../sysext/lowlevel/dbint/cli/cleaner_cli.php | 6 +- .../lowlevel/dbint/cli/refindex_cli.php | 4 +- typo3/sysext/lowlevel/dbint/conf.php | 10 +- typo3/sysext/lowlevel/dbint/index.php | 121 ++++++------ typo3/sysext/lowlevel/ext_localconf.php | 6 +- typo3/sysext/lowlevel/ext_tables.php | 6 +- 31 files changed, 446 insertions(+), 449 deletions(-) diff --git a/typo3/sysext/info/ext_tables.php b/typo3/sysext/info/ext_tables.php index 3dc3ced37901..2d52cb250510 100644 --- a/typo3/sysext/info/ext_tables.php +++ b/typo3/sysext/info/ext_tables.php @@ -1,6 +1,6 @@ <?php -if (!defined ('TYPO3_MODE')) { - die ('Access denied.'); +if (!defined('TYPO3_MODE')) { + die('Access denied.'); } if (TYPO3_MODE === 'BE') { diff --git a/typo3/sysext/info/mod1/conf.php b/typo3/sysext/info/mod1/conf.php index 51dfc3aaa422..f0c9c094896b 100755 --- a/typo3/sysext/info/mod1/conf.php +++ b/typo3/sysext/info/mod1/conf.php @@ -1,11 +1,11 @@ <?php define('TYPO3_MOD_PATH', 'sysext/info/mod1/'); -$BACK_PATH='../../../'; +$BACK_PATH = '../../../'; $MLANG['default']['tabs_images']['tab'] = 'info.gif'; -$MLANG['default']['ll_ref']='LLL:EXT:lang/locallang_mod_web_info.xml'; +$MLANG['default']['ll_ref'] = 'LLL:EXT:lang/locallang_mod_web_info.xml'; -$MCONF['script']='index.php'; -$MCONF['access']='user,group'; -$MCONF['name']='web_info'; +$MCONF['script'] = 'index.php'; +$MCONF['access'] = 'user,group'; +$MCONF['name'] = 'web_info'; ?> \ No newline at end of file diff --git a/typo3/sysext/info/mod1/index.php b/typo3/sysext/info/mod1/index.php index 91c227b86bb5..aef6220f2a0d 100755 --- a/typo3/sysext/info/mod1/index.php +++ b/typo3/sysext/info/mod1/index.php @@ -31,7 +31,7 @@ * Revised for TYPO3 3.6 November/2003 by Kasper Skårhøj * XHTML compliant * - * @author Kasper Skårhøj <kasperYYYY@typo3.com> + * @author Kasper Skårhøj <kasperYYYY@typo3.com> */ unset($MCONF); @@ -41,13 +41,11 @@ $LANG->includeLLFile('EXT:lang/locallang_mod_web_info.xml'); $BE_USER->modAccess($MCONF, 1); - - /** * Script Class for the Web > Info module * This class creates the framework to which other extensions can connect their sub-modules * - * @author Kasper Skårhøj <kasperYYYY@typo3.com> + * @author Kasper Skårhøj <kasperYYYY@typo3.com> * @package TYPO3 * @subpackage core */ @@ -68,11 +66,11 @@ class SC_mod_web_info_index extends t3lib_SCbase { /** * Initialize module header etc and call extObjContent function * - * @return void + * @return void */ function main() { - // Access check... - // The page will show only if there is a valid page and if this page may be viewed by the user + // Access check... + // The page will show only if there is a valid page and if this page may be viewed by the user $this->pageinfo = t3lib_BEfunc::readPageAccess($this->id, $this->perms_clause); $access = is_array($this->pageinfo) ? 1 : 0; @@ -85,14 +83,14 @@ class SC_mod_web_info_index extends t3lib_SCbase { $this->doc = t3lib_div::makeInstance('template'); $this->doc->backPath = $GLOBALS['BACK_PATH']; $this->doc->setModuleTemplate('templates/info.html'); - $this->doc->tableLayout = Array ( - '0' => Array ( - '0' => Array('<td valign="top"><strong>', '</strong></td>'), - "defCol" => Array('<td><img src="'.$this->doc->backPath.'clear.gif" width="10" height="1" alt="" /></td><td valign="top"><strong>', '</strong></td>') + $this->doc->tableLayout = array ( + '0' => array ( + '0' => array('<td valign="top"><strong>', '</strong></td>'), + "defCol" => array('<td><img src="'.$this->doc->backPath.'clear.gif" width="10" height="1" alt="" /></td><td valign="top"><strong>', '</strong></td>') ), - "defRow" => Array ( - "0" => Array('<td valign="top">', '</td>'), - "defCol" => Array('<td><img src="'.$this->doc->backPath.'clear.gif" width="10" height="1" alt="" /></td><td valign="top">', '</td>') + "defRow" => array ( + "0" => array('<td valign="top">', '</td>'), + "defCol" => array('<td><img src="'.$this->doc->backPath.'clear.gif" width="10" height="1" alt="" /></td><td valign="top">', '</td>') ) ); @@ -138,7 +136,7 @@ class SC_mod_web_info_index extends t3lib_SCbase { $this->content .= $this->doc->spacer(5); $this->content .= $this->doc->spacer(10); } - // Renders the module page + // Renders the module page $this->content = $this->doc->render( $GLOBALS['LANG']->getLL('title'), $this->content @@ -148,7 +146,7 @@ class SC_mod_web_info_index extends t3lib_SCbase { /** * Print module content (from $this->content) * - * @return void + * @return void */ function printContent() { $this->content = $this->doc->insertStylesAndJS($this->content); @@ -158,7 +156,7 @@ class SC_mod_web_info_index extends t3lib_SCbase { /** * Create the panel of buttons for submitting the form or otherwise perform operations. * - * @return array all available buttons as an assoc. array + * @return array All available buttons as an assoc. array */ protected function getButtons() { $buttons = array( @@ -198,17 +196,23 @@ class SC_mod_web_info_index extends t3lib_SCbase { } } -// Make instance: + // Make instance: $SOBE = t3lib_div::makeInstance('SC_mod_web_info_index'); $SOBE->init(); -// Include files? -foreach($SOBE->include_once as $INC_FILE) include_once($INC_FILE); -$SOBE->checkExtObj(); // Checking for first level external objects + // Include files? +foreach($SOBE->include_once as $INC_FILE) { + include_once($INC_FILE); +} + // Checking for first level external objects +$SOBE->checkExtObj(); -// Repeat Include files! - if any files has been added by second-level extensions -foreach($SOBE->include_once as $INC_FILE) include_once($INC_FILE); -$SOBE->checkSubExtObj(); // Checking second level external objects + // Repeat Include files! - if any files has been added by second-level extensions +foreach($SOBE->include_once as $INC_FILE) { + include_once($INC_FILE); +} + // Checking second level external objects +$SOBE->checkSubExtObj(); $SOBE->main(); $SOBE->printContent(); diff --git a/typo3/sysext/info_pagetsconfig/class.tx_infopagetsconfig_webinfo.php b/typo3/sysext/info_pagetsconfig/class.tx_infopagetsconfig_webinfo.php index 8ff5aa08037e..6f95525a84c6 100755 --- a/typo3/sysext/info_pagetsconfig/class.tx_infopagetsconfig_webinfo.php +++ b/typo3/sysext/info_pagetsconfig/class.tx_infopagetsconfig_webinfo.php @@ -30,22 +30,21 @@ * Revised for TYPO3 3.7 June/2004 by Kasper Skårhøj * XHTML compliant * - * @author Kasper Skårhøj <kasperYYYY@typo3.com> + * @author Kasper Skårhøj <kasperYYYY@typo3.com> */ /** * Page TSconfig viewer * - * @author Kasper Skårhøj <kasperYYYY@typo3.com> + * @author Kasper Skårhøj <kasperYYYY@typo3.com> * @package TYPO3 * @subpackage tx_infopagetsconfig */ class tx_infopagetsconfig_webinfo extends t3lib_extobjbase { - /** * Function menu initialization * - * @return array Menu array + * @return array Menu array */ function modMenu() { global $LANG; @@ -71,14 +70,16 @@ class tx_infopagetsconfig_webinfo extends t3lib_extobjbase { 'tsconf_alphaSort' => '1', ); - if (!$GLOBALS['BE_USER']->isAdmin()) unset($modMenuAdd['tsconf_parts'][99]); + if (!$GLOBALS['BE_USER']->isAdmin()) { + unset($modMenuAdd['tsconf_parts'][99]); + } return $modMenuAdd; } /** * Main function of class * - * @return string HTML output + * @return string HTML output */ function main() { global $LANG; @@ -94,8 +95,8 @@ class tx_infopagetsconfig_webinfo extends t3lib_extobjbase { $lines = array(); $pUids = array(); - foreach($TSparts as $k => $v) { - if ($k!='uid_0') { + foreach ($TSparts as $k => $v) { + if ($k != 'uid_0') { if ($k=='defaultPageTSconfig') { $pTitle = '<strong>'.$GLOBALS['LANG']->getLL('editTSconfig_default', 1).'</strong>'; $editIcon = ''; @@ -147,8 +148,10 @@ class tx_infopagetsconfig_webinfo extends t3lib_extobjbase { 1 ); } else { - $tmpl = t3lib_div::makeInstance('t3lib_tsparser_ext'); // Defined global here! - $tmpl->tt_track = 0; // Do not log time-performance information + // Defined global here! + $tmpl = t3lib_div::makeInstance('t3lib_tsparser_ext'); + // Do not log time-performance information + $tmpl->tt_track = 0; $tmpl->fixedLgd = 0; $tmpl->linkObjects = 0; @@ -202,7 +205,9 @@ class tx_infopagetsconfig_webinfo extends t3lib_extobjbase { } $modTSconfig = $modTSconfig['properties']; - if (!is_array($modTSconfig)) $modTSconfig = array(); + if (!is_array($modTSconfig)) { + $modTSconfig = array(); + } $theOutput .= $this->pObj->doc->section('', t3lib_BEfunc::cshItem('_MOD_' . $GLOBALS['MCONF']['name'], 'tsconfig_hierarchy', $GLOBALS['BACK_PATH'], '|<br />') . diff --git a/typo3/sysext/info_pagetsconfig/ext_tables.php b/typo3/sysext/info_pagetsconfig/ext_tables.php index 51ed9b531916..fea0fd470618 100755 --- a/typo3/sysext/info_pagetsconfig/ext_tables.php +++ b/typo3/sysext/info_pagetsconfig/ext_tables.php @@ -1,7 +1,9 @@ <?php -if (!defined ('TYPO3_MODE')) die ('Access denied.'); +if (!defined('TYPO3_MODE')) { + die('Access denied.'); +} -if (TYPO3_MODE=='BE') { +if (TYPO3_MODE == 'BE') { t3lib_extMgm::insertModuleFunction( 'web_info', 'tx_infopagetsconfig_webinfo', diff --git a/typo3/sysext/lang/ext_localconf.php b/typo3/sysext/lang/ext_localconf.php index 3e498ab4a6ae..c89475acd8c8 100644 --- a/typo3/sysext/lang/ext_localconf.php +++ b/typo3/sysext/lang/ext_localconf.php @@ -1,6 +1,6 @@ <?php -if (!defined ('TYPO3_MODE')) { - die ('Access denied.'); +if (!defined('TYPO3_MODE')) { + die('Access denied.'); } // Register cache t3lib_l10n diff --git a/typo3/sysext/lang/hooks/clearcache/class.tx_lang_clearcache.php b/typo3/sysext/lang/hooks/clearcache/class.tx_lang_clearcache.php index 7de5bd8a82c3..0017f74d6a8c 100644 --- a/typo3/sysext/lang/hooks/clearcache/class.tx_lang_clearcache.php +++ b/typo3/sysext/lang/hooks/clearcache/class.tx_lang_clearcache.php @@ -27,8 +27,8 @@ /** * Class to clear temp files of htmlArea RTE * - * @author Dominique Feyer <dominique.feyer@reelpeek.net> - * @package TYPO3 + * @author Dominique Feyer <dominique.feyer@reelpeek.net> + * @package TYPO3 * @subpackage tx_Lang */ class tx_lang_clearcache { @@ -65,7 +65,6 @@ class tx_lang_clearcache { } $this->cacheInstance->flush(); } - } ?> \ No newline at end of file diff --git a/typo3/sysext/lang/hooks/clearcache/class.tx_lang_clearcachemenu.php b/typo3/sysext/lang/hooks/clearcache/class.tx_lang_clearcachemenu.php index 6af1c021d5f0..f9625841bb37 100644 --- a/typo3/sysext/lang/hooks/clearcache/class.tx_lang_clearcachemenu.php +++ b/typo3/sysext/lang/hooks/clearcache/class.tx_lang_clearcachemenu.php @@ -28,8 +28,8 @@ /** * Extending class to render the menu for the cache clearing actions, and adding Clear lang/l10n cache option * - * @author Dominique Feyer <dominique.feyer@reelpeek.net> - * @package TYPO3 + * @author Dominique Feyer <dominique.feyer@reelpeek.net> + * @package TYPO3 * @subpackage tx_Lang */ class tx_lang_clearcachemenu implements backend_cacheActionsHook { diff --git a/typo3/sysext/lang/lang.php b/typo3/sysext/lang/lang.php index b64e1cf3bc96..e81c4755e598 100755 --- a/typo3/sysext/lang/lang.php +++ b/typo3/sysext/lang/lang.php @@ -27,7 +27,7 @@ /** * Contains the TYPO3 Backend Language class * - * @author Kasper Skårhøj <kasperYYYY@typo3.com> + * @author Kasper Skårhøj <kasperYYYY@typo3.com> */ /** @@ -39,7 +39,7 @@ * This class is normally instantiated as the global variable $LANG in typo3/template.php * It's only available in the backend and under certain circumstances in the frontend * - * @author Kasper Skårhøj <kasperYYYY@typo3.com> + * @author Kasper Skårhøj <kasperYYYY@typo3.com> * @package TYPO3 * @subpackage core * @see typo3/template.php, template @@ -77,7 +77,7 @@ class language { /** * If TRUE, will show the key/location of labels in the backend. - * @var bool + * @var boolean */ public $debugKey = FALSE; @@ -133,7 +133,7 @@ class language { * $LANG->init($GLOBALS['BE_USER']->uc['lang']); * * @throws RuntimeException - * @param string $lang The language key (two character string from backend users profile) + * @param string $lang The language key (two character string from backend users profile) * @return void */ public function init($lang) { @@ -178,11 +178,11 @@ class language { /** * Adds labels and image references from the backend modules to the internal moduleLabels array * - * @param array $arr Array with references to module labels, keys: ['labels']['tablabel'], + * @param array $arr Array with references to module labels, keys: ['labels']['tablabel'], * ['labels']['tabdescr'], ['tabs']['tab'] - * @param string $prefix Module name prefix + * @param string $prefix Module name prefix * @return void - * @see t3lib_loadModules + * @see t3lib_loadModules */ public function addModuleLabels($arr, $prefix) { if (is_array($arr)) { @@ -208,9 +208,9 @@ class language { * is used in the document otherwise (only MSIE, Mozilla is OK). * So by converting we by-pass this problem. * - * @param string $str Input string - * @return string Output string - * @access public + * @param string $str Input string + * @return string Output string + * @access public */ public function makeEntities($str) { // Convert string back again, but using the full entity conversion: @@ -225,9 +225,9 @@ class language { * rawurlencode() in order to pass strings in a safe way. This could still be done * for iso-8859-1 charsets but now I have applied the same method here for all charsets. * - * @param string $str Input string, encoded with UTF-8 - * @return string Output string, a JavaScript function: "String.fromCharCode(......)" - * @access public + * @param string $str Input string, encoded with UTF-8 + * @return string Output string, a JavaScript function: "String.fromCharCode(......)" + * @access public */ public function JScharCode($str) { // Convert the UTF-8 string into a array of char numbers: @@ -250,10 +250,10 @@ class language { * Returns the label with key $index form the globally loaded $LOCAL_LANG array. * Mostly used from modules with only one LOCAL_LANG file loaded into the global space. * - * @param string $index Label key - * @param boolean $hsc If set, the return value is htmlspecialchar'ed - * @return string - * @access public + * @param string $index Label key + * @param boolean $hsc If set, the return value is htmlspecialchar'ed + * @return string + * @access public */ public function getLL($index, $hsc = FALSE) { // Get Local Language @@ -272,11 +272,11 @@ class language { * Works like ->getLL() but takes the $LOCAL_LANG array * used as the second argument instead of using the global array. * - * @param string $index Label key - * @param array $localLanguage $LOCAL_LANG array to get label key from - * @param boolean $hsc If set, the return value is htmlspecialchar'ed - * @return string - * @access public + * @param string $index Label key + * @param array $localLanguage $LOCAL_LANG array to get label key from + * @param boolean $hsc If set, the return value is htmlspecialchar'ed + * @return string + * @access public */ public function getLLL($index, $localLanguage, $hsc = FALSE) { // Get Local Language. Special handling for all extensions that @@ -304,10 +304,10 @@ class language { * (and thereby it's highly deprecated to use 'language-splitted' label strings) * Refer to 'Inside TYPO3' for more details * - * @param string $input Label key/reference - * @param boolean $hsc If set, the return value is htmlspecialchar'ed - * @return string - * @access public + * @param string $input Label key/reference + * @param boolean $hsc If set, the return value is htmlspecialchar'ed + * @return string + * @access public */ public function sL($input, $hsc = FALSE) { // If cached label @@ -357,9 +357,9 @@ class language { * as defined in $TCA_DESCR[$table]['refs'] * $TCA_DESCR is a global var * - * @param string $table Table name found as key in global array $TCA_DESCR - * @return void - * @access public + * @param string $table Table name found as key in global array $TCA_DESCR + * @return void + * @access public */ public function loadSingleTableDescription($table) { @@ -432,11 +432,11 @@ class language { * Includes locallang file (and possibly additional localized version if configured for) * Read language labels will be merged with $LOCAL_LANG (if $setGlobal = TRUE). * - * @param string $fileRef $fileRef is a file-reference (see t3lib_div::getFileAbsFileName) - * @param boolean $setGlobal Setting in global variable $LOCAL_LANG (or returning the variable) - * @param boolean $mergeLocalOntoDefault If $mergeLocalOntoDefault is set the local part of the $LOCAL_LANG array is merged onto the default part (if the local part exists) and the local part is unset. - * @return mixed If $setGlobal is TRUE the LL-files will set the $LOCAL_LANG in the global scope. Otherwise the $LOCAL_LANG array is returned from function - * @access public + * @param string $fileRef $fileRef is a file-reference (see t3lib_div::getFileAbsFileName) + * @param boolean $setGlobal Setting in global variable $LOCAL_LANG (or returning the variable) + * @param boolean $mergeLocalOntoDefault If $mergeLocalOntoDefault is set the local part of the $LOCAL_LANG array is merged onto the default part (if the local part exists) and the local part is unset. + * @return mixed If $setGlobal is TRUE the LL-files will set the $LOCAL_LANG in the global scope. Otherwise the $LOCAL_LANG array is returned from function + * @access public */ public function includeLLFile($fileRef, $setGlobal = TRUE, $mergeLocalOntoDefault = FALSE) { @@ -482,9 +482,9 @@ class language { /** * Includes a locallang file and returns the $LOCAL_LANG array found inside. * - * @param string $fileRef Input is a file-reference (see t3lib_div::getFileAbsFileName) which, if exists, is included. That file is expected to be a 'local_lang' file containing a $LOCAL_LANG array. - * @return array Value of $LOCAL_LANG found in the included file. If that array is found it's returned. Otherwise an empty array - * @access private + * @param string $fileRef Input is a file-reference (see t3lib_div::getFileAbsFileName) which, if exists, is included. That file is expected to be a 'local_lang' file containing a $LOCAL_LANG array. + * @return array Value of $LOCAL_LANG found in the included file. If that array is found it's returned. Otherwise an empty array + * @access private */ protected function readLLfile($fileRef) { if ($this->lang !== 'default') { @@ -513,9 +513,9 @@ class language { /** * Returns localized fileRef (.[langkey].php) * - * @param string $fileRef Filename/path of a 'locallang.php' file - * @return string Input filename with a '.[lang-key].php' ending added if $this->lang is not 'default' - * @access private + * @param string $fileRef Filename/path of a 'locallang.php' file + * @return string Input filename with a '.[lang-key].php' ending added if $this->lang is not 'default' + * @access private */ protected function localizedFileRef($fileRef) { if ($this->lang != 'default' && substr($fileRef, -4) == '.php') { diff --git a/typo3/sysext/lang/res/js/be/typo3lang.js b/typo3/sysext/lang/res/js/be/typo3lang.js index 85cc526dc6a5..c8ab1cea40b4 100644 --- a/typo3/sysext/lang/res/js/be/typo3lang.js +++ b/typo3/sysext/lang/res/js/be/typo3lang.js @@ -80,4 +80,4 @@ TYPO3.l10n = function() { }; }(); -TYPO3.l10n.initialize(); +TYPO3.l10n.initialize(); \ No newline at end of file diff --git a/typo3/sysext/lowlevel/admin_cli.php b/typo3/sysext/lowlevel/admin_cli.php index a990f097f52e..9f80ef064bec 100755 --- a/typo3/sysext/lowlevel/admin_cli.php +++ b/typo3/sysext/lowlevel/admin_cli.php @@ -1,6 +1,8 @@ <?php -if (!defined('TYPO3_cliMode')) die('You cannot run this script directly!'); +if (!defined('TYPO3_cliMode')) { + die('You cannot run this script directly!'); +} require_once(t3lib_extMgm::extPath('lowlevel').'class.tx_lowlevel_admin_core.php'); diff --git a/typo3/sysext/lowlevel/class.tx_lowlevel_admin_core.php b/typo3/sysext/lowlevel/class.tx_lowlevel_admin_core.php index 7f78e13cd561..24f75bbc32e3 100644 --- a/typo3/sysext/lowlevel/class.tx_lowlevel_admin_core.php +++ b/typo3/sysext/lowlevel/class.tx_lowlevel_admin_core.php @@ -27,12 +27,12 @@ /** * Core functions for admin * - * @author Kasper Skårhøj <kasperYYYY@typo3.com> + * @author Kasper Skårhøj <kasperYYYY@typo3.com> */ /** * Core functions for administration * - * @author Kasper Skårhøj <kasperYYYY@typo3.com> + * @author Kasper Skårhøj <kasperYYYY@typo3.com> * @package TYPO3 * @subpackage tx_lowlevel */ @@ -46,8 +46,6 @@ class tx_lowlevel_admin_core extends t3lib_cli { /** * Constructor - * - * @return void */ function __construct() { @@ -65,12 +63,6 @@ class tx_lowlevel_admin_core extends t3lib_cli { $this->cli_help['author'] = "Kasper Skaarhoej, (c) 2009"; } - - - - - - /************************** * * CLI functionality @@ -80,8 +72,8 @@ class tx_lowlevel_admin_core extends t3lib_cli { /** * CLI engine * - * @param array Command line arguments - * @return string + * @param array $argv Command line arguments + * @return string */ function cli_main($argv) { @@ -98,7 +90,7 @@ class tx_lowlevel_admin_core extends t3lib_cli { } // Analysis type: - switch((string)$analysisType) { + switch ((string)$analysisType) { case 'setBElock': if (@is_file(PATH_typo3conf.'LOCK_BACKEND')) { $this->cli_echo("A lockfile already exists. Overwriting it... \n"); diff --git a/typo3/sysext/lowlevel/class.tx_lowlevel_cleaner_core.php b/typo3/sysext/lowlevel/class.tx_lowlevel_cleaner_core.php index 5390a69e7fdc..93317784b9ca 100644 --- a/typo3/sysext/lowlevel/class.tx_lowlevel_cleaner_core.php +++ b/typo3/sysext/lowlevel/class.tx_lowlevel_cleaner_core.php @@ -27,14 +27,13 @@ /** * Core functions for cleaning and analysing * - * @author Kasper Skårhøj <kasperYYYY@typo3.com> + * @author Kasper Skårhøj <kasperYYYY@typo3.com> */ - /** * Core functions for cleaning and analysing * - * @author Kasper Skårhøj <kasperYYYY@typo3.com> + * @author Kasper Skårhøj <kasperYYYY@typo3.com> * @package TYPO3 * @subpackage tx_lowlevel */ @@ -43,8 +42,6 @@ class tx_lowlevel_cleaner_core extends t3lib_cli { var $genTree_traverseDeleted = TRUE; var $genTree_traverseVersions = TRUE; - - var $label_infoString = 'The list of records is organized as [table]:[uid]:[field]:[flexpointer]:[softref_key]'; var $pagetreePlugins = array(); var $cleanerModules = array(); @@ -53,11 +50,8 @@ class tx_lowlevel_cleaner_core extends t3lib_cli { protected $workspaceIndex = array(); - /** * Constructor - * - * @return void */ function __construct() { @@ -85,12 +79,6 @@ class tx_lowlevel_cleaner_core extends t3lib_cli { $this->cli_help['author'] = "Kasper Skaarhoej, (c) 2006"; } - - - - - - /************************** * * CLI functionality @@ -100,8 +88,8 @@ class tx_lowlevel_cleaner_core extends t3lib_cli { /** * CLI engine * - * @param array Command line arguments - * @return string + * @param array $argv Command line arguments + * @return string */ function cli_main($argv) { @@ -125,13 +113,14 @@ class tx_lowlevel_cleaner_core extends t3lib_cli { } // Analysis type: - switch((string)$analysisType) { + switch ((string)$analysisType) { default: if (is_array($this->cleanerModules[$analysisType])) { $cleanerMode = t3lib_div::getUserObj($this->cleanerModules[$analysisType][0]); $cleanerMode->cli_validateArgs(); - if ($this->cli_isArg('-r')) { // Run it... + // Run it... + if ($this->cli_isArg('-r')) { if (!$cleanerMode->checkRefIndex || $this->cli_referenceIndexCheck()) { $res = $cleanerMode->main(); $this->cli_printInfo($analysisType, $res); @@ -160,7 +149,7 @@ class tx_lowlevel_cleaner_core extends t3lib_cli { /** * Checks reference index * - * @return boolean TRUE if reference index was OK (either OK, updated or ignored) + * @return boolean TRUE if reference index was OK (either OK, updated or ignored) */ function cli_referenceIndexCheck() { @@ -171,13 +160,13 @@ class tx_lowlevel_cleaner_core extends t3lib_cli { exit; } - switch($refIndexMode) { + switch ($refIndexMode) { case 'check': case 'update': $refIndexObj = t3lib_div::makeInstance('t3lib_refindex'); list($headerContent, $bodyContent, $errorCount) = $refIndexObj->updateIndex($refIndexMode=='check', $this->cli_echo()); - if ($errorCount && $refIndexMode=='check') { + if ($errorCount && $refIndexMode == 'check') { $ok = FALSE; $this->cli_echo("ERROR: Reference Index Check failed! (run with '--refindex update' to fix)\n", 1); } else { @@ -194,8 +183,8 @@ class tx_lowlevel_cleaner_core extends t3lib_cli { } /** - * @param [type] $matchString: ... - * @return string If string, it's the reason for not executing. Returning FALSE means it should execute. + * @param string $matchString + * @return string If string, it's the reason for not executing. Returning FALSE means it should execute. */ function cli_noExecutionCheck($matchString) { @@ -210,15 +199,17 @@ class tx_lowlevel_cleaner_core extends t3lib_cli { } } // Check for - if ($this->cli_isArg('--dryrun')) return 'BYPASS: --dryrun set'; + if ($this->cli_isArg('--dryrun')) { + return 'BYPASS: --dryrun set'; + } } /** * Formats a result array from a test so it fits output in the shell * - * @param string name of the test (eg. function name) - * @param array Result array from an analyze function - * @return void Outputs with echo - capture content with output buffer if needed. + * @param string $header Name of the test (eg. function name) + * @param array $res Result array from an analyze function + * @return void Outputs with echo - capture content with output buffer if needed. */ function cli_printInfo($header, $res) { @@ -243,7 +234,7 @@ class tx_lowlevel_cleaner_core extends t3lib_cli { // Traverse headers for output: if (is_array($res['headers'])) { - foreach($res['headers'] as $key => $value) { + foreach ($res['headers'] as $key => $value) { if ($detailLevel <= intval($value[2])) { if (is_array($res[$key]) && (count($res[$key]) || !$silent)) { @@ -273,17 +264,6 @@ class tx_lowlevel_cleaner_core extends t3lib_cli { } } - - - - - - - - - - - /************************** * * Page tree traversal @@ -294,13 +274,13 @@ class tx_lowlevel_cleaner_core extends t3lib_cli { * Traverses the FULL/part of page tree, mainly to register ALL validly connected records (to find orphans) but also to register deleted records, versions etc. * Output (in $this->recStats) can be useful for multiple purposes. * - * @param integer Root page id from where to start traversal. Use "0" (zero) to have full page tree (necessary when spotting orphans, otherwise you can run it on parts only) - * @param integer Depth to traverse. zero is do not traverse at all. 1 = 1 sublevel, 1000= 1000 sublevels (all...) - * @param boolean If >0, will echo information about the traversal process. - * @param string Call back function (from this class or subclass) - * @return void + * @param integer $rootID Root page id from where to start traversal. Use "0" (zero) to have full page tree (necessary when spotting orphans, otherwise you can run it on parts only) + * @param integer $depth Depth to traverse. zero is do not traverse at all. 1 = 1 sublevel, 1000= 1000 sublevels (all...) + * @param boolean $echoLevel If >0, will echo information about the traversal process. + * @param string $callBack Call back function (from this class or subclass) + * @return void */ - function genTree($rootID, $depth=1000, $echoLevel=0, $callBack='') { + function genTree($rootID, $depth = 1000, $echoLevel = 0, $callBack = '') { $pt = t3lib_div::milliseconds(); $this->performanceStatistics['genTree()'] = ''; @@ -333,21 +313,23 @@ class tx_lowlevel_cleaner_core extends t3lib_cli { $this->performanceStatistics['genTree_traverse()'] = t3lib_div::milliseconds()-$pt2; // Sort recStats (for diff'able displays) - foreach($this->recStats as $kk => $vv) { - foreach($this->recStats[$kk] as $tables => $recArrays) { + foreach ($this->recStats as $kk => $vv) { + foreach ($this->recStats[$kk] as $tables => $recArrays) { ksort($this->recStats[$kk][$tables]); } ksort($this->recStats[$kk]); } - if ($echoLevel>0) echo LF.LF; + if ($echoLevel > 0) { + echo LF . LF; + } // Processing performance statistics: $this->performanceStatistics['genTree()'] = t3lib_div::milliseconds()-$pt; // Count records: - foreach($GLOBALS['TCA'] as $tableName => $cfg) { + foreach ($GLOBALS['TCA'] as $tableName => $cfg) { // Select all records belonging to page: $resSub = $GLOBALS['TYPO3_DB']->exec_SELECTquery( 'count(*)', @@ -363,7 +345,7 @@ class tx_lowlevel_cleaner_core extends t3lib_cli { } $this->performanceStatistics['recStats_size']['(ALL)']=strlen(serialize($this->recStats)); - foreach($this->recStats as $key => $arrcontent) { + foreach ($this->recStats as $key => $arrcontent) { $this->performanceStatistics['recStats_size'][$key]=strlen(serialize($arrcontent)); } } @@ -371,17 +353,17 @@ class tx_lowlevel_cleaner_core extends t3lib_cli { /** * Recursive traversal of page tree: * - * @param integer Page root id (must be online, valid page record - or zero for page tree root) - * @param integer Depth - * @param integer Echo Level - * @param string Call back function (from this class or subclass) - * @param string DON'T set from outside, internal. (indicates we are inside a version of a page) - * @param integer DON'T set from outside, internal. (1: Indicates that rootID is a version of a page, 2: ...that it is even a version of a version (which triggers a warning!) - * @param string Internal string that accumulates the path - * @return void + * @param integer $rootID Page root id (must be online, valid page record - or zero for page tree root) + * @param integer $depth Depth + * @param integer $echoLevel Echo Level + * @param string $callBack Call back function (from this class or subclass) + * @param string $versionSwapmode DON'T set from outside, internal. (indicates we are inside a version of a page) + * @param integer $rootIsVersion DON'T set from outside, internal. (1: Indicates that rootID is a version of a page, 2: ...that it is even a version of a version (which triggers a warning!) + * @param string $accumulatedPath Internal string that accumulates the path + * @return void * @access private */ - function genTree_traverse($rootID, $depth, $echoLevel=0, $callBack='', $versionSwapmode='', $rootIsVersion=0, $accumulatedPath='') { + function genTree_traverse($rootID, $depth, $echoLevel = 0, $callBack = '', $versionSwapmode = '', $rootIsVersion = 0, $accumulatedPath = '') { // Register page: $this->recStats['all']['pages'][$rootID] = $rootID; @@ -395,27 +377,31 @@ class tx_lowlevel_cleaner_core extends t3lib_cli { // If rootIsVersion is set it means that the input rootID is that of a version of a page. See below where the recursive call is made. if ($rootIsVersion) { $this->recStats['versions']['pages'][$rootID] = $rootID; - if ($pageRecord['t3ver_count']>=1 && $pageRecord['t3ver_wsid']==0) { // If it has been published and is in archive now... + // If it has been published and is in archive now... + if ($pageRecord['t3ver_count'] >= 1 && $pageRecord['t3ver_wsid'] == 0) { $this->recStats['versions_published']['pages'][$rootID] = $rootID; } - if ($pageRecord['t3ver_wsid']==0) { // If it has been published and is in archive now... + // If it has been published and is in archive now... + if ($pageRecord['t3ver_wsid'] == 0) { $this->recStats['versions_liveWS']['pages'][$rootID] = $rootID; } - if (!isset($this->workspaceIndex[$pageRecord['t3ver_wsid']])) { // If it doesn't belong to a workspace... + // If it doesn't belong to a workspace... + if (!isset($this->workspaceIndex[$pageRecord['t3ver_wsid']])) { $this->recStats['versions_lost_workspace']['pages'][$rootID] = $rootID; } - if ($rootIsVersion==2) { // In case the rootID is a version inside a versioned page + // In case the rootID is a version inside a versioned page + if ($rootIsVersion == 2) { $this->recStats['versions_inside_versioned_page']['pages'][$rootID] = $rootID; } } - if ($echoLevel>0) + if ($echoLevel > 0) echo LF.$accumulatedPath.' ['.$rootID.']'. ($pageRecord['deleted'] ? ' (DELETED)':''). ($this->recStats['versions_published']['pages'][$rootID] ? ' (PUBLISHED)':''); - if ($echoLevel>1 && $this->recStats['versions_lost_workspace']['pages'][$rootID]) + if ($echoLevel > 1 && $this->recStats['versions_lost_workspace']['pages'][$rootID]) echo LF.' ERROR! This version belongs to non-existing workspace ('.$pageRecord['t3ver_wsid'].')!'; - if ($echoLevel>1 && $this->recStats['versions_inside_versioned_page']['pages'][$rootID]) + if ($echoLevel > 1 && $this->recStats['versions_inside_versioned_page']['pages'][$rootID]) echo LF.' WARNING! This version is inside an already versioned page or branch!'; // Call back: @@ -426,11 +412,11 @@ class tx_lowlevel_cleaner_core extends t3lib_cli { $pt3 = t3lib_div::milliseconds(); // Traverse tables of records that belongs to page: - foreach($GLOBALS['TCA'] as $tableName => $cfg) { + foreach ($GLOBALS['TCA'] as $tableName => $cfg) { if ($tableName!='pages') { // Select all records belonging to page: - $pt4=t3lib_div::milliseconds(); + $pt4 = t3lib_div::milliseconds(); $resSub = $GLOBALS['TYPO3_DB']->exec_SELECTquery( 'uid'.($GLOBALS['TCA'][$tableName]['ctrl']['delete']?','.$GLOBALS['TCA'][$tableName]['ctrl']['delete']:''), $tableName, @@ -440,37 +426,49 @@ class tx_lowlevel_cleaner_core extends t3lib_cli { $this->performanceStatistics['genTree_traverse():TraverseTables:']['MySQL']['(ALL)']+= t3lib_div::milliseconds()-$pt4; $this->performanceStatistics['genTree_traverse():TraverseTables:']['MySQL'][$tableName]+= t3lib_div::milliseconds()-$pt4; - $pt5=t3lib_div::milliseconds(); + $pt5 = t3lib_div::milliseconds(); $count = $GLOBALS['TYPO3_DB']->sql_num_rows($resSub); if ($count) { - if ($echoLevel==2) echo LF.' \-'.$tableName.' ('.$count.')'; + if ($echoLevel == 2) { + echo LF.' \-'.$tableName.' ('.$count.')'; + } } while ($rowSub = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($resSub)) { - if ($echoLevel==3) echo LF.' \-'.$tableName.':'.$rowSub['uid']; + if ($echoLevel==3) { + echo LF.' \-'.$tableName.':'.$rowSub['uid']; + } // If the rootID represents an "element" or "page" version type, we must check if the record from this table is allowed to belong to this: if ($versionSwapmode=='SWAPMODE:-1' || ($versionSwapmode=='SWAPMODE:0' && !$GLOBALS['TCA'][$tableName]['ctrl']['versioning_followPages'])) { // This is illegal records under a versioned page - therefore not registered in $this->recStats['all'] so they should be orphaned: $this->recStats['illegal_record_under_versioned_page'][$tableName][$rowSub['uid']] = $rowSub['uid']; - if ($echoLevel>1) echo LF.' ERROR! Illegal record ('.$tableName.':'.$rowSub['uid'].') under versioned page!'; + if ($echoLevel>1) { + echo LF.' ERROR! Illegal record ('.$tableName.':'.$rowSub['uid'].') under versioned page!'; + } } else { $this->recStats['all'][$tableName][$rowSub['uid']] = $rowSub['uid']; // Register deleted: if ($GLOBALS['TCA'][$tableName]['ctrl']['delete'] && $rowSub[$GLOBALS['TCA'][$tableName]['ctrl']['delete']]) { $this->recStats['deleted'][$tableName][$rowSub['uid']] = $rowSub['uid']; - if ($echoLevel==3) echo ' (DELETED)'; + if ($echoLevel == 3) { + echo ' (DELETED)'; + } } // Check location of records regarding tree root: if (!$GLOBALS['TCA'][$tableName]['ctrl']['rootLevel'] && $rootID==0) { $this->recStats['misplaced_at_rootlevel'][$tableName][$rowSub['uid']] = $rowSub['uid']; - if ($echoLevel>1) echo LF.' ERROR! Misplaced record ('.$tableName.':'.$rowSub['uid'].') on rootlevel!'; + if ($echoLevel > 1) { + echo LF.' ERROR! Misplaced record ('.$tableName.':'.$rowSub['uid'].') on rootlevel!'; + } } if ($GLOBALS['TCA'][$tableName]['ctrl']['rootLevel']==1 && $rootID>0) { $this->recStats['misplaced_inside_tree'][$tableName][$rowSub['uid']] = $rowSub['uid']; - if ($echoLevel>1) echo LF.' ERROR! Misplaced record ('.$tableName.':'.$rowSub['uid'].') inside page tree!'; + if ($echoLevel > 1) { + echo LF.' ERROR! Misplaced record ('.$tableName.':'.$rowSub['uid'].') inside page tree!'; + } } // Traverse plugins: @@ -482,7 +480,7 @@ class tx_lowlevel_cleaner_core extends t3lib_cli { if ($this->genTree_traverseVersions) { $versions = t3lib_BEfunc::selectVersionsOfRecord($tableName, $rowSub['uid'], 'uid,t3ver_wsid,t3ver_count'.($GLOBALS['TCA'][$tableName]['ctrl']['delete']?','.$GLOBALS['TCA'][$tableName]['ctrl']['delete']:''), 0, TRUE); if (is_array($versions)) { - foreach($versions as $verRec) { + foreach ($versions as $verRec) { if (!$verRec['_CURRENT_VERSION']) { if ($echoLevel==3) echo LF.' \-[#OFFLINE VERSION: WS#'.$verRec['t3ver_wsid'].'/Cnt:'.$verRec['t3ver_count'].'] '.$tableName.':'.$verRec['uid'].')'; $this->recStats['all'][$tableName][$verRec['uid']] = $verRec['uid']; @@ -490,25 +488,34 @@ class tx_lowlevel_cleaner_core extends t3lib_cli { // Register deleted: if ($GLOBALS['TCA'][$tableName]['ctrl']['delete'] && $verRec[$GLOBALS['TCA'][$tableName]['ctrl']['delete']]) { $this->recStats['deleted'][$tableName][$verRec['uid']] = $verRec['uid']; - if ($echoLevel==3) echo ' (DELETED)'; + if ($echoLevel == 3) { + echo ' (DELETED)'; + } } // Register version: $this->recStats['versions'][$tableName][$verRec['uid']] = $verRec['uid']; if ($verRec['t3ver_count']>=1 && $verRec['t3ver_wsid']==0) { // Only register published versions in LIVE workspace (published versions in draft workspaces are allowed) $this->recStats['versions_published'][$tableName][$verRec['uid']] = $verRec['uid']; - if ($echoLevel==3) echo ' (PUBLISHED)'; + if ($echoLevel == 3) { + echo ' (PUBLISHED)'; + } } - if ($verRec['t3ver_wsid']==0) { + if ($verRec['t3ver_wsid'] == 0) { $this->recStats['versions_liveWS'][$tableName][$verRec['uid']] = $verRec['uid']; } if (!isset($this->workspaceIndex[$verRec['t3ver_wsid']])) { $this->recStats['versions_lost_workspace'][$tableName][$verRec['uid']] = $verRec['uid']; - if ($echoLevel>1) echo LF.' ERROR! Version ('.$tableName.':'.$verRec['uid'].') belongs to non-existing workspace ('.$verRec['t3ver_wsid'].')!'; + if ($echoLevel > 1) { + echo LF.' ERROR! Version ('.$tableName.':'.$verRec['uid'].') belongs to non-existing workspace ('.$verRec['t3ver_wsid'].')!'; + } } - if ($versionSwapmode) { // In case we are inside a versioned branch, there should not exists versions inside that "branch". + // In case we are inside a versioned branch, there should not exists versions inside that "branch". + if ($versionSwapmode) { $this->recStats['versions_inside_versioned_page'][$tableName][$verRec['uid']] = $verRec['uid']; - if ($echoLevel>1) echo LF.' ERROR! This version ('.$tableName.':'.$verRec['uid'].') is inside an already versioned page or branch!'; + if ($echoLevel > 1) { + echo LF.' ERROR! This version ('.$tableName.':'.$verRec['uid'].') is inside an already versioned page or branch!'; + } } // Traverse plugins: @@ -550,10 +557,10 @@ class tx_lowlevel_cleaner_core extends t3lib_cli { } // Add any versions of pages - if ($rootID>0 && $this->genTree_traverseVersions) { + if ($rootID > 0 && $this->genTree_traverseVersions) { $versions = t3lib_BEfunc::selectVersionsOfRecord('pages', $rootID, 'uid,t3ver_oid,t3ver_wsid,t3ver_count,t3ver_swapmode', 0, TRUE); if (is_array($versions)) { - foreach($versions as $verRec) { + foreach ($versions as $verRec) { if (!$verRec['_CURRENT_VERSION']) { $this->genTree_traverse($verRec['uid'], $depth, $echoLevel, $callBack, 'SWAPMODE:'.t3lib_utility_Math::forceIntegerInRange($verRec['t3ver_swapmode'], -1, 1), $versionSwapmode?2:1, $accumulatedPath.' [#OFFLINE VERSION: WS#'.$verRec['t3ver_wsid'].'/Cnt:'.$verRec['t3ver_count'].']'); } @@ -563,13 +570,6 @@ class tx_lowlevel_cleaner_core extends t3lib_cli { } } - - - - - - - /************************** * * Helper functions @@ -579,8 +579,8 @@ class tx_lowlevel_cleaner_core extends t3lib_cli { /** * Compile info-string * - * @param array Input record from sys_refindex - * @return string String identifying the main record of the reference + * @param array $rec Input record from sys_refindex + * @return string String identifying the main record of the reference */ function infoStr($rec) { return $rec['tablename'].':'.$rec['recuid'].':'.$rec['field'].':'.$rec['flexpointer'].':'.$rec['softref_key'].($rec['deleted'] ? ' (DELETED)':''); diff --git a/typo3/sysext/lowlevel/clmods/class.cleanflexform.php b/typo3/sysext/lowlevel/clmods/class.cleanflexform.php index 8edd26561c26..c27a6b0c3527 100644 --- a/typo3/sysext/lowlevel/clmods/class.cleanflexform.php +++ b/typo3/sysext/lowlevel/clmods/class.cleanflexform.php @@ -28,14 +28,13 @@ * Cleaner module: cleanflexform * User function called from tx_lowlevel_cleaner_core configured in ext_localconf.php * - * @author Kasper Skårhøj <kasperYYYY@typo3.com> + * @author Kasper Skårhøj <kasperYYYY@typo3.com> */ - /** * cleanflexform * - * @author Kasper Skårhøj <kasperYYYY@typo3.com> + * @author Kasper Skårhøj <kasperYYYY@typo3.com> * @package TYPO3 * @subpackage tx_lowlevel */ @@ -43,8 +42,6 @@ class tx_lowlevel_cleanflexform extends tx_lowlevel_cleaner_core { /** * Constructor - * - * @return void */ function __construct() { parent::__construct(); @@ -69,7 +66,7 @@ Cleaning XML for FlexForm fields. * Find orphan records * VERY CPU and memory intensive since it will look up the whole page tree! * - * @return array + * @return array */ function main() { global $TYPO3_DB; @@ -87,7 +84,8 @@ Cleaning XML for FlexForm fields. $depth = $this->cli_isArg('--depth') ? t3lib_utility_Math::forceIntegerInRange($this->cli_argValue('--depth'), 0) : 1000; $this->cleanFlexForm_dirtyFields = &$resultArray['dirty']; - $this->genTree_traverseDeleted = FALSE; // Do not repair flexform data in deleted records. + // Do not repair flexform data in deleted records. + $this->genTree_traverseDeleted = FALSE; $this->genTree($startingPoint, $depth, (int)$this->cli_argValue('--echotree'), 'main_parseTreeCallBack'); @@ -98,19 +96,21 @@ Cleaning XML for FlexForm fields. /** * Call back function for page tree traversal! * - * @param string Table name - * @param integer UID of record in processing - * @param integer Echo level (see calling function - * @param string Version swap mode on that level (see calling function - * @param integer Is root version (see calling function - * @return void + * @param string $tableName Table name + * @param integer $uid UID of record in processing + * @param integer $echoLevel Echo level (see calling function + * @param string $versionSwapmode Version swap mode on that level (see calling function + * @param integer $rootIsVersion Is root version (see calling function + * @return void */ function main_parseTreeCallBack($tableName, $uid, $echoLevel, $versionSwapmode, $rootIsVersion) { t3lib_div::loadTCA($tableName); - foreach($GLOBALS['TCA'][$tableName]['columns'] as $colName => $config) { + foreach ($GLOBALS['TCA'][$tableName]['columns'] as $colName => $config) { if ($config['config']['type']=='flex') { - if ($echoLevel>2) echo LF.' [cleanflexform:] Field "'.$colName.'" in '.$tableName.':'.$uid.' was a flexform and...'; + if ($echoLevel > 2) { + echo LF.' [cleanflexform:] Field "'.$colName.'" in '.$tableName.':'.$uid.' was a flexform and...'; + } $recRow = t3lib_BEfunc::getRecordRaw($tableName, 'uid='.intval($uid)); $flexObj = t3lib_div::makeInstance('t3lib_flexformtools'); @@ -120,12 +120,18 @@ Cleaning XML for FlexForm fields. $newXML = $flexObj->cleanFlexFormXML($tableName, $colName, $recRow); if (md5($recRow[$colName])!=md5($newXML)) { - if ($echoLevel>2) echo ' was DIRTY, needs cleanup!'; + if ($echoLevel > 2) { + echo ' was DIRTY, needs cleanup!'; + } $this->cleanFlexForm_dirtyFields[t3lib_div::shortMd5($tableName.':'.$uid.':'.$colName)] = $tableName.':'.$uid.':'.$colName; } else { - if ($echoLevel>2) echo ' was CLEAN'; + if ($echoLevel > 2) { + echo ' was CLEAN'; + } } - } elseif ($echoLevel>2) echo ' was EMPTY'; + } elseif ($echoLevel > 2) { + echo ' was EMPTY'; + } } } } @@ -134,11 +140,11 @@ Cleaning XML for FlexForm fields. * Mandatory autofix function * Will run auto-fix on the result array. Echos status during processing. * - * @param array Result array from main() function - * @return void + * @param array $resultArray Result array from main() function + * @return void */ function main_autoFix($resultArray) { - foreach($resultArray['dirty'] as $fieldID) { + foreach ($resultArray['dirty'] as $fieldID) { list($table, $uid, $field) = explode(':', $fieldID); echo 'Cleaning XML in "'.$fieldID.'": '; if ($bypass = $this->cli_noExecutionCheck($fieldID)) { @@ -160,13 +166,16 @@ Cleaning XML for FlexForm fields. $tce->bypassWorkspaceRestrictions = TRUE; $tce->bypassFileHandling = TRUE; - $tce->start($data, array()); // check has been done previously that there is a backend user which is Admin and also in live workspace + // Check has been done previously that there is a backend user which is Admin and also in live workspace + $tce->start($data, array()); $tce->process_datamap(); // Return errors if any: if (count($tce->errorLog)) { echo ' ERROR from "TCEmain":'.LF.'TCEmain:'.implode(LF.'TCEmain:', $tce->errorLog); - } else echo 'DONE'; + } else { + echo 'DONE'; + } } echo LF; } diff --git a/typo3/sysext/lowlevel/clmods/class.deleted.php b/typo3/sysext/lowlevel/clmods/class.deleted.php index 0d244efe70b2..baf79ae9a2a9 100644 --- a/typo3/sysext/lowlevel/clmods/class.deleted.php +++ b/typo3/sysext/lowlevel/clmods/class.deleted.php @@ -28,14 +28,13 @@ * Cleaner module: Deleted records * User function called from tx_lowlevel_cleaner_core configured in ext_localconf.php * - * @author Kasper Skårhøj <kasperYYYY@typo3.com> + * @author Kasper Skårhøj <kasperYYYY@typo3.com> */ - /** * Looking for Deleted records * - * @author Kasper Skårhøj <kasperYYYY@typo3.com> + * @author Kasper Skårhøj <kasperYYYY@typo3.com> * @package TYPO3 * @subpackage tx_lowlevel */ @@ -43,8 +42,6 @@ class tx_lowlevel_deleted extends tx_lowlevel_cleaner_core { /** * Constructor - * - * @return [type] ... */ function __construct() { parent::__construct(); @@ -69,7 +66,7 @@ Although deleted records are not errors to be repaired, this tool allows you to * Find orphan records * VERY CPU and memory intensive since it will look up the whole page tree! * - * @return array + * @return array */ function main() { global $TYPO3_DB; @@ -96,8 +93,8 @@ Although deleted records are not errors to be repaired, this tool allows you to * Mandatory autofix function * Will run auto-fix on the result array. Echos status during processing. * - * @param array Result array from main() function - * @return void + * @param array $resultArray Result array from main() function + * @return void */ function main_autoFix($resultArray) { @@ -112,13 +109,14 @@ Although deleted records are not errors to be repaired, this tool allows you to if (isset($resultArray['deleted']['pages'])) { $_pages = $resultArray['deleted']['pages']; unset($resultArray['deleted']['pages']); - $resultArray['deleted']['pages'] = array_reverse($_pages); // To delete sub pages first assuming they are accumulated from top of page tree. + // To delete sub pages first assuming they are accumulated from top of page tree. + $resultArray['deleted']['pages'] = array_reverse($_pages); } // Traversing records: - foreach($resultArray['deleted'] as $table => $list) { + foreach ($resultArray['deleted'] as $table => $list) { echo 'Flushing deleted records from table "'.$table.'":'.LF; - foreach($list as $uid) { + foreach ($list as $uid) { echo ' Flushing record "'.$table.':'.$uid.'": '; if ($bypass = $this->cli_noExecutionCheck($table.':'.$uid)) { echo $bypass; @@ -128,7 +126,10 @@ Although deleted records are not errors to be repaired, this tool allows you to $tce = t3lib_div::makeInstance('t3lib_TCEmain'); $tce->stripslashes_values = FALSE; $tce->start(array(), array()); - $tce->deleteRecord($table, $uid, TRUE, TRUE); // Notice, we are deleting pages with no regard to subpages/subrecords - we do this since they should also be included in the set of deleted pages of course (no un-deleted record can exist under a deleted page...) + // Notice, we are deleting pages with no regard to subpages/subrecords - we do this since they + // should also be included in the set of deleted pages of course (no un-deleted record can exist + // under a deleted page...) + $tce->deleteRecord($table, $uid, TRUE, TRUE); // Return errors if any: if (count($tce->errorLog)) { diff --git a/typo3/sysext/lowlevel/clmods/class.double_files.php b/typo3/sysext/lowlevel/clmods/class.double_files.php index 7a73da2bc327..7b82345774d1 100644 --- a/typo3/sysext/lowlevel/clmods/class.double_files.php +++ b/typo3/sysext/lowlevel/clmods/class.double_files.php @@ -28,12 +28,12 @@ * Cleaner module: Double Files * User function called from tx_lowlevel_cleaner_core configured in ext_localconf.php * - * @author Kasper Skårhøj <kasperYYYY@typo3.com> + * @author Kasper Skårhøj <kasperYYYY@typo3.com> */ /** * Looking for double files * - * @author Kasper Skårhøj <kasperYYYY@typo3.com> + * @author Kasper Skårhøj <kasperYYYY@typo3.com> * @package TYPO3 * @subpackage tx_lowlevel */ @@ -43,8 +43,6 @@ class tx_lowlevel_double_files extends tx_lowlevel_cleaner_core { /** * Constructor - * - * @return void */ function __construct() { parent::__construct(); @@ -76,7 +74,7 @@ This will check the system for double files relations.'; * Find managed files which are referred to more than one time * Fix methods: API in t3lib_refindex that allows to change the value of a reference (we could copy the file) or remove reference * - * @return array + * @return array */ function main() { global $TYPO3_DB; @@ -113,7 +111,7 @@ This will check the system for double files relations.'; // Traverse the files and put into a large table: $tempCount = array(); if (is_array($recs)) { - foreach($recs as $rec) { + foreach ($recs as $rec) { // Compile info string for location of reference: $infoString = $this->infoStr($rec); @@ -150,7 +148,7 @@ This will check the system for double files relations.'; // Sort dirname registry and add warnings for directories outside uploads/ ksort($resultArray['dirname_registry']); - foreach($resultArray['dirname_registry'] as $dir => $temp) { + foreach ($resultArray['dirname_registry'] as $dir => $temp) { ksort($resultArray['dirname_registry'][$dir]); if (!t3lib_div::isFirstPartOfStr($dir, 'uploads/')) { $resultArray['warnings'][t3lib_div::shortmd5($dir)] = 'Directory "'.$dir.'" was outside uploads/ which is unusual practice in TYPO3 although not forbidden. Directory used by the following table:field pairs: '.implode(',', array_keys($temp)); @@ -164,17 +162,17 @@ This will check the system for double files relations.'; * Mandatory autofix function * Will run auto-fix on the result array. Echos status during processing. * - * @param array Result array from main() function - * @return void + * @param array $resultArray Result array from main() function + * @return void */ function main_autoFix($resultArray) { - foreach($resultArray['multipleReferencesList'] as $key => $value) { + foreach ($resultArray['multipleReferencesList'] as $key => $value) { $absFileName = t3lib_div::getFileAbsFileName($key); if ($absFileName && @is_file($absFileName)) { echo 'Processing file: '.$key.LF; - $c=0; + $c = 0; foreach($value as $hash => $recReference) { - if ($c==0) { + if ($c == 0) { echo ' Keeping '.$key.' for record "'.$recReference.'"'.LF; } else { // Create unique name for file: diff --git a/typo3/sysext/lowlevel/clmods/class.lost_files.php b/typo3/sysext/lowlevel/clmods/class.lost_files.php index 4e8a88e6512e..2687ff4e5cee 100644 --- a/typo3/sysext/lowlevel/clmods/class.lost_files.php +++ b/typo3/sysext/lowlevel/clmods/class.lost_files.php @@ -28,14 +28,13 @@ * Cleaner module: Lost files * User function called from tx_lowlevel_cleaner_core configured in ext_localconf.php * - * @author Kasper Skårhøj <kasperYYYY@typo3.com> + * @author Kasper Skårhøj <kasperYYYY@typo3.com> */ - /** * Looking for Lost files * - * @author Kasper Skårhøj <kasperYYYY@typo3.com> + * @author Kasper Skårhøj <kasperYYYY@typo3.com> * @package TYPO3 * @subpackage tx_lowlevel */ @@ -45,8 +44,6 @@ class tx_lowlevel_lost_files extends tx_lowlevel_cleaner_core { /** * Constructor - * - * @return void */ function __construct() { parent::__construct(); @@ -85,7 +82,7 @@ Will report lost files.'; * TODO: Add parameter to list more file names/patterns to ignore * TODO: Add parameter to include RTEmagic images * - * @return array + * @return array */ function main() { global $TYPO3_DB; @@ -115,10 +112,10 @@ Will report lost files.'; $excludePaths = t3lib_div::trimExplode(',', $this->cli_argValue('--excludePath', 0), 1); // Traverse files and for each, look up if its found in the reference index. - foreach($fileArr as $key => $value) { + foreach ($fileArr as $key => $value) { $include = TRUE; - foreach($excludePaths as $exclPath) { + foreach ($excludePaths as $exclPath) { if (t3lib_div::isFirstPartOfStr($value, $exclPath)) { $include = FALSE; } @@ -173,7 +170,6 @@ Will report lost files.'; // $fileArr variable should now be empty with all contents transferred to the result array keys. - return $resultArray; } @@ -181,8 +177,8 @@ Will report lost files.'; * Mandatory autofix function * Will run auto-fix on the result array. Echos status during processing. * - * @param array Result array from main() function - * @return void + * @param array $resultArray Result array from main() function + * @return void */ function main_autoFix($resultArray) { foreach($resultArray['lostFiles'] as $key => $value) { diff --git a/typo3/sysext/lowlevel/clmods/class.missing_files.php b/typo3/sysext/lowlevel/clmods/class.missing_files.php index c01264db94dc..5f52d0d35ed9 100644 --- a/typo3/sysext/lowlevel/clmods/class.missing_files.php +++ b/typo3/sysext/lowlevel/clmods/class.missing_files.php @@ -28,14 +28,13 @@ * Cleaner module: Missing files * User function called from tx_lowlevel_cleaner_core configured in ext_localconf.php * - * @author Kasper Skårhøj <kasperYYYY@typo3.com> + * @author Kasper Skårhøj <kasperYYYY@typo3.com> */ - /** * Looking for missing files. * - * @author Kasper Skårhøj <kasperYYYY@typo3.com> + * @author Kasper Skårhøj <kasperYYYY@typo3.com> * @package TYPO3 * @subpackage tx_lowlevel */ @@ -45,8 +44,6 @@ class tx_lowlevel_missing_files extends tx_lowlevel_cleaner_core { /** * Constructor - * - * @return void */ function __construct() { parent::__construct(); @@ -79,7 +76,7 @@ This will show you missing files in the TYPO3 system and only report back if err * Find file references that points to non-existing files in system * Fix methods: API in t3lib_refindex that allows to change the value of a reference (or remove it) * - * @return array + * @return array */ function main() { global $TYPO3_DB; @@ -108,7 +105,7 @@ This will show you missing files in the TYPO3 system and only report back if err // Traverse the files and put into a large table: if (is_array($recs)) { - foreach($recs as $rec) { + foreach ($recs as $rec) { // Compile info string for location of reference: $infoString = $this->infoStr($rec); @@ -138,14 +135,14 @@ This will show you missing files in the TYPO3 system and only report back if err * Mandatory autofix function * Will run auto-fix on the result array. Echos status during processing. * - * @param array Result array from main() function - * @return void + * @param array $resultArray Result array from main() function + * @return void */ function main_autoFix($resultArray) { - foreach($resultArray['managedFilesMissing'] as $key => $value) { + foreach ($resultArray['managedFilesMissing'] as $key => $value) { echo 'Processing file: '.$key.LF; - $c=0; - foreach($value as $hash => $recReference) { + $c = 0; + foreach ($value as $hash => $recReference) { echo ' Removing reference in record "'.$recReference.'": '; if ($bypass = $this->cli_noExecutionCheck($recReference)) { echo $bypass; diff --git a/typo3/sysext/lowlevel/clmods/class.missing_relations.php b/typo3/sysext/lowlevel/clmods/class.missing_relations.php index dafd70ce40f6..7dfe24f3c65e 100644 --- a/typo3/sysext/lowlevel/clmods/class.missing_relations.php +++ b/typo3/sysext/lowlevel/clmods/class.missing_relations.php @@ -28,14 +28,13 @@ * Cleaner module: Missing relations * User function called from tx_lowlevel_cleaner_core configured in ext_localconf.php * - * @author Kasper Skårhøj <kasperYYYY@typo3.com> + * @author Kasper Skårhøj <kasperYYYY@typo3.com> */ - /** * Looking for missing relations. * - * @author Kasper Skårhøj <kasperYYYY@typo3.com> + * @author Kasper Skårhøj <kasperYYYY@typo3.com> * @package TYPO3 * @subpackage tx_lowlevel */ @@ -45,8 +44,6 @@ class tx_lowlevel_missing_relations extends tx_lowlevel_cleaner_core { /** * Constructor - * - * @return void */ function __construct() { parent::__construct(); @@ -81,7 +78,7 @@ Reports missing relations'; * Find relations pointing to non-existing records * Fix methods: API in t3lib_refindex that allows to change the value of a reference (or remove it) [Only for managed relations!] * - * @return array + * @return array */ function main() { global $TYPO3_DB; @@ -120,7 +117,7 @@ Reports missing relations'; // Traverse the records $tempExists = array(); if (is_array($recs)) { - foreach($recs as $rec) { + foreach ($recs as $rec) { $suffix = $rec['softref_key']!='' ? '_s' : '_m'; $idx = $rec['ref_table'].':'.$rec['ref_uid']; @@ -134,7 +131,7 @@ Reports missing relations'; // Handle missing file: if ($tempExists[$idx]['uid']) { - if ($tempExists[$idx]['pid']==-1) { + if ($tempExists[$idx]['pid'] == -1) { $resultArray['offlineVersionRecords'.$suffix][$idx][$rec['hash']] = $infoString; ksort($resultArray['offlineVersionRecords'.$suffix][$idx]); } elseif ($GLOBALS['TCA'][$rec['ref_table']]['ctrl']['delete'] && $tempExists[$idx][$GLOBALS['TCA'][$rec['ref_table']]['ctrl']['delete']]) { @@ -162,16 +159,16 @@ Reports missing relations'; * Mandatory autofix function * Will run auto-fix on the result array. Echos status during processing. * - * @param array Result array from main() function - * @return void + * @param array $resultArray Result array from main() function + * @return void */ function main_autoFix($resultArray) { $trav = array('offlineVersionRecords_m', 'nonExistingRecords_m'); - foreach($trav as $tk) { + foreach ($trav as $tk) { echo 'Processing managed "'.$tk.'"...'.LF; - foreach($resultArray[$tk] as $key => $value) { - foreach($value as $hash => $recReference) { + foreach ($resultArray[$tk] as $key => $value) { + foreach ($value as $hash => $recReference) { echo ' Removing reference to '.$key.' in record "'.$recReference.'": '; if ($bypass = $this->cli_noExecutionCheck($recReference)) { echo $bypass; diff --git a/typo3/sysext/lowlevel/clmods/class.orphan_records.php b/typo3/sysext/lowlevel/clmods/class.orphan_records.php index 5806a935b4fe..a0624d9b74fb 100644 --- a/typo3/sysext/lowlevel/clmods/class.orphan_records.php +++ b/typo3/sysext/lowlevel/clmods/class.orphan_records.php @@ -28,14 +28,13 @@ * Cleaner module: Orphan records * User function called from tx_lowlevel_cleaner_core configured in ext_localconf.php * - * @author Kasper Skårhøj <kasperYYYY@typo3.com> + * @author Kasper Skårhøj <kasperYYYY@typo3.com> */ - /** * Looking for Orphan Records * - * @author Kasper Skårhøj <kasperYYYY@typo3.com> + * @author Kasper Skårhøj <kasperYYYY@typo3.com> * @package TYPO3 * @subpackage tx_lowlevel */ @@ -43,8 +42,6 @@ class tx_lowlevel_orphan_records extends tx_lowlevel_cleaner_core { /** * Constructor - * - * @return [type] ... */ function __construct() { parent::__construct(); @@ -77,7 +74,7 @@ Will report orphan uids from TCA tables.'; * Find orphan records * VERY CPU and memory intensive since it will look up the whole page tree! * - * @return array + * @return array */ function main() { global $TYPO3_DB; @@ -97,7 +94,8 @@ Will report orphan uids from TCA tables.'; 'illegal_record_under_versioned_page' => array(), ); - $startingPoint = 0; // zero = tree root, must use tree root if you wish to reverse selection to find orphans! + // zero = tree root, must use tree root if you wish to reverse selection to find orphans! + $startingPoint = 0; $pt = t3lib_div::milliseconds(); $this->genTree($startingPoint, 1000, (int)$this->cli_argValue('--echotree')); @@ -107,7 +105,7 @@ Will report orphan uids from TCA tables.'; $resultArray['illegal_record_under_versioned_page'] = $this->recStats['illegal_record_under_versioned_page']; // Find orphans: - foreach($GLOBALS['TCA'] as $tableName => $cfg) { + foreach ($GLOBALS['TCA'] as $tableName => $cfg) { $idList = is_array($this->recStats['all'][$tableName]) && count($this->recStats['all'][$tableName]) ? implode(',', $this->recStats['all'][$tableName]) : 0; @@ -124,7 +122,7 @@ Will report orphan uids from TCA tables.'; if (count($orphanRecords)) { $resultArray['orphans'][$tableName] = array(); - foreach($orphanRecords as $oR) { + foreach ($orphanRecords as $oR) { $resultArray['orphans'][$tableName][$oR['uid']] = $oR['uid']; } } @@ -137,8 +135,8 @@ Will report orphan uids from TCA tables.'; * Mandatory autofix function * Will run auto-fix on the result array. Echos status during processing. * - * @param array Result array from main() function - * @return void + * @param array $resultArray Result array from main() function + * @return void */ function main_autoFix($resultArray) { @@ -150,9 +148,9 @@ Will report orphan uids from TCA tables.'; } // Traversing records: - foreach($resultArray['orphans'] as $table => $list) { + foreach ($resultArray['orphans'] as $table => $list) { echo 'Removing orphans from table "'.$table.'":'.LF; - foreach($list as $uid) { + foreach ($list as $uid) { echo ' Flushing orphan record "'.$table.':'.$uid.'": '; if ($bypass = $this->cli_noExecutionCheck($table.':'.$uid)) { echo $bypass; @@ -162,7 +160,9 @@ Will report orphan uids from TCA tables.'; $tce = t3lib_div::makeInstance('t3lib_TCEmain'); $tce->stripslashes_values = FALSE; $tce->start(array(), array()); - $tce->deleteRecord($table, $uid, TRUE, TRUE); // Notice, we are deleting pages with no regard to subpages/subrecords - we do this since they should also be included in the set of orphans of course! + // Notice, we are deleting pages with no regard to subpages/subrecords - we do this + // since they should also be included in the set of orphans of course! + $tce->deleteRecord($table, $uid, TRUE, TRUE); // Return errors if any: if (count($tce->errorLog)) { diff --git a/typo3/sysext/lowlevel/clmods/class.rte_images.php b/typo3/sysext/lowlevel/clmods/class.rte_images.php index 33312c1c9439..80e482ae2ac6 100644 --- a/typo3/sysext/lowlevel/clmods/class.rte_images.php +++ b/typo3/sysext/lowlevel/clmods/class.rte_images.php @@ -28,12 +28,13 @@ * Cleaner module: RTE magicc images * User function called from tx_lowlevel_cleaner_core configured in ext_localconf.php * - * @author Kasper Skårhøj <kasperYYYY@typo3.com> + * @author Kasper Skårhøj <kasperYYYY@typo3.com> */ + /** * Looking for RTE images integrity * - * @author Kasper Skårhøj <kasperYYYY@typo3.com> + * @author Kasper Skårhøj <kasperYYYY@typo3.com> * @package TYPO3 * @subpackage tx_lowlevel */ @@ -43,8 +44,6 @@ class tx_lowlevel_rte_images extends tx_lowlevel_cleaner_core { /** * Constructor - * - * @return void */ function __construct() { parent::__construct(); @@ -77,7 +76,7 @@ Reports problems with RTE images'; * Analyse situation with RTE magic images. (still to define what the most useful output is). * Fix methods: API in t3lib_refindex that allows to change the value of a reference (we could copy the files) or remove reference * - * @return array + * @return array */ function main() { global $TYPO3_DB; @@ -112,7 +111,7 @@ Reports problems with RTE images'; // Traverse the files and put into a large table: if (is_array($recs)) { - foreach($recs as $rec) { + foreach ($recs as $rec) { $filename = basename($rec['ref_string']); if (t3lib_div::isFirstPartOfStr($filename, 'RTEmagicC_')) { $original = 'RTEmagicP_'.preg_replace('/\.[[:alnum:]]+$/', '', substr($filename, 10)); @@ -139,8 +138,8 @@ Reports problems with RTE images'; } // Searching for duplicates: - foreach($resultArray['RTEmagicFilePairs'] as $fileName => $fileInfo) { - if ($fileInfo['count']>1 && $fileInfo['exists'] && $fileInfo['original_exists']) { + foreach ($resultArray['RTEmagicFilePairs'] as $fileName => $fileInfo) { + if ($fileInfo['count']>1 && $fileInfo['exists'] && $fileInfo['original_exists']) { $resultArray['doubleFiles'][$fileName] = $fileInfo['usedIn']; } } @@ -151,7 +150,7 @@ Reports problems with RTE images'; $cleanerMode = t3lib_div::getUserObj($cleanerModules['lost_files'][0]); $resLostFiles = $cleanerMode->main(array(), FALSE, TRUE); if (is_array($resLostFiles['RTEmagicFiles'])) { - foreach($resLostFiles['RTEmagicFiles'] as $fileName) { + foreach ($resLostFiles['RTEmagicFiles'] as $fileName) { if (!isset($resultArray['completeFileList'][$fileName])) { $resultArray['lostFiles'][$fileName] = $fileName; } @@ -172,8 +171,8 @@ Reports problems with RTE images'; * Mandatory autofix function * Will run auto-fix on the result array. Echos status during processing. * - * @param array Result array from main() function - * @return void + * @param array $resultArray Result array from main() function + * @return void */ function main_autoFix($resultArray) { @@ -183,15 +182,15 @@ Reports problems with RTE images'; if (!$limitTo || $limitTo==='doubleFiles') { echo 'FIXING double-usages of RTE files in uploads/: '.LF; - foreach($resultArray['RTEmagicFilePairs'] as $fileName => $fileInfo) { + foreach ($resultArray['RTEmagicFilePairs'] as $fileName => $fileInfo) { // Only fix something if there is a usage count of more than 1 plus if both original and copy exists: if ($fileInfo['count']>1 && $fileInfo['exists'] && $fileInfo['original_exists']) { // Traverse all records using the file: - $c=0; - foreach($fileInfo['usedIn'] as $hash => $recordID) { - if ($c==0) { + $c = 0; + foreach ($fileInfo['usedIn'] as $hash => $recordID) { + if ($c == 0) { echo ' Keeping file '.$fileName.' for record '.$recordID.LF; } else { // CODE below is adapted from "class.tx_impexp.php" where there is support for duplication of RTE images: @@ -248,10 +247,10 @@ Reports problems with RTE images'; if (is_array($resultArray['lostFiles'])) { - if ($limitTo==='lostFiles') { + if ($limitTo === 'lostFiles') { echo 'Removing lost RTEmagic files from folders inside uploads/: '.LF; - foreach($resultArray['lostFiles'] as $key => $value) { + foreach ($resultArray['lostFiles'] as $key => $value) { $absFileName = t3lib_div::getFileAbsFileName($value); echo 'Deleting file: "'.$absFileName.'": '; if ($bypass = $this->cli_noExecutionCheck($absFileName)) { @@ -273,7 +272,7 @@ Reports problems with RTE images'; /** * Returns file processing object, initialized only once. * - * @return object File processor object + * @return object File processor object */ function getFileProcObj() { if (!is_object($this->fileProcObj)) { diff --git a/typo3/sysext/lowlevel/clmods/class.syslog.php b/typo3/sysext/lowlevel/clmods/class.syslog.php index 33baccabdf39..a5a82337ab7d 100644 --- a/typo3/sysext/lowlevel/clmods/class.syslog.php +++ b/typo3/sysext/lowlevel/clmods/class.syslog.php @@ -28,14 +28,13 @@ * Cleaner module: syslog * User function called from tx_lowlevel_cleaner_core configured in ext_localconf.php * - * @author Kasper Skårhøj <kasperYYYY@typo3.com> + * @author Kasper Skårhøj <kasperYYYY@typo3.com> */ - /** * syslog * - * @author Kasper Skårhøj <kasperYYYY@typo3.com> + * @author Kasper Skårhøj <kasperYYYY@typo3.com> * @package TYPO3 * @subpackage tx_lowlevel */ @@ -43,8 +42,6 @@ class tx_lowlevel_syslog extends tx_lowlevel_cleaner_core { /** * Constructor - * - * @return void */ function __construct() { parent::__construct(); @@ -60,7 +57,7 @@ Showing last 25 hour entries from the syslog. More features pending. This is the /** * Find syslog * - * @return array + * @return array */ function main() { global $TYPO3_DB; @@ -81,7 +78,7 @@ Showing last 25 hour entries from the syslog. More features pending. This is the 'sys_log', 'tstamp>' . ($GLOBALS['EXEC_TIME'] - 25 * 3600) ); - foreach($rows as $r) { + foreach ($rows as $r) { $l = unserialize($r['log_data']); $explained = '#'.$r['uid'].' '.t3lib_BEfunc::datetime($r['tstamp']).' USER['.$r['userid'].']: '.sprintf($r['details'], $l[0], $l[1], $l[2], $l[3], $l[4], $l[5]); $resultArray['listing'][$r['uid']] = $explained; @@ -95,8 +92,8 @@ Showing last 25 hour entries from the syslog. More features pending. This is the * Mandatory autofix function * Will run auto-fix on the result array. Echos status during processing. * - * @param array Result array from main() function - * @return void + * @param array Result array from main() function + * @return void */ function main_autoFix($resultArray) { } diff --git a/typo3/sysext/lowlevel/clmods/class.versions.php b/typo3/sysext/lowlevel/clmods/class.versions.php index 5b8c827712f8..fa0916006f8d 100644 --- a/typo3/sysext/lowlevel/clmods/class.versions.php +++ b/typo3/sysext/lowlevel/clmods/class.versions.php @@ -28,14 +28,13 @@ * Cleaner module: Versions of records * User function called from tx_lowlevel_cleaner_core configured in ext_localconf.php * - * @author Kasper Skårhøj <kasperYYYY@typo3.com> + * @author Kasper Skårhøj <kasperYYYY@typo3.com> */ - /** * Looking for versions of records * - * @author Kasper Skårhøj <kasperYYYY@typo3.com> + * @author Kasper Skårhøj <kasperYYYY@typo3.com> * @package TYPO3 * @subpackage tx_lowlevel */ @@ -43,8 +42,6 @@ class tx_lowlevel_versions extends tx_lowlevel_cleaner_core { /** * Constructor - * - * @return void */ function __construct() { parent::__construct(); @@ -74,7 +71,7 @@ Automatic Repair: * Find orphan records * VERY CPU and memory intensive since it will look up the whole page tree! * - * @return array + * @return array */ function main() { global $TYPO3_DB; @@ -108,10 +105,10 @@ Automatic Repair: // Finding all placeholders with no records attached! $resultArray['versions_unused_placeholders'] = array(); - foreach($GLOBALS['TCA'] as $table => $cfg) { + foreach ($GLOBALS['TCA'] as $table => $cfg) { if ($cfg['ctrl']['versioningWS']) { $placeHolders = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('uid,pid', $table, 't3ver_state=1 AND pid>=0'.t3lib_BEfunc::deleteClause($table)); - foreach($placeHolders as $phrec) { + foreach ($placeHolders as $phrec) { if (count(t3lib_BEfunc::selectVersionsOfRecord($table, $phrec['uid'], 'uid'))<=1) { $resultArray['versions_unused_placeholders'][t3lib_div::shortmd5($table.':'.$phrec['uid'])] = $table.':'.$phrec['uid']; } @@ -123,12 +120,12 @@ Automatic Repair: // Finding all move placeholders with inconsistencies: $resultArray['versions_move_placeholders_ok'] = array(); $resultArray['versions_move_placeholders_bad'] = array(); - foreach($GLOBALS['TCA'] as $table => $cfg) { - if ((int)$cfg['ctrl']['versioningWS']>=2) { + foreach ($GLOBALS['TCA'] as $table => $cfg) { + if ((int)$cfg['ctrl']['versioningWS'] >= 2) { $placeHolders = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('uid,pid,t3ver_move_id,t3ver_wsid,t3ver_state', $table, 't3ver_state=3 AND pid>=0'.t3lib_BEfunc::deleteClause($table)); - foreach($placeHolders as $phrec) { + foreach ($placeHolders as $phrec) { $shortID = t3lib_div::shortmd5($table.':'.$phrec['uid']); - if ((int)$phrec['t3ver_wsid']!=0) { + if ((int)$phrec['t3ver_wsid'] != 0) { $phrecCopy = $phrec; if (t3lib_BEfunc::movePlhOL($table, $phrec)) { if ($wsAlt = t3lib_BEfunc::getWorkspaceVersionOfRecord($phrecCopy['t3ver_wsid'], $table, $phrec['uid'], 'uid,pid,t3ver_state')) { @@ -160,12 +157,12 @@ Automatic Repair: // Finding move_id_check inconsistencies: $resultArray['versions_move_id_check'] = array(); - foreach($GLOBALS['TCA'] as $table => $cfg) { - if ((int)$cfg['ctrl']['versioningWS']>=2) { + foreach ($GLOBALS['TCA'] as $table => $cfg) { + if ((int)$cfg['ctrl']['versioningWS'] >= 2) { $placeHolders = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('uid,pid,t3ver_move_id,t3ver_wsid,t3ver_state', $table, 't3ver_move_id<>0'.t3lib_BEfunc::deleteClause($table)); - foreach($placeHolders as $phrec) { - if ((int)$phrec['t3ver_state']==3) { - if ($phrec['pid']!=-1) { + foreach ($placeHolders as $phrec) { + if ((int)$phrec['t3ver_state'] == 3) { + if ($phrec['pid'] != -1) { // OK } else { $resultArray['versions_move_id_check'][] = array($table.':'.$phrec['uid'], 'Record was offline, must not be!', $phrec); @@ -184,8 +181,8 @@ Automatic Repair: * Mandatory autofix function * Will run auto-fix on the result array. Echos status during processing. * - * @param array Result array from main() function - * @return void + * @param array $resultArray Result array from main() function + * @return void */ function main_autoFix($resultArray) { @@ -199,9 +196,9 @@ Automatic Repair: } // Traversing records: - foreach($resultArray[$kk] as $table => $list) { + foreach ($resultArray[$kk] as $table => $list) { echo 'Flushing published records from table "'.$table.'":'.LF; - foreach($list as $uid) { + foreach ($list as $uid) { echo ' Flushing record "'.$table.':'.$uid.'": '; if ($bypass = $this->cli_noExecutionCheck($table.':'.$uid)) { @@ -224,9 +221,9 @@ Automatic Repair: } // Traverse workspace: - foreach($resultArray['versions_lost_workspace'] as $table => $list) { + foreach ($resultArray['versions_lost_workspace'] as $table => $list) { echo 'Resetting workspace to zero for records from table "'.$table.'":'.LF; - foreach($list as $uid) { + foreach ($list as $uid) { echo ' Flushing record "'.$table.':'.$uid.'": '; if ($bypass = $this->cli_noExecutionCheck($table.':'.$uid)) { echo $bypass; @@ -242,7 +239,7 @@ Automatic Repair: } // Delete unused placeholders - foreach($resultArray['versions_unused_placeholders'] as $recID) { + foreach ($resultArray['versions_unused_placeholders'] as $recID) { list($table,$uid) = explode(':', $recID); echo 'Deleting unused placeholder (soft) "'.$table.':'.$uid.'": '; if ($bypass = $this->cli_noExecutionCheck($table.':'.$uid)) { diff --git a/typo3/sysext/lowlevel/config/conf.php b/typo3/sysext/lowlevel/config/conf.php index 3677bf9d5ccb..67132dd75181 100755 --- a/typo3/sysext/lowlevel/config/conf.php +++ b/typo3/sysext/lowlevel/config/conf.php @@ -1,9 +1,9 @@ <?php $MLANG['default']['tabs_images']['tab'] = 'config.gif'; -$MLANG['default']['ll_ref']='LLL:EXT:lowlevel/config/locallang_mod.xml'; +$MLANG['default']['ll_ref'] = 'LLL:EXT:lowlevel/config/locallang_mod.xml'; -$MCONF['script']='_DISPATCH'; -$MCONF['access']='admin'; -$MCONF['name']='tools_config'; -$MCONF['workspaces']='online'; +$MCONF['script'] = '_DISPATCH'; +$MCONF['access'] = 'admin'; +$MCONF['name'] = 'tools_config'; +$MCONF['workspaces'] = 'online'; ?> \ No newline at end of file diff --git a/typo3/sysext/lowlevel/config/index.php b/typo3/sysext/lowlevel/config/index.php index b6748408b01b..d3c09f3d731b 100755 --- a/typo3/sysext/lowlevel/config/index.php +++ b/typo3/sysext/lowlevel/config/index.php @@ -29,7 +29,7 @@ * * This module lets you view the config variables around TYPO3. * - * @author Kasper Skårhøj <kasperYYYY@typo3.com> + * @author Kasper Skårhøj <kasperYYYY@typo3.com> */ $GLOBALS['LANG']->includeLLFile('EXT:lowlevel/config/locallang.xml'); @@ -39,7 +39,7 @@ $BE_USER->modAccess($MCONF, 1); /** * Script class for the Config module * - * @author Kasper Skårhøj <kasperYYYY@typo3.com> + * @author Kasper Skårhøj <kasperYYYY@typo3.com> * @package TYPO3 * @subpackage tx_lowlevel */ @@ -50,7 +50,7 @@ class SC_mod_tools_config_index { var $MOD_SETTINGS = array(); /** - * document template object + * Document template object * * @var noDoc */ @@ -59,12 +59,10 @@ class SC_mod_tools_config_index { var $include_once = array(); var $content; - - /** * Initialization * - * @return void + * @return void */ function init() { global $BACK_PATH; @@ -93,7 +91,7 @@ class SC_mod_tools_config_index { /** * Menu Configuration * - * @return void + * @return void */ function menuConfig() { global $TYPO3_CONF_VARS; @@ -126,7 +124,7 @@ class SC_mod_tools_config_index { /** * [Describe function...] * - * @return [type] ... + * @return void */ function main() { @@ -141,13 +139,13 @@ class SC_mod_tools_config_index { $this->content .= t3lib_BEfunc::getFuncCheck(0, 'SET[regexsearch]', $this->MOD_SETTINGS['regexsearch'], '', '', 'id="checkRegexsearch"') . '<label for="checkRegexsearch">' . $GLOBALS['LANG']->getLL('useRegExp', TRUE) . '</label>'; - $this->content.= t3lib_BEfunc::getFuncCheck(0, 'SET[fixedLgd]', $this->MOD_SETTINGS['fixedLgd'], '', '', 'id="checkFixedLgd"') . + $this->content .= t3lib_BEfunc::getFuncCheck(0, 'SET[fixedLgd]', $this->MOD_SETTINGS['fixedLgd'], '', '', 'id="checkFixedLgd"') . '<label for="checkFixedLgd">' . $GLOBALS['LANG']->getLL('cropLines', TRUE) . '</label> </div>'; - $this->content.= $this->doc->spacer(5); + $this->content .= $this->doc->spacer(5); - switch($this->MOD_SETTINGS['function']) { + switch ($this->MOD_SETTINGS['function']) { case 0: $theVar = $GLOBALS['TYPO3_CONF_VARS']; t3lib_div::naturalKeySortRecursive($theVar); @@ -210,7 +208,8 @@ class SC_mod_tools_config_index { // Update node: $update = 0; $node = t3lib_div::_GET('node'); - if (is_array($node)) { // If any plus-signs were clicked, it's registred. + // If any plus-signs were clicked, it's registred. + if (is_array($node)) { $this->MOD_SETTINGS['node_'.$this->MOD_SETTINGS['function']] = $arrayBrowser->depthKeys($node, $this->MOD_SETTINGS['node_'.$this->MOD_SETTINGS['function']]); $update = 1; } @@ -225,7 +224,8 @@ class SC_mod_tools_config_index { $search_field = t3lib_div::_GP('search_field'); - if (t3lib_div::_POST('search') && trim($search_field)) { // If any POST-vars are send, update the condition array + // If any POST-vars are send, update the condition array + if (t3lib_div::_POST('search') && trim($search_field)) { $arrayBrowser->depthKeys=$arrayBrowser->getSearchKeys($theVar, '', $search_field, array()); } @@ -237,7 +237,8 @@ class SC_mod_tools_config_index { // Variable name: if (t3lib_div::_GP('varname')) { $line = t3lib_div::_GP('_') ? t3lib_div::_GP('_') : t3lib_div::_GP('varname'); - if (t3lib_div::_GP('writetoexttables')) { // Write the line to extTables.php + // Write the line to extTables.php + if (t3lib_div::_GP('writetoexttables')) { // change value to $GLOBALS $length = strpos($line, '['); $var = substr($line, 0, $length); @@ -294,8 +295,8 @@ class SC_mod_tools_config_index { } - $this->content.= '<br /><table border="0" cellpadding="0" cellspacing="0" class="t3-tree t3-tree-config">'; - $this->content.= '<tr> + $this->content .= '<br /><table border="0" cellpadding="0" cellspacing="0" class="t3-tree t3-tree-config">'; + $this->content .= '<tr> <th class="t3-row-header t3-tree-config-header">' . $label . '</th> </tr> <tr> @@ -325,7 +326,7 @@ class SC_mod_tools_config_index { /** * Print output to browser * - * @return void + * @return void */ function printContent() { echo $this->content; @@ -334,7 +335,7 @@ class SC_mod_tools_config_index { /** * Create the panel of buttons for submitting the form or otherwise perform operations. * - * @return array all available buttons as an assoc. array + * @return array All available buttons as an assoc. array */ protected function getButtons() { @@ -353,7 +354,7 @@ class SC_mod_tools_config_index { /** * Create the function menu * - * @return string HTML of the function menu + * @return string HTML of the function menu */ protected function getFuncMenu() { $funcMenu = t3lib_BEfunc::getFuncMenu(0, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function']); @@ -361,9 +362,9 @@ class SC_mod_tools_config_index { } } -// Make instance: + // Make instance: $SOBE = t3lib_div::makeInstance('SC_mod_tools_config_index'); $SOBE->init(); $SOBE->main(); $SOBE->printContent(); -?> +?> \ No newline at end of file diff --git a/typo3/sysext/lowlevel/dbint/cli/cleaner_cli.php b/typo3/sysext/lowlevel/dbint/cli/cleaner_cli.php index 7c6daf88b1f1..95de30c29216 100755 --- a/typo3/sysext/lowlevel/dbint/cli/cleaner_cli.php +++ b/typo3/sysext/lowlevel/dbint/cli/cleaner_cli.php @@ -1,8 +1,10 @@ <?php -if (!defined('TYPO3_cliMode')) die('You cannot run this script directly!'); +if (!defined('TYPO3_cliMode')) { + die('You cannot run this script directly!'); +} -require_once(t3lib_extMgm::extPath('lowlevel').'class.tx_lowlevel_cleaner_core.php'); +require_once(t3lib_extMgm::extPath('lowlevel') . 'class.tx_lowlevel_cleaner_core.php'); // Call the functionality $cleanerObj = t3lib_div::makeInstance('tx_lowlevel_cleaner_core'); diff --git a/typo3/sysext/lowlevel/dbint/cli/refindex_cli.php b/typo3/sysext/lowlevel/dbint/cli/refindex_cli.php index 152717cdae92..6ace503db7ed 100755 --- a/typo3/sysext/lowlevel/dbint/cli/refindex_cli.php +++ b/typo3/sysext/lowlevel/dbint/cli/refindex_cli.php @@ -1,6 +1,8 @@ <?php -if (!defined('TYPO3_cliMode')) die('You cannot run this script directly!'); +if (!defined('TYPO3_cliMode')) { + die('You cannot run this script directly!'); +} // Call the functionality if (in_array('-e', $_SERVER["argv"]) || in_array('-c', $_SERVER["argv"])) { diff --git a/typo3/sysext/lowlevel/dbint/conf.php b/typo3/sysext/lowlevel/dbint/conf.php index e3fba66f87d5..ca6ac01418fe 100755 --- a/typo3/sysext/lowlevel/dbint/conf.php +++ b/typo3/sysext/lowlevel/dbint/conf.php @@ -1,10 +1,10 @@ <?php $MLANG['default']['tabs_images']['tab'] = 'db.gif'; -$MLANG['default']['ll_ref']='LLL:EXT:lowlevel/dbint/locallang_mod.xml'; +$MLANG['default']['ll_ref'] = 'LLL:EXT:lowlevel/dbint/locallang_mod.xml'; -$MCONF['script']='_DISPATCH'; -$MCONF['access']='admin'; -$MCONF['name']='tools_dbint'; -$MCONF['workspaces']='online'; +$MCONF['script'] = '_DISPATCH'; +$MCONF['access'] = 'admin'; +$MCONF['name'] = 'tools_dbint'; +$MCONF['workspaces'] = 'online'; ?> \ No newline at end of file diff --git a/typo3/sysext/lowlevel/dbint/index.php b/typo3/sysext/lowlevel/dbint/index.php index 68b19d443c0d..bde0b0f6b266 100755 --- a/typo3/sysext/lowlevel/dbint/index.php +++ b/typo3/sysext/lowlevel/dbint/index.php @@ -29,18 +29,17 @@ * * This module lets you check if all pages and the records relate properly to each other * - * @author Kasper Skårhøj <kasperYYYY@typo3.com> - * @coauthor Jo Hasenau <info@cybercraft.de> + * @author Kasper Skårhøj <kasperYYYY@typo3.com> + * @coauthor Jo Hasenau <info@cybercraft.de> */ - $GLOBALS['LANG']->includeLLFile('EXT:lowlevel/dbint/locallang.xml'); $BE_USER->modAccess($MCONF, 1); /** * Script class for the DB int module * - * @author Kasper Skårhøj <kasperYYYY@typo3.com> + * @author Kasper Skårhøj <kasperYYYY@typo3.com> * @package TYPO3 * @subpackage tx_lowlevel */ @@ -51,7 +50,7 @@ class SC_mod_tools_dbint_index { var $MOD_SETTINGS = array(); /** - * document template object + * Document template object * * @var mediumDoc */ @@ -66,7 +65,7 @@ class SC_mod_tools_dbint_index { /** * Initialization * - * @return void + * @return void */ function init() { global $LANG,$BACK_PATH; @@ -106,7 +105,7 @@ class SC_mod_tools_dbint_index { /** * Configure menu * - * @return void + * @return void */ function menuConfig() { global $LANG; @@ -174,7 +173,7 @@ class SC_mod_tools_dbint_index { $this->MOD_SETTINGS['queryConfig'] = ''; } } - if ($key=='queryTable' && $this->MOD_SETTINGS[$key]!=$val) { + if ($key == 'queryTable' && $this->MOD_SETTINGS[$key]!=$val) { $this->MOD_SETTINGS['queryFields'] = ''; } } @@ -192,7 +191,7 @@ class SC_mod_tools_dbint_index { /** * Main * - * @return void + * @return void */ function main() { @@ -242,7 +241,7 @@ class SC_mod_tools_dbint_index { /** * Print content * - * @return void + * @return void */ function printContent() { echo $this->content; @@ -251,7 +250,7 @@ class SC_mod_tools_dbint_index { /** * Create the panel of buttons for submitting the form or otherwise perform operations. * - * @return array all available buttons as an assoc. array + * @return array All available buttons as an assoc. array */ protected function getButtons() { @@ -270,7 +269,7 @@ class SC_mod_tools_dbint_index { /** * Create the function menu * - * @return string HTML of the function menu + * @return string HTML of the function menu */ protected function getFuncMenu() { if (!$GLOBALS['BE_USER']->userTS['mod.']['dbint.']['disableTopMenu']) { @@ -281,12 +280,12 @@ class SC_mod_tools_dbint_index { /** * Creates the overview menu. - * + * @return void */ protected function func_default() { $availableModFuncs = array('records', 'relations', 'search', 'filesearch', 'refindex'); - $content = '<dl class="t3-overview-list">'; + $content = '<dl class="t3-overview-list">'; foreach ($availableModFuncs as $modFunc) { $functionUrl = t3lib_BEfunc::getModuleUrl('tools_dbint') . '&SET[function]=' . $modFunc; @@ -310,13 +309,6 @@ class SC_mod_tools_dbint_index { $this->content .= $this->doc->section('', $content, FALSE, TRUE); } - - - - - - - /**************************** * * Functionality implementation @@ -326,7 +318,7 @@ class SC_mod_tools_dbint_index { /** * Check and update reference index! * - * @return void + * @return void */ function func_refindex() { $this->content .= $this->doc->header($GLOBALS['LANG']->getLL('manageRefIndex', TRUE)); @@ -349,21 +341,21 @@ class SC_mod_tools_dbint_index { // Command Line Interface $content = ''; - $content.= '<p>' . $GLOBALS['LANG']->getLL('checkScript') . '</p>'; - $content.= '<h4>' . $GLOBALS['LANG']->getLL('checkScript_check_description') . '</h4>' . + $content .= '<p>' . $GLOBALS['LANG']->getLL('checkScript') . '</p>'; + $content .= '<h4>' . $GLOBALS['LANG']->getLL('checkScript_check_description') . '</h4>' . '<code>php ' . PATH_typo3 . 'cli_dispatch.phpsh lowlevel_refindex -c</code><br />'; - $content.= '<h4>' . $GLOBALS['LANG']->getLL('checkScript_update_description') . '</h4>' . + $content .= '<h4>' . $GLOBALS['LANG']->getLL('checkScript_update_description') . '</h4>' . '<code>php ' . PATH_typo3 . 'cli_dispatch.phpsh lowlevel_refindex -e</code><br /><br />'; - $content.= '<div class="typo3-message message-information"><div class="message-body">' . $GLOBALS['LANG']->getLL('checkScript_information') . '</div></div>'; - $content.= '<p>' . $GLOBALS['LANG']->getLL('checkScript_moreDetails') . '<br /><a href="' . $GLOBALS['BACK_PATH'] . 'sysext/lowlevel/HOWTO_clean_up_TYPO3_installations.txt" target="_new">' . PATH_typo3 . 'sysext/lowlevel/HOWTO_clean_up_TYPO3_installations.txt</a></p>'; + $content .= '<div class="typo3-message message-information"><div class="message-body">' . $GLOBALS['LANG']->getLL('checkScript_information') . '</div></div>'; + $content .= '<p>' . $GLOBALS['LANG']->getLL('checkScript_moreDetails') . '<br /><a href="' . $GLOBALS['BACK_PATH'] . 'sysext/lowlevel/HOWTO_clean_up_TYPO3_installations.txt" target="_new">' . PATH_typo3 . 'sysext/lowlevel/HOWTO_clean_up_TYPO3_installations.txt</a></p>'; - $this->content.= $this->doc->section($GLOBALS['LANG']->getLL('checkScript_headline'), $content, FALSE, TRUE); + $this->content .= $this->doc->section($GLOBALS['LANG']->getLL('checkScript_headline'), $content, FALSE, TRUE); } /** * Search (Full / Advanced) * - * @return void + * @return void */ function func_search() { global $LANG; @@ -392,21 +384,20 @@ class SC_mod_tools_dbint_index { switch($this->MOD_SETTINGS['search']) { case 'query': - $this->content.=$fullsearch->queryMaker(); + $this->content .= $fullsearch->queryMaker(); break; case 'raw': default: - $this->content.=$this->doc->section($GLOBALS['LANG']->getLL('searchOptions'), $fullsearch->form(), FALSE, TRUE); - $this->content.=$this->doc->section($GLOBALS['LANG']->getLL('result'), $fullsearch->search(), FALSE, TRUE); + $this->content .= $this->doc->section($GLOBALS['LANG']->getLL('searchOptions'), $fullsearch->form(), FALSE, TRUE); + $this->content .= $this->doc->section($GLOBALS['LANG']->getLL('result'), $fullsearch->search(), FALSE, TRUE); break; } } - /** * Records overview * - * @return void + * @return void */ function func_records() { /** @var $admin t3lib_admin */ @@ -418,27 +409,27 @@ class SC_mod_tools_dbint_index { $this->content .= $this->doc->header($GLOBALS['LANG']->getLL('records')); // Pages stat - $codeArr=array(); + $codeArr = array(); $codeArr['tableheader'] = array('', $GLOBALS['LANG']->getLL('count')); $i++; $codeArr[$i][] = t3lib_iconWorks::getSpriteIconForRecord('pages', array()); - $codeArr[$i][]=$GLOBALS['LANG']->getLL('total_pages'); - $codeArr[$i][]=count($admin->page_idArray); + $codeArr[$i][] = $GLOBALS['LANG']->getLL('total_pages'); + $codeArr[$i][] = count($admin->page_idArray); $i++; if (t3lib_extMgm::isLoaded('cms')) { $codeArr[$i][] = t3lib_iconWorks::getSpriteIconForRecord('pages', array('hidden' => 1)); - $codeArr[$i][]=$GLOBALS['LANG']->getLL('hidden_pages'); + $codeArr[$i][] = $GLOBALS['LANG']->getLL('hidden_pages'); $codeArr[$i][] = $admin->recStats['hidden']; $i++; } $codeArr[$i][] = t3lib_iconWorks::getSpriteIconForRecord('pages', array('deleted' => 1)); - $codeArr[$i][]=$GLOBALS['LANG']->getLL('deleted_pages'); + $codeArr[$i][] = $GLOBALS['LANG']->getLL('deleted_pages'); $codeArr[$i][] = count($admin->recStats['deleted']['pages']); $this->content.=$this->doc->section($GLOBALS['LANG']->getLL('pages'), $this->doc->table($codeArr), FALSE, TRUE); // Doktype - $codeArr=array(); + $codeArr = array(); $codeArr['tableheader'] = array($GLOBALS['LANG']->getLL('doktype_value'), $GLOBALS['LANG']->getLL('count')); $doktype = $GLOBALS['TCA']['pages']['columns']['doktype']['config']['items']; if (is_array($doktype)) { @@ -487,7 +478,7 @@ class SC_mod_tools_dbint_index { $codeArr[$t][] = $GLOBALS['LANG']->sL($GLOBALS['TCA'][$t]['ctrl']['title']); $codeArr[$t][]=$t; - if($t === 'pages' && $admin->lostPagesList !== '') { + if ($t === 'pages' && $admin->lostPagesList !== '') { $lostRecordCount = count(explode(',', $admin->lostPagesList)); } else { $lostRecordCount = count($admin->lRecords[$t]); @@ -498,9 +489,9 @@ class SC_mod_tools_dbint_index { } else { $theNumberOfRe =''; } - $codeArr[$t][]=$theNumberOfRe; + $codeArr[$t][] = $theNumberOfRe; - $lr=''; + $lr = ''; if (is_array($admin->lRecords[$t])) { foreach ($admin->lRecords[$t] as $data) { if (!t3lib_div::inList($admin->lostPagesList, $data[pid])) { @@ -519,7 +510,7 @@ class SC_mod_tools_dbint_index { /** * Show list references * - * @return void + * @return void */ function func_relations() { global $LANG,$BACK_PATH; @@ -538,14 +529,14 @@ class SC_mod_tools_dbint_index { $code = ''; if (is_array($fileTest['noReferences'])) { foreach ($fileTest['noReferences'] as $val) { - $code.='<nobr>' . $val[0] . '/<strong>' . $val[1] . '</strong></nobr><br>'; + $code .= '<nobr>' . $val[0] . '/<strong>' . $val[1] . '</strong></nobr><br>'; } } else { $code = $GLOBALS['LANG']->getLL('no_files_found'); } $this->content .= $this->doc->section($GLOBALS['LANG']->getLL('files_no_ref'), $code, FALSE, TRUE); - $code=''; + $code = ''; if (is_array($fileTest['moreReferences'])) { foreach ($fileTest['moreReferences'] as $val) { $code.='<nobr>' . $val[0] . '/<strong>' . $val[1] . '</strong>: ' . $val[2] . ' ' . $GLOBALS['LANG']->getLL('references') . '</nobr><br>' . $val[3] . '<br><br>'; @@ -555,7 +546,7 @@ class SC_mod_tools_dbint_index { } $this->content .= $this->doc->section($GLOBALS['LANG']->getLL('files_many_ref'), $code, FALSE, TRUE); - $code=''; + $code = ''; if (is_array($fileTest['noFile'])) { ksort($fileTest['noFile']); foreach ($fileTest['noFile'] as $val) { @@ -572,33 +563,35 @@ class SC_mod_tools_dbint_index { /** * Searching for files with a specific pattern * - * @return void + * @return void */ function func_filesearch() { $pattern = t3lib_div::_GP('pattern'); $pcontent = $GLOBALS['LANG']->getLL('enterRegexPattern') . ' <input type="text" name="pattern" value="' . htmlspecialchars($pattern ? $pattern : $GLOBALS['TYPO3_CONF_VARS']['BE']['fileDenyPattern']) . '"> <input type="submit" name="' . $GLOBALS['LANG']->getLL('SearchButton') . '">'; $this->content .= $this->doc->header($GLOBALS['LANG']->getLL('findFilename')); - $this->content.= $this->doc->section($GLOBALS['LANG']->getLL('pattern'), $pcontent, FALSE, TRUE); + $this->content .= $this->doc->section($GLOBALS['LANG']->getLL('pattern'), $pcontent, FALSE, TRUE); if (strcmp($pattern, '')) { $dirs = t3lib_div::get_dirs(PATH_site); - $lines=array(); - $depth=10; + $lines = array(); + $depth = 10; foreach ($dirs as $key => $value) { - $matching_files=array(); - $info=''; + $matching_files = array(); + $info = ''; if (!t3lib_div::inList('typo3,typo3conf,tslib,media,t3lib', $value)) { $info = $this->findFile(PATH_site . $value . '/', $pattern, $matching_files, $depth); } if (is_array($info)) { - $lines[]='<hr><strong>' . $value . '/</strong> ' . $GLOBALS['LANG']->getLL('beingChecked'); - $lines[]=$GLOBALS['LANG']->getLL('directories') . ' ' . $info[0]; - if ($info[2]) $lines[]='<span class="typo3-red">' . $GLOBALS['LANG']->getLL('directoriesTooDeep') . ' ' . $depth . '</span>'; - $lines[]=$GLOBALS['LANG']->getLL('files') . ' ' . $info[1]; - $lines[]=$GLOBALS['LANG']->getLL('matchingFiles') . '<br><nobr><span class="typo3-red">' . implode('<br>', $matching_files) . '</span></nobr>'; + $lines[] = '<hr><strong>' . $value . '/</strong> ' . $GLOBALS['LANG']->getLL('beingChecked'); + $lines[] = $GLOBALS['LANG']->getLL('directories') . ' ' . $info[0]; + if ($info[2]) { + $lines[] = '<span class="typo3-red">' . $GLOBALS['LANG']->getLL('directoriesTooDeep') . ' ' . $depth . '</span>'; + } + $lines[] = $GLOBALS['LANG']->getLL('files') . ' ' . $info[1]; + $lines[] = $GLOBALS['LANG']->getLL('matchingFiles') . '<br><nobr><span class="typo3-red">' . implode('<br>', $matching_files) . '</span></nobr>'; } else { - $lines[]=$GLOBALS['TBE_TEMPLATE']->dfw('<hr><strong>' . $value . '/</strong> ' . $GLOBALS['LANG']->getLL('notChecked')); + $lines[] = $GLOBALS['TBE_TEMPLATE']->dfw('<hr><strong>' . $value . '/</strong> ' . $GLOBALS['LANG']->getLL('notChecked')); } } @@ -609,10 +602,10 @@ class SC_mod_tools_dbint_index { /** * Searching for filename pattern recursively in the specified dir. * - * @param string $basedir: Base directory - * @param string $pattern: Match pattern - * @param array $matching_files: Array of matching files, passed by reference - * @param integer $depth: Depth to recurse + * @param string $basedir Base directory + * @param string $pattern Match pattern + * @param array $matching_files Array of matching files, passed by reference + * @param integer $depth Depth to recurse * @return array Array with various information about the search result * @see func_filesearch() */ @@ -659,7 +652,7 @@ class SC_mod_tools_dbint_index { } } -// Make instance: + // Make instance: $SOBE = t3lib_div::makeInstance('SC_mod_tools_dbint_index'); $SOBE->init(); $SOBE->main(); diff --git a/typo3/sysext/lowlevel/ext_localconf.php b/typo3/sysext/lowlevel/ext_localconf.php index 0a1e272cc621..85a99db696ca 100644 --- a/typo3/sysext/lowlevel/ext_localconf.php +++ b/typo3/sysext/lowlevel/ext_localconf.php @@ -1,7 +1,9 @@ <?php -if (!defined ('TYPO3_MODE')) die ('Access denied.'); +if (!defined('TYPO3_MODE')) { + die('Access denied.'); +} -if (TYPO3_MODE=='BE') { +if (TYPO3_MODE == 'BE') { // Setting up scripts that can be run from the cli_dispatch.phpsh script. $TYPO3_CONF_VARS['SC_OPTIONS']['GLOBAL']['cliKeys']['lowlevel_refindex'] = array('EXT:lowlevel/dbint/cli/refindex_cli.php', '_CLI_lowlevel'); $TYPO3_CONF_VARS['SC_OPTIONS']['GLOBAL']['cliKeys']['lowlevel_cleaner'] = array('EXT:lowlevel/dbint/cli/cleaner_cli.php', '_CLI_lowlevel'); diff --git a/typo3/sysext/lowlevel/ext_tables.php b/typo3/sysext/lowlevel/ext_tables.php index 11ac6e6925f9..32b8d8c192bf 100755 --- a/typo3/sysext/lowlevel/ext_tables.php +++ b/typo3/sysext/lowlevel/ext_tables.php @@ -1,7 +1,9 @@ <?php -if (!defined ('TYPO3_MODE')) die ('Access denied.'); +if (!defined('TYPO3_MODE')) { + die('Access denied.'); +} -if (TYPO3_MODE=='BE') { +if (TYPO3_MODE == 'BE') { t3lib_extMgm::addModule('tools', 'dbint', '', t3lib_extMgm::extPath($_EXTKEY).'dbint/'); t3lib_extMgm::addModule('tools', 'config', '', t3lib_extMgm::extPath($_EXTKEY).'config/'); } -- GitLab