Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
lolo888
ISPConfig 3
Commits
10df6dc6
Commit
10df6dc6
authored
Aug 17, 2010
by
jwarnier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Strip out no longer used find_duplicates().
parent
af5f0aaf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
104 deletions
+3
-104
install/lib/install.lib.php
install/lib/install.lib.php
+2
-57
server/lib/classes/file.inc.php
server/lib/classes/file.inc.php
+1
-47
No files found.
install/lib/install.lib.php
View file @
10df6dc6
...
...
@@ -30,7 +30,7 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/*
This function returns a string that describes the installed
l
inux distribution. e.g. debian40 for Debian Linux 4.0
L
inux distribution. e.g. debian40 for Debian
GNU/
Linux 4.0
*/
...
...
@@ -183,7 +183,7 @@ function get_distname() {
swriteln
(
"Operating System: Gentoo
$distver
or compatible
\n
"
);
}
else
{
die
(
'unrecognized
l
inux distribution'
);
die
(
'unrecognized
L
inux distribution'
);
}
return
array
(
'name'
=>
$distname
,
'version'
=>
$distver
,
'id'
=>
$distid
,
'baseid'
=>
$distbaseid
);
...
...
@@ -355,61 +355,6 @@ function no_comments($file, $comment = '#'){
}
}
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
){
$inhalt
=
no_comments
(
$file
);
$gesamt_inhalt
=
rf
(
$file
);
...
...
server/lib/classes/file.inc.php
View file @
10df6dc6
...
...
@@ -158,52 +158,6 @@ class file{
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 @@ class file{
}
}
?>
\ No newline at end of file
?>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment