/**
  * Gathers all extensions in $path
  *
  * @param    string $path     Absolute path to local, global or system extensions
  * @param    array  $dbSchema array with all the tables
  * @return    array        "Returns" content by reference
  */
 public static function getInstExtList($path, $dbSchema)
 {
     $list = array();
     if (@is_dir($path)) {
         $extList = \TYPO3\CMS\Core\Utility\GeneralUtility::get_dirs($path);
         if (is_array($extList)) {
             foreach ($extList as $extKey) {
                 if (@is_file($path . $extKey . '/ext_emconf.php')) {
                     $emConf = self::includeEMCONF($path . $extKey . '/ext_emconf.php', $extKey);
                     if (is_array($emConf)) {
                         $currentExt = array();
                         $currentExt['extkey'] = $extKey;
                         $currentExt['installed'] = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded($extKey);
                         $currentExt['EM_CONF'] = $emConf;
                         $currentExt['files'] = \TYPO3\CMS\Core\Utility\GeneralUtility::getFilesInDir($path . $extKey, '', 0, '', null);
                         $currentExt['lastversion'] = tx_additionalreports_util::checkExtensionUpdate($currentExt);
                         $currentExt['affectedfiles'] = tx_additionalreports_util::getExtAffectedFiles($currentExt);
                         $currentExt['icon'] = tx_additionalreports_util::getExtIcon($extKey);
                         // db infos
                         $fdFile = array();
                         $updateStatements = array();
                         tx_additionalreports_util::getExtSqlUpdateStatements($currentExt, $dbSchema, $fdFile, $updateStatements);
                         $currentExt['fdfile'] = $fdFile;
                         $currentExt['updatestatements'] = $updateStatements;
                         if ($currentExt['installed']) {
                             if ($currentExt['lastversion']) {
                                 $list['ter'][$extKey] = $currentExt;
                             } else {
                                 $list['dev'][$extKey] = $currentExt;
                             }
                         } else {
                             $list['unloaded'][$extKey] = $currentExt;
                         }
                     }
                 }
             }
         }
     }
     return $list;
 }