jwarnier
2010-08-17 10df6dc6e0ff0a1c14c8f01a845ac9f1b23d2580
Strip out no longer used find_duplicates().


2 files modified
107 ■■■■■ changed files
install/lib/install.lib.php 59 ●●●●● patch | view | raw | blame | history
server/lib/classes/file.inc.php 48 ●●●●● patch | view | raw | blame | history
install/lib/install.lib.php
@@ -30,7 +30,7 @@
/*
    This function returns a string that describes the installed
    linux distribution. e.g. debian40 for Debian Linux 4.0
    Linux distribution. e.g. debian40 for Debian GNU/Linux 4.0
*/
@@ -183,7 +183,7 @@
         swriteln("Operating System: Gentoo $distver or compatible\n");
        
    } else {
        die('unrecognized linux distribution');
        die('unrecognized Linux distribution');
    }
    
    return array('name' => $distname, 'version' => $distver, 'id' => $distid, 'baseid' => $distbaseid);
@@ -353,61 +353,6 @@
    } else {
        return '';
    }
}
function find_includes($file){
  global $httpd_root;
  clearstatcache();
  if(is_file($file) && filesize($file) > 0){
    $includes[] = $file;
    $inhalt = unix_nl(no_comments($file));
    $lines = explode("\n", $inhalt);
    if(!empty($lines)){
      foreach($lines as $line){
        if(stristr($line, 'include ')){
          $include_file = str_replace("\n", '', trim(shell_exec("echo \"$line\" | awk '{print \$2}'")));
          if(substr($include_file,0,1) != '/'){
            $include_file = $httpd_root.'/'.$include_file;
          }
          if(is_file($include_file)){
            if($further_includes = find_includes($include_file)){
              $includes = array_merge($includes, $further_includes);
            }
          } else {
            if(strstr($include_file, '*')){
              $more_files = explode("\n", shell_exec("ls -l $include_file | awk '{print \$9}'"));
              if(!empty($more_files)){
                foreach($more_files as $more_file){
                  if(is_file($more_file)){
                    if($further_includes = find_includes($more_file)){
                      $includes = array_merge($includes, $further_includes);
                    }
                  }
                }
              }
              unset($more_files);
              $more_files = explode("\n", shell_exec("ls -l $include_file | awk '{print \$10}'"));
              if(!empty($more_files)){
                foreach($more_files as $more_file){
                  if(is_file($more_file)){
                    if($further_includes = find_includes($more_file)){
                      $includes = array_merge($includes, $further_includes);
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
  if(is_array($includes)){
    $includes = array_unique($includes);
    return $includes;
  } else {
    return false;
  }
}
function comment_out($file, $string){
server/lib/classes/file.inc.php
@@ -158,52 +158,6 @@
      return $ret_val;
    }
    
    function find_includes($file){
      ob_start();
      $httpd_root = system('httpd -V | awk -F"\"" \'$1==" -D HTTPD_ROOT="{print $2}\'');
      ob_end_clean();
      clearstatcache();
      if(is_file($file) && filesize($file) > 0){
        $includes[] = $file;
        $inhalt = $this->unix_nl($this->no_comments($file));
        $lines = explode("\n", $inhalt);
        if(!empty($lines)){
          foreach($lines as $line){
            if(stristr($line, "include ")){
              $include_file = str_replace("\n", "", trim(shell_exec("echo \"$line\" | awk '{print \$2}'")));
              if(substr($include_file,0,1) != "/"){
                $include_file = $httpd_root."/".$include_file;
              }
              if(is_file($include_file)){
                if($further_includes = $this->find_includes($include_file)){
                  $includes = array_merge($includes, $further_includes);
                }
              } else {
                if(strstr($include_file, "*")){
                  $more_files = explode("\n", shell_exec("ls -l $include_file | awk '{print \$9}'"));
                  if(!empty($more_files)){
                    foreach($more_files as $more_file){
                      if(is_file($more_file)){
                        if($further_includes = $this->find_includes($more_file)){
                          $includes = array_merge($includes, $further_includes);
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
      if(is_array($includes)){
        $includes = array_unique($includes);
        return $includes;
      } else {
        return false;
      }
    }
    function edit_dist($var, $val){
      global $$var;
      $files = array("/root/ispconfig/dist.inc.php");
@@ -316,4 +270,4 @@
    }
}
?>
?>