Index: typo3/sysext/em/mod1/class.em_index.php =================================================================== --- typo3/sysext/em/mod1/class.em_index.php (révision 8611) +++ typo3/sysext/em/mod1/class.em_index.php (copie de travail) @@ -99,7 +99,6 @@ * * SECTION: Extension analyzing (detailed information) * 2710: function makeDetailedExtensionAnalysis($extKey,$extInfo,$validity=0) - * 2892: function getClassIndexLocallangFiles($absPath,$table_class_prefix,$extKey) * 2962: function modConfFileAnalysis($confFilePath) * 2990: function serverExtensionMD5Array($extKey,$conf) * 3015: function findMD5ArrayDiff($current,$past) @@ -511,7 +510,6 @@ 2 => $GLOBALS['LANG']->getLL('show_more_details'), 3 => $GLOBALS['LANG']->getLL('show_technical'), - 4 => $GLOBALS['LANG']->getLL('show_validating'), 5 => $GLOBALS['LANG']->getLL('show_changed'), ), 'display_shy' => '', @@ -545,7 +543,6 @@ // page/be_user TSconfig settings and blinding of menu-items if (!$BE_USER->getTSConfigVal('mod.'.$this->MCONF['name'].'.allowTVlisting')) { unset($this->MOD_MENU['display_details'][3]); - unset($this->MOD_MENU['display_details'][4]); unset($this->MOD_MENU['display_details'][5]); } @@ -557,7 +554,6 @@ unset($this->MOD_MENU['listOrder']['type']); unset($this->MOD_MENU['display_details'][2]); unset($this->MOD_MENU['display_details'][3]); - unset($this->MOD_MENU['display_details'][4]); unset($this->MOD_MENU['display_details'][5]); $this->MOD_SETTINGS = t3lib_BEfunc::getModuleData($this->MOD_MENU, t3lib_div::_GP('SET'), $this->MCONF['name']); } @@ -3152,10 +3148,6 @@ ' . (is_array($techInfo['TSfiles']) ? implode('
', $techInfo['TSfiles']) : '') . '' . $this->helpCol('TSfiles') . ''; - $lines[] = '' . $GLOBALS['LANG']->getLL('extInfoArray_language_files') . ' - ' . (is_array($techInfo['locallang']) ? - implode('
', $techInfo['locallang']) : '') . '' . - $this->helpCol('locallang') . ''; $lines[] = '' . $GLOBALS['LANG']->getLL('extInfoArray_upload_folder') . ' ' . ($techInfo['uploadfolder'] ? $techInfo['uploadfolder'] : '') . '' . @@ -3168,22 +3160,6 @@ ' . (is_array($techInfo['moduleNames']) ? implode('
', $techInfo['moduleNames']) : '') . '' . $this->helpCol('moduleNames') . ''; - $lines[] = '' . $GLOBALS['LANG']->getLL('extInfoArray_class_names') . ' - ' . (is_array($techInfo['classes']) ? - implode('
', $techInfo['classes']) : '') . '' . - $this->helpCol('classNames') . ''; - $lines[] = '' . $GLOBALS['LANG']->getLL('extInfoArray_code_warnings') . '
' . - $GLOBALS['LANG']->getLL('extInfoArray_dev_relevant') . ' - ' . (is_array($techInfo['errors']) ? - $GLOBALS['TBE_TEMPLATE']->rfw(implode('
', $techInfo['errors'])) : '') . '' . - $this->helpCol('errors') . ''; - $lines[] = '' . $GLOBALS['LANG']->getLL('extInfoArray_annoyances') . '
' . - $GLOBALS['LANG']->getLL('extInfoArray_dev_relevant') . ' - ' . (is_array($techInfo['NSerrors']) ? - (!t3lib_div::inList($this->nameSpaceExceptions, $extKey) ? - t3lib_div::view_array($techInfo['NSerrors']) : - $GLOBALS['TBE_TEMPLATE']->dfw($GLOBALS['LANG']->getLL('extInfoArray_exception'))) : '') . '' . - $this->helpCol('NSerrors') . ''; $currentMd5Array = $this->serverExtensionMD5Array($extKey,$extInfo); $affectedFiles=''; @@ -3347,12 +3323,6 @@ $cells[] = '' . $GLOBALS['LANG']->getLL('listRowHeader_affects') . ''; $cells[] = '' . $GLOBALS['LANG']->getLL('listRowHeader_modules') . ''; $cells[] = '' . $GLOBALS['LANG']->getLL('listRowHeader_config') . ''; - $cells[] = '' . $GLOBALS['LANG']->getLL('extInfoArray_code_warnings') . ''; - } elseif ($this->MOD_SETTINGS['display_details']==4) { - $cells[] = '' . $GLOBALS['LANG']->getLL('listRowHeader_locallang') . ''; - $cells[] = '' . $GLOBALS['LANG']->getLL('listRowHeader_classes') . ''; - $cells[] = '' . $GLOBALS['LANG']->getLL('extInfoArray_code_warnings') . ''; - $cells[] = '' . $GLOBALS['LANG']->getLL('extInfoArray_annoyances') . ''; } elseif ($this->MOD_SETTINGS['display_details']==5) { $cells[] = '' . $GLOBALS['LANG']->getLL('listRowHeader_changed_files') . ''; } else { @@ -3437,16 +3407,6 @@ '' . $GLOBALS['LANG']->getLL('extInfoArray_static_table_error') . '
' . $GLOBALS['LANG']->getLL('extInfoArray_static_tables_missing_empty') : '')) . ''; - } elseif ($this->MOD_SETTINGS['display_details']==4) { - $techInfo=$this->makeDetailedExtensionAnalysis($extKey,$extInfo,1); - - $cells[] = ''.(is_array($techInfo['locallang']) ? implode('
',$techInfo['locallang']) : '').''; - $cells[] = ''.(is_array($techInfo['classes']) ? implode('
',$techInfo['classes']) : '').''; - $cells[] = ''.(is_array($techInfo['errors']) ? $GLOBALS['TBE_TEMPLATE']->rfw(implode('
',$techInfo['errors'])) : '').''; - $cells[] = ''.(is_array($techInfo['NSerrors']) ? - (!t3lib_div::inList($this->nameSpaceExceptions, $extKey) ? - t3lib_div::view_array($techInfo['NSerrors']) : - $GLOBALS['TBE_TEMPLATE']->dfw($GLOBALS['LANG']->getLL('extInfoArray_exception'))) : '') . ''; } elseif ($this->MOD_SETTINGS['display_details']==5) { $currentMd5Array = $this->serverExtensionMD5Array($extKey,$extInfo); $affectedFiles = ''; @@ -4097,16 +4057,6 @@ $infoArray['conf'] = 1; } - // Classes: - if ($validity) { - $filesInside = $this->getClassIndexLocallangFiles($absPath,$table_class_prefix,$extKey); - if (is_array($filesInside['errors'])) $infoArray['errors'] = array_merge((array)$infoArray['errors'],$filesInside['errors']); - if (is_array($filesInside['NSerrors'])) $infoArray['NSerrors'] = array_merge((array)$infoArray['NSerrors'],$filesInside['NSerrors']); - if (is_array($filesInside['NSok'])) $infoArray['NSok'] = array_merge((array)$infoArray['NSok'],$filesInside['NSok']); - $infoArray['locallang'] = $filesInside['locallang']; - $infoArray['classes'] = $filesInside['classes']; - } - // Upload folders if ($extInfo['EM_CONF']['uploadfolder']) { $infoArray['uploadfolder'] = $this->ulFolder($extKey); @@ -4135,96 +4085,6 @@ } /** - * Analyses the php-scripts of an available extension on server - * - * @param string Absolute path to extension - * @param string Prefix for tables/classes. - * @param string Extension key - * @return array Information array. - * @see makeDetailedExtensionAnalysis() - */ - function getClassIndexLocallangFiles($absPath,$table_class_prefix,$extKey) { - $filesInside = t3lib_div::removePrefixPathFromList(t3lib_div::getAllFilesAndFoldersInPath(array(),$absPath,'php,inc',0,99,$this->excludeForPackaging),$absPath); - $out = array(); - $reg = array(); - - foreach($filesInside as $fileName) { - if (substr($fileName,0,4)!='ext_' && substr($fileName,0,6)!='tests/') { // ignore supposed-to-be unit tests as well - $baseName = basename($fileName); - if (substr($baseName,0,9)=='locallang' && substr($baseName,-4)=='.php') { - $out['locallang'][] = $fileName; - } elseif ($baseName!='conf.php') { - if (filesize($absPath.$fileName)<500*1024) { - $fContent = t3lib_div::getUrl($absPath.$fileName); - unset($reg); - if (preg_match('/\n[[:space:]]*class[[:space:]]*([[:alnum:]_]+)([[:alnum:][:space:]_]*)/',$fContent,$reg)) { - - // Find classes: - $lines = explode(LF,$fContent); - foreach($lines as $l) { - $line = trim($l); - unset($reg); - if (preg_match('/^class[[:space:]]*([[:alnum:]_]+)([[:alnum:][:space:]_]*)/',$line,$reg)) { - $out['classes'][] = $reg[1]; - $out['files'][$fileName]['classes'][] = $reg[1]; - if ($reg[1]!=='ext_update' && substr($reg[1],0,3)!='ux_' && !t3lib_div::isFirstPartOfStr($reg[1],$table_class_prefix) && strcmp(substr($table_class_prefix,0,-1),$reg[1])) { - $out['NSerrors']['classname'][] = $reg[1]; - } else $out['NSok']['classname'][] = $reg[1]; - } - } - // If class file prefixed 'class.'.... - if (substr($baseName,0,6)=='class.') { - $fI = pathinfo($baseName); - $testName=substr($baseName,6,-(1+strlen($fI['extension']))); - if ($testName!=='ext_update' && substr($testName,0,3)!='ux_' && !t3lib_div::isFirstPartOfStr($testName,$table_class_prefix) && strcmp(substr($table_class_prefix,0,-1),$testName)) { - $out['NSerrors']['classfilename'][] = $baseName; - } else { - $out['NSok']['classfilename'][] = $baseName; - if (is_array($out['files'][$fileName]['classes']) && $this->first_in_array($testName,$out['files'][$fileName]['classes'],1)) { - $out['msg'][] = sprintf($GLOBALS['LANG']->getLL('detailedExtAnalysis_class_ok'), - $fileName, $testName - ); - } else $out['errors'][] = sprintf($GLOBALS['LANG']->getLL('detailedExtAnalysis_class_not_ok'), - $fileName, $testName - ); - } - } - - // Check for proper XCLASS definition - // Match $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS'] with single or doublequotes - $XclassSearch = '\$TYPO3_CONF_VARS\[TYPO3_MODE\]\[[\'"]XCLASS[\'"]\]'; - $XclassParts = preg_split('/if \(defined\([\'"]TYPO3_MODE[\'"]\) && ' . $XclassSearch . '/', $fContent, 2); - if (count($XclassParts) !== 2) { - // Match $GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS'] with single or doublequotes - $XclassSearch = '\$GLOBALS\[[\'"]TYPO3_CONF_VARS[\'"]\]\[TYPO3_MODE\]\[[\'"]XCLASS[\'"]\]'; - $XclassParts = preg_split('/if \(defined\([\'"]TYPO3_MODE[\'"]\) && ' . $XclassSearch . '/', $fContent, 2); - } - if (count($XclassParts)==2) { - unset($reg); - preg_match('/^\[[\'"]([[:alnum:]_\/\.]*)[\'"]\]/',$XclassParts[1],$reg); - if ($reg[1]) { - $cmpF = 'ext/'.$extKey.'/'.$fileName; - if (!strcmp($reg[1],$cmpF)) { - if (preg_match('/_once[[:space:]]*\(' . $XclassSearch . '\[[\'"]' . preg_quote($cmpF, '/') . '[\'"]\]\);/', $XclassParts[1])) { - $out['msg'][] = sprintf($GLOBALS['LANG']->getLL('detailedExtAnalysis_xclass_ok'), $fileName); - } else $out['errors'][] = $GLOBALS['LANG']->getLL('detailedExtAnalysis_xclass_no_include'); - } else $out['errors'][] = sprintf($GLOBALS['LANG']->getLL('detailedExtAnalysis_xclass_incorrect'), - $reg[1], $cmpF - ); - } else $out['errors'][] = sprintf($GLOBALS['LANG']->getLL('detailedExtAnalysis_no_xclass_filename'), $fileName); - } elseif (!$this->first_in_array('ux_', $out['files'][$fileName]['classes'])) { - // No Xclass definition required if classname starts with 'ux_' - $out['errors'][] = sprintf($GLOBALS['LANG']->getLL('detailedExtAnalysis_no_xclass_found'), $fileName); - } - } - } - } - } - } - return $out; - } - - /** * Reads $confFilePath (a module $conf-file) and returns information on the existence of TYPO3_MOD_PATH definition and MCONF_name * * @param string Absolute path to a "conf.php" file of a module which we are analysing.