Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dolibarr
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software_Artifact_Infrastructure_Repository
dolibarr
Commits
4eedec02
Commit
4eedec02
authored
9 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Patches
Plain Diff
Fix tool to generate filecheck
parent
7c030a11
No related branches found
No related tags found
No related merge requests found
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
build/generate_filecheck_xml.php
+35
-6
35 additions, 6 deletions
build/generate_filecheck_xml.php
htdocs/admin/system/filecheck.php
+72
-46
72 additions, 46 deletions
htdocs/admin/system/filecheck.php
htdocs/install/filelist.xml
+1265
-1238
1265 additions, 1238 deletions
htdocs/install/filelist.xml
with
1372 additions
and
1290 deletions
build/generate_filecheck_xml.php
+
35
−
6
View file @
4eedec02
...
@@ -39,12 +39,14 @@ parse_str($argv[1]);
...
@@ -39,12 +39,14 @@ parse_str($argv[1]);
$outputfile
=
dirname
(
__FILE__
)
.
'/../htdocs/install/filelist.xml'
;
$outputfile
=
dirname
(
__FILE__
)
.
'/../htdocs/install/filelist.xml'
;
$fp
=
fopen
(
$outputfile
,
'w'
);
$fp
=
fopen
(
$outputfile
,
'w'
);
fputs
(
$fp
,
'<?xml version="1.0" encoding="UTF-8" ?>'
.
"
\n
"
);
fputs
(
$fp
,
'<?xml version="1.0" encoding="UTF-8" ?>'
.
"
\n
"
);
fputs
(
$fp
,
'<checksum_list>'
.
"
\n
"
);
fputs
(
$fp
,
'<checksum_list version="'
.
$release
.
'">'
.
"
\n
"
);
fputs
(
$fp
,
'<dolibarr_root_dir version="'
.
$release
.
'">'
.
"
\n
"
);
$dir_iterator
=
new
RecursiveDirectoryIterator
(
dirname
(
__FILE__
)
.
'/../htdocs/'
);
fputs
(
$fp
,
'<dolibarr_htdocs_dir>'
.
"
\n
"
);
$iterator
=
new
RecursiveIteratorIterator
(
$dir_iterator
);
$dir_iterator1
=
new
RecursiveDirectoryIterator
(
dirname
(
__FILE__
)
.
'/../htdocs/'
);
$iterator1
=
new
RecursiveIteratorIterator
(
$dir_iterator1
);
// need to ignore document custom etc
// need to ignore document custom etc
$files
=
new
RegexIterator
(
$iterator
,
'#^(?:[A-Z]:)?(?:/(?!(?:custom|documents|conf|install|nltechno))[^/]+)+/[^/]+\.(?:php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$#i'
);
$files
=
new
RegexIterator
(
$iterator
1
,
'#^(?:[A-Z]:)?(?:/(?!(?:custom|documents|conf|install|nltechno))[^/]+)+/[^/]+\.(?:php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$#i'
);
$dir
=
''
;
$dir
=
''
;
$needtoclose
=
0
;
$needtoclose
=
0
;
foreach
(
$files
as
$file
)
{
foreach
(
$files
as
$file
)
{
...
@@ -61,7 +63,34 @@ foreach ($files as $file) {
...
@@ -61,7 +63,34 @@ foreach ($files as $file) {
}
}
}
}
fputs
(
$fp
,
'</dir>'
.
"
\n
"
);
fputs
(
$fp
,
'</dir>'
.
"
\n
"
);
fputs
(
$fp
,
'</dolibarr_root_dir>'
.
"
\n
"
);
fputs
(
$fp
,
'</dolibarr_htdocs_dir>'
.
"
\n
"
);
fputs
(
$fp
,
'<dolibarr_script_dir version="'
.
$release
.
'">'
.
"
\n
"
);
$dir_iterator2
=
new
RecursiveDirectoryIterator
(
dirname
(
__FILE__
)
.
'/../scripts/'
);
$iterator2
=
new
RecursiveIteratorIterator
(
$dir_iterator2
);
// need to ignore document custom etc
$files
=
new
RegexIterator
(
$iterator2
,
'#^(?:[A-Z]:)?(?:/(?!(?:custom|documents|conf|install|nltechno))[^/]+)+/[^/]+\.(?:php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$#i'
);
$dir
=
''
;
$needtoclose
=
0
;
foreach
(
$files
as
$file
)
{
$newdir
=
str_replace
(
dirname
(
__FILE__
)
.
'/../scripts'
,
''
,
dirname
(
$file
));
if
(
$newdir
!=
$dir
)
{
if
(
$needtoclose
)
fputs
(
$fp
,
'</dir>'
.
"
\n
"
);
fputs
(
$fp
,
'<dir name="'
.
$newdir
.
'" >'
.
"
\n
"
);
$dir
=
$newdir
;
$needtoclose
=
1
;
}
if
(
filetype
(
$file
)
==
"file"
)
{
fputs
(
$fp
,
'<md5file name="'
.
basename
(
$file
)
.
'">'
.
md5_file
(
$file
)
.
'</md5file>'
.
"
\n
"
);
}
}
fputs
(
$fp
,
'</dir>'
.
"
\n
"
);
fputs
(
$fp
,
'</dolibarr_script_dir>'
.
"
\n
"
);
fputs
(
$fp
,
'</checksum_list>'
.
"
\n
"
);
fputs
(
$fp
,
'</checksum_list>'
.
"
\n
"
);
fclose
(
$fp
);
fclose
(
$fp
);
...
...
This diff is collapsed.
Click to expand it.
htdocs/admin/system/filecheck.php
+
72
−
46
View file @
4eedec02
...
@@ -31,6 +31,8 @@ $langs->load("admin");
...
@@ -31,6 +31,8 @@ $langs->load("admin");
if
(
!
$user
->
admin
)
if
(
!
$user
->
admin
)
accessforbidden
();
accessforbidden
();
$error
=
0
;
/*
/*
* View
* View
...
@@ -76,9 +78,11 @@ if (file_exists($xmlfile))
...
@@ -76,9 +78,11 @@ if (file_exists($xmlfile))
{
{
$xml
=
simplexml_load_file
(
$xmlfile
);
$xml
=
simplexml_load_file
(
$xmlfile
);
if
(
$xml
)
if
(
$xml
)
{
if
(
is_object
(
$xml
->
dolibarr_htdocs_dir
[
0
]))
{
{
$file_list
=
array
();
$file_list
=
array
();
$ret
=
getFilesUpdated
(
$file_list
,
$xml
->
dolibarr_
root
_dir
[
0
]);
// Fill array $file_list
$ret
=
getFilesUpdated
(
$file_list
,
$xml
->
dolibarr_
htdocs
_dir
[
0
]);
// Fill array $file_list
print
'<table class="noborder">'
;
print
'<table class="noborder">'
;
print
'<tr class="liste_titre">'
;
print
'<tr class="liste_titre">'
;
...
@@ -87,7 +91,7 @@ if (file_exists($xmlfile))
...
@@ -87,7 +91,7 @@ if (file_exists($xmlfile))
print
'</tr>'
.
"
\n
"
;
print
'</tr>'
.
"
\n
"
;
$var
=
true
;
$var
=
true
;
$tmpfilelist
=
dol_sort_array
(
$file_list
[
'missing'
],
'filename'
);
$tmpfilelist
=
dol_sort_array
(
$file_list
[
'missing'
],
'filename'
);
if
(
is_array
(
$tmpfilelist
))
if
(
is_array
(
$tmpfilelist
)
&&
count
(
$tmpfilelist
)
)
{
{
foreach
(
$tmpfilelist
as
$file
)
foreach
(
$tmpfilelist
as
$file
)
{
{
...
@@ -98,6 +102,10 @@ if (file_exists($xmlfile))
...
@@ -98,6 +102,10 @@ if (file_exists($xmlfile))
print
"</tr>
\n
"
;
print
"</tr>
\n
"
;
}
}
}
}
else
{
print
'<tr '
.
$bc
[
false
]
.
'><td colspan="2">'
.
$langs
->
trans
(
"None"
)
.
'</td></tr>'
;
}
print
'</table>'
;
print
'</table>'
;
print
'<br>'
;
print
'<br>'
;
...
@@ -112,7 +120,7 @@ if (file_exists($xmlfile))
...
@@ -112,7 +120,7 @@ if (file_exists($xmlfile))
print
'</tr>'
.
"
\n
"
;
print
'</tr>'
.
"
\n
"
;
$var
=
true
;
$var
=
true
;
$tmpfilelist
=
dol_sort_array
(
$file_list
[
'updated'
],
'filename'
);
$tmpfilelist
=
dol_sort_array
(
$file_list
[
'updated'
],
'filename'
);
if
(
is_array
(
$tmpfilelist
))
if
(
is_array
(
$tmpfilelist
)
&&
count
(
$tmpfilelist
)
)
{
{
foreach
(
$tmpfilelist
as
$file
)
foreach
(
$tmpfilelist
as
$file
)
{
{
...
@@ -126,18 +134,36 @@ if (file_exists($xmlfile))
...
@@ -126,18 +134,36 @@ if (file_exists($xmlfile))
print
"</tr>
\n
"
;
print
"</tr>
\n
"
;
}
}
}
}
else
{
print
'<tr '
.
$bc
[
false
]
.
'><td colspan="5">'
.
$langs
->
trans
(
"None"
)
.
'</td></tr>'
;
}
print
'</table>'
;
print
'</table>'
;
}
}
else
{
print
'Error: Failed to found dolibarr_htdocs_dir into XML file '
.
$xmlfile
;
$error
++
;
}
}
else
{
print
'Error: Failed to parse XML for input file '
.
$xmlfile
;
$error
++
;
}
}
}
else
else
{
{
print
$langs
->
trans
(
'XmlNotFound'
)
.
': '
.
$xmlfile
;
print
$langs
->
trans
(
'XmlNotFound'
)
.
': '
.
$xmlfile
;
$error
++
;
}
}
llxFooter
();
llxFooter
();
$db
->
close
();
$db
->
close
();
exit
(
$error
);
/**
/**
* Function to get list of updated or modified files.
* Function to get list of updated or modified files.
...
...
This diff is collapsed.
Click to expand it.
htdocs/install/filelist.xml
+
1265
−
1238
View file @
4eedec02
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment