[ Index ]
 

Code source de phpMyVisites 2.3

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/plugins/clickheat/libs/scripts/ -> upgrade-1.1.php (source)

   1  <?php
   2  /**
   3   * Upgrade from 1.1 to 1.2 : %% to be removed in urls
   4  **/
   5  $updates = 0;
   6  if (!is_dir($clickheatConf['logPath']))
   7  {
   8      return true;
   9  }
  10  $dir = dir($clickheatConf['logPath']);
  11  while (($d = $dir->read()) !== false)
  12  {
  13      if ($d === '.' || $d === '..' || !is_dir($dir->path.$d))
  14      {
  15          continue;
  16      }
  17      $subdir = dir($clickheatConf['logPath'].$d.'/');
  18      while (($f = $subdir->read()) !== false)
  19      {
  20          if ($f === '.' || $f === '..' || substr($f, 0, 2) !== '%%' || substr($f, -2) !== '%%')
  21          {
  22              continue;
  23          }
  24          if (substr($f, -5) === 'png%%' || substr($f, -6) === 'html%%')
  25          {
  26              if (@unlink($subdir->path.$f))
  27              {
  28                  $updates++;
  29              }
  30              continue;
  31          }
  32          if (@rename($subdir->path.$f, $subdir->path.trim($f, '%')))
  33          {
  34              $updates++;
  35          }
  36      }
  37  }
  38  echo $updates.' files renamed/purged';
  39  ?>


Généré le : Mon Nov 26 14:10:01 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics