Skip to content

Commit 10df6dc

Browse files
author
jwarnier
committed
Strip out no longer used find_duplicates().
1 parent af5f0aa commit 10df6dc

File tree

2 files changed

+3
-104
lines changed

2 files changed

+3
-104
lines changed

install/lib/install.lib.php

Lines changed: 2 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
/*
3232
This function returns a string that describes the installed
33-
linux distribution. e.g. debian40 for Debian Linux 4.0
33+
Linux distribution. e.g. debian40 for Debian GNU/Linux 4.0
3434
*/
3535

3636

@@ -183,7 +183,7 @@ function get_distname() {
183183
swriteln("Operating System: Gentoo $distver or compatible\n");
184184

185185
} else {
186-
die('unrecognized linux distribution');
186+
die('unrecognized Linux distribution');
187187
}
188188

189189
return array('name' => $distname, 'version' => $distver, 'id' => $distid, 'baseid' => $distbaseid);
@@ -355,61 +355,6 @@ function no_comments($file, $comment = '#'){
355355
}
356356
}
357357

358-
function find_includes($file){
359-
global $httpd_root;
360-
clearstatcache();
361-
if(is_file($file) && filesize($file) > 0){
362-
$includes[] = $file;
363-
$inhalt = unix_nl(no_comments($file));
364-
$lines = explode("\n", $inhalt);
365-
if(!empty($lines)){
366-
foreach($lines as $line){
367-
if(stristr($line, 'include ')){
368-
$include_file = str_replace("\n", '', trim(shell_exec("echo \"$line\" | awk '{print \$2}'")));
369-
if(substr($include_file,0,1) != '/'){
370-
$include_file = $httpd_root.'/'.$include_file;
371-
}
372-
if(is_file($include_file)){
373-
if($further_includes = find_includes($include_file)){
374-
$includes = array_merge($includes, $further_includes);
375-
}
376-
} else {
377-
if(strstr($include_file, '*')){
378-
$more_files = explode("\n", shell_exec("ls -l $include_file | awk '{print \$9}'"));
379-
if(!empty($more_files)){
380-
foreach($more_files as $more_file){
381-
if(is_file($more_file)){
382-
if($further_includes = find_includes($more_file)){
383-
$includes = array_merge($includes, $further_includes);
384-
}
385-
}
386-
}
387-
}
388-
unset($more_files);
389-
$more_files = explode("\n", shell_exec("ls -l $include_file | awk '{print \$10}'"));
390-
if(!empty($more_files)){
391-
foreach($more_files as $more_file){
392-
if(is_file($more_file)){
393-
if($further_includes = find_includes($more_file)){
394-
$includes = array_merge($includes, $further_includes);
395-
}
396-
}
397-
}
398-
}
399-
}
400-
}
401-
}
402-
}
403-
}
404-
}
405-
if(is_array($includes)){
406-
$includes = array_unique($includes);
407-
return $includes;
408-
} else {
409-
return false;
410-
}
411-
}
412-
413358
function comment_out($file, $string){
414359
$inhalt = no_comments($file);
415360
$gesamt_inhalt = rf($file);

server/lib/classes/file.inc.php

Lines changed: 1 addition & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -158,52 +158,6 @@ function mkdirs($strPath, $mode = '0755'){
158158
return $ret_val;
159159
}
160160

161-
function find_includes($file){
162-
ob_start();
163-
$httpd_root = system('httpd -V | awk -F"\"" \'$1==" -D HTTPD_ROOT="{print $2}\'');
164-
ob_end_clean();
165-
clearstatcache();
166-
if(is_file($file) && filesize($file) > 0){
167-
$includes[] = $file;
168-
$inhalt = $this->unix_nl($this->no_comments($file));
169-
$lines = explode("\n", $inhalt);
170-
if(!empty($lines)){
171-
foreach($lines as $line){
172-
if(stristr($line, "include ")){
173-
$include_file = str_replace("\n", "", trim(shell_exec("echo \"$line\" | awk '{print \$2}'")));
174-
if(substr($include_file,0,1) != "/"){
175-
$include_file = $httpd_root."/".$include_file;
176-
}
177-
if(is_file($include_file)){
178-
if($further_includes = $this->find_includes($include_file)){
179-
$includes = array_merge($includes, $further_includes);
180-
}
181-
} else {
182-
if(strstr($include_file, "*")){
183-
$more_files = explode("\n", shell_exec("ls -l $include_file | awk '{print \$9}'"));
184-
if(!empty($more_files)){
185-
foreach($more_files as $more_file){
186-
if(is_file($more_file)){
187-
if($further_includes = $this->find_includes($more_file)){
188-
$includes = array_merge($includes, $further_includes);
189-
}
190-
}
191-
}
192-
}
193-
}
194-
}
195-
}
196-
}
197-
}
198-
}
199-
if(is_array($includes)){
200-
$includes = array_unique($includes);
201-
return $includes;
202-
} else {
203-
return false;
204-
}
205-
}
206-
207161
function edit_dist($var, $val){
208162
global $$var;
209163
$files = array("/root/ispconfig/dist.inc.php");
@@ -316,4 +270,4 @@ function checkFileExtension($filename, $exts, $ext_save = 1){
316270
}
317271

318272
}
319-
?>
273+
?>

0 commit comments

Comments
 (0)