[ Index ]

PHP Cross Reference of phpwcms V1.5.0 _r431 (28.01.12)

title

Body

[close]

/setup/inc/ -> upgrade.func.inc.php (source)

   1  <?php
   2  
   3  // taken from http://de.php.net/manual/de/function.phpinfo.php#59573
   4  function parsePHPModules() {
   5   ob_start();
   6   phpinfo(INFO_MODULES);
   7   $s = ob_get_clean();
   8   $s = strip_tags($s,'<h2><th><td>');
   9   $s = preg_replace('/<th[^>]*>([^<]+)<\/th>/',"<info>\\1</info>",$s);
  10   $s = preg_replace('/<td[^>]*>([^<]+)<\/td>/',"<info>\\1</info>",$s);
  11   $vTmp = preg_split('/(<h2>[^<]+<\/h2>)/',$s,-1,PREG_SPLIT_DELIM_CAPTURE);
  12   $vModules = array();
  13   for ($i=1;$i<count($vTmp);$i++) {
  14    if (preg_match('/<h2>([^<]+)<\/h2>/',$vTmp[$i],$vMat)) {
  15     $vName = trim($vMat[1]);
  16     $vTmp2 = explode("\n",$vTmp[$i+1]);
  17     foreach ($vTmp2 AS $vOne) {
  18     $vPat = '<info>([^<]+)<\/info>';
  19     $vPat3 = "/$vPat\s*$vPat\s*$vPat/";
  20     $vPat2 = "/$vPat\s*$vPat/";
  21     if (preg_match($vPat3,$vOne,$vMat)) { // 3cols
  22       $vModules[$vName][trim($vMat[1])] = array(trim($vMat[2]),trim($vMat[3]));
  23     } elseif (preg_match($vPat2,$vOne,$vMat)) { // 2cols
  24       $vModules[$vName][trim($vMat[1])] = trim($vMat[2]);
  25     }
  26     }
  27    }
  28   }
  29   return $vModules;
  30  }
  31  
  32  
  33  ?>


Generated: Sun Jan 29 16:31:14 2012 Cross-referenced by PHPXref 0.7.1