dolibarr  13.0.2
filecheck.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2005-2020 Laurent Destailleur <eldy@users.sourceforge.net>
3  * Copyright (C) 2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
4  * Copyright (C) 2007-2012 Regis Houssin <regis.houssin@inodbox.com>
5  * Copyright (C) 2015-2019 Frederic France <frederic.france@netlogic.fr>
6  * Copyright (C) 2017 Nicolas ZABOURI <info@inovea-conseil.com>
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <https://www.gnu.org/licenses/>.
20  */
21 
27 require '../../main.inc.php';
28 require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
29 require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php';
30 
31 $langs->load("admin");
32 
33 if (!$user->admin)
35 
36 $error = 0;
37 
38 
39 /*
40  * View
41  */
42 
43 @set_time_limit(300);
44 
45 llxHeader();
46 
47 print load_fiche_titre($langs->trans("FileCheckDolibarr"), '', 'title_setup');
48 
49 print '<span class="opacitymedium">'.$langs->trans("FileCheckDesc").'</span><br><br>';
50 
51 // Version
52 print '<div class="div-table-responsive-no-min">';
53 print '<table class="noborder centpercent">';
54 print '<tr class="liste_titre"><td>'.$langs->trans("Version").'</td><td>'.$langs->trans("Value").'</td></tr>'."\n";
55 print '<tr class="oddeven"><td width="300">'.$langs->trans("VersionLastInstall").'</td><td>'.$conf->global->MAIN_VERSION_LAST_INSTALL.'</td></tr>'."\n";
56 print '<tr class="oddeven"><td width="300">'.$langs->trans("VersionLastUpgrade").'</td><td>'.$conf->global->MAIN_VERSION_LAST_UPGRADE.'</td></tr>'."\n";
57 print '<tr class="oddeven"><td width="300">'.$langs->trans("VersionProgram").'</td><td>'.DOL_VERSION;
58 // If current version differs from last upgrade
59 if (empty($conf->global->MAIN_VERSION_LAST_UPGRADE)) {
60  // Compare version with last install database version (upgrades never occured)
61  if (DOL_VERSION != $conf->global->MAIN_VERSION_LAST_INSTALL)
62  print ' '.img_warning($langs->trans("RunningUpdateProcessMayBeRequired", DOL_VERSION, $conf->global->MAIN_VERSION_LAST_INSTALL));
63 } else {
64  // Compare version with last upgrade database version
65  if (DOL_VERSION != $conf->global->MAIN_VERSION_LAST_UPGRADE)
66  print ' '.img_warning($langs->trans("RunningUpdateProcessMayBeRequired", DOL_VERSION, $conf->global->MAIN_VERSION_LAST_UPGRADE));
67 }
68 print '</td></tr>'."\n";
69 print '</table>';
70 print '</div>';
71 print '<br>';
72 
73 
74 // Modified or missing files
75 $file_list = array('missing' => array(), 'updated' => array());
76 
77 // Local file to compare to
78 $xmlshortfile = GETPOST('xmlshortfile', 'alpha') ?GETPOST('xmlshortfile', 'alpha') : '/install/filelist-'.DOL_VERSION.(empty($conf->global->MAIN_FILECHECK_LOCAL_SUFFIX) ? '' : $conf->global->MAIN_FILECHECK_LOCAL_SUFFIX).'.xml'.(empty($conf->global->MAIN_FILECHECK_LOCAL_EXT) ? '' : $conf->global->MAIN_FILECHECK_LOCAL_EXT);
79 $xmlfile = DOL_DOCUMENT_ROOT.$xmlshortfile;
80 // Remote file to compare to
81 $xmlremote = GETPOST('xmlremote');
82 if (empty($xmlremote) && !empty($conf->global->MAIN_FILECHECK_URL)) $xmlremote = $conf->global->MAIN_FILECHECK_URL;
83 $param = 'MAIN_FILECHECK_URL_'.DOL_VERSION;
84 if (empty($xmlremote) && !empty($conf->global->$param)) $xmlremote = $conf->global->$param;
85 if (empty($xmlremote)) $xmlremote = 'https://www.dolibarr.org/files/stable/signatures/filelist-'.DOL_VERSION.'.xml';
86 
87 
88 // Test if remote test is ok
89 $enableremotecheck = true;
90 if (preg_match('/beta|alpha|rc/i', DOL_VERSION) || !empty($conf->global->MAIN_ALLOW_INTEGRITY_CHECK_ON_UNSTABLE)) $enableremotecheck = false;
91 $enableremotecheck = true;
92 
93 print '<form name="check" action="'.$_SERVER["PHP_SELF"].'">';
94 print '<input type="hidden" name="token" value="'.newToken().'">';
95 print $langs->trans("MakeIntegrityAnalysisFrom").':<br>';
96 print '<!-- for a local check target=local&xmlshortfile=... -->'."\n";
97 if (dol_is_file($xmlfile))
98 {
99  print '<input type="radio" name="target" value="local"'.((!GETPOST('target') || GETPOST('target') == 'local') ? 'checked="checked"' : '').'"> '.$langs->trans("LocalSignature").' = ';
100  print '<input name="xmlshortfile" class="flat minwidth400" value="'.dol_escape_htmltag($xmlshortfile).'">';
101  print '<br>';
102 } else {
103  print '<input type="radio" name="target" value="local"> '.$langs->trans("LocalSignature").' = ';
104  print '<input name="xmlshortfile" class="flat minwidth400" value="'.dol_escape_htmltag($xmlshortfile).'">';
105  print ' <span class="warning">('.$langs->trans("AvailableOnlyOnPackagedVersions").')</span>';
106  print '<br>';
107 }
108 print '<!-- for a remote target=remote&xmlremote=... -->'."\n";
109 if ($enableremotecheck)
110 {
111  print '<input type="radio" name="target" value="remote"'.(GETPOST('target') == 'remote' ? 'checked="checked"' : '').'> '.$langs->trans("RemoteSignature").' = ';
112  print '<input name="xmlremote" class="flat minwidth400" value="'.dol_escape_htmltag($xmlremote).'"><br>';
113 } else {
114  print '<input type="radio" name="target" value="remote" disabled="disabled"> '.$langs->trans("RemoteSignature").' = '.$xmlremote;
115  if (!GETPOST('xmlremote')) print ' <span class="warning">('.$langs->trans("FeatureAvailableOnlyOnStable").')</span>';
116  print '<br>';
117 }
118 print '<br><div class="center"><input type="submit" name="check" class="button" value="'.$langs->trans("Check").'"></div>';
119 print '</form>';
120 print '<br>';
121 print '<br>';
122 
123 if (GETPOST('target') == 'local')
124 {
125  if (dol_is_file($xmlfile))
126  {
127  // If file is a zip file (.../filelist-x.y.z.xml.zip), we uncompress it before
128  if (preg_match('/\.zip$/i', $xmlfile)) {
129  dol_mkdir($conf->admin->dir_temp);
130  $xmlfilenew = preg_replace('/\.zip$/i', '', $xmlfile);
131  $result = dol_uncompress($xmlfile, $conf->admin->dir_temp);
132  if (empty($result['error'])) {
133  $xmlfile = $conf->admin->dir_temp.'/'.basename($xmlfilenew);
134  } else {
135  print $langs->trans('FailedToUncompressFile').': '.$xmlfile;
136  $error++;
137  }
138  }
139  $xml = simplexml_load_file($xmlfile);
140  } else {
141  print $langs->trans('XmlNotFound').': '.$xmlfile;
142  $error++;
143  }
144 }
145 if (GETPOST('target') == 'remote')
146 {
147  $xmlarray = getURLContent($xmlremote);
148 
149  // Return array('content'=>response,'curl_error_no'=>errno,'curl_error_msg'=>errmsg...)
150  if (!$xmlarray['curl_error_no'] && $xmlarray['http_code'] != '400' && $xmlarray['http_code'] != '404')
151  {
152  $xmlfile = $xmlarray['content'];
153  //print "xmlfilestart".$xmlfile."xmlfileend";
154  $xml = simplexml_load_string($xmlfile);
155  } else {
156  $errormsg = $langs->trans('XmlNotFound').': '.$xmlremote.' - '.$xmlarray['http_code'].' '.$xmlarray['curl_error_no'].' '.$xmlarray['curl_error_msg'];
157  setEventMessages($errormsg, null, 'errors');
158  $error++;
159  }
160 }
161 
162 
163 if (!$error && $xml)
164 {
165  $checksumconcat = array();
166  $file_list = array();
167  $out = '';
168 
169  // Forced constants
170  if (is_object($xml->dolibarr_constants[0]))
171  {
172  $out .= load_fiche_titre($langs->trans("ForcedConstants"));
173 
174  $out .= '<div class="div-table-responsive-no-min">';
175  $out .= '<table class="noborder">';
176  $out .= '<tr class="liste_titre">';
177  $out .= '<td>#</td>';
178  $out .= '<td>'.$langs->trans("Constant").'</td>';
179  $out .= '<td class="center">'.$langs->trans("ExpectedValue").'</td>';
180  $out .= '<td class="center">'.$langs->trans("Value").'</td>';
181  $out .= '</tr>'."\n";
182 
183  $i = 0;
184  foreach ($xml->dolibarr_constants[0]->constant as $constant) // $constant is a simpleXMLElement
185  {
186  $constname = $constant['name'];
187  $constvalue = (string) $constant;
188  $constvalue = (empty($constvalue) ? '0' : $constvalue);
189  // Value found
190  $value = '';
191  if ($constname && $conf->global->$constname != '') $value = $conf->global->$constname;
192  $valueforchecksum = (empty($value) ? '0' : $value);
193 
194  $checksumconcat[] = $valueforchecksum;
195 
196  $i++;
197  $out .= '<tr class="oddeven">';
198  $out .= '<td>'.$i.'</td>'."\n";
199  $out .= '<td>'.dol_escape_htmltag($constname).'</td>'."\n";
200  $out .= '<td class="center">'.dol_escape_htmltag($constvalue).'</td>'."\n";
201  $out .= '<td class="center">'.dol_escape_htmltag($valueforchecksum).'</td>'."\n";
202  $out .= "</tr>\n";
203  }
204 
205  if ($i == 0)
206  {
207  $out .= '<tr class="oddeven"><td colspan="4" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
208  }
209  $out .= '</table>';
210  $out .= '</div>';
211 
212  $out .= '<br>';
213  }
214 
215  // Scan htdocs
216  if (is_object($xml->dolibarr_htdocs_dir[0]))
217  {
218  //var_dump($xml->dolibarr_htdocs_dir[0]['includecustom']);exit;
219  $includecustom = (empty($xml->dolibarr_htdocs_dir[0]['includecustom']) ? 0 : $xml->dolibarr_htdocs_dir[0]['includecustom']);
220 
221  // Defined qualified files (must be same than into generate_filelist_xml.php)
222  $regextoinclude = '\.(php|php3|php4|php5|phtml|phps|phar|inc|css|scss|html|xml|js|json|tpl|jpg|jpeg|png|gif|ico|sql|lang|txt|yml|md|mp3|mp4|wav|mkv|z|gz|zip|rar|tar|less|svg|eot|woff|woff2|ttf|manifest)$';
223  $regextoexclude = '('.($includecustom ? '' : 'custom|').'documents|conf|install|public\/test|Shared\/PCLZip|nusoap\/lib\/Mail|php\/example|php\/test|geoip\/sample.*\.php|ckeditor\/samples|ckeditor\/adapters)$'; // Exclude dirs
224  $scanfiles = dol_dir_list(DOL_DOCUMENT_ROOT, 'files', 1, $regextoinclude, $regextoexclude);
225 
226  // Fill file_list with files in signature, new files, modified files
227  $ret = getFilesUpdated($file_list, $xml->dolibarr_htdocs_dir[0], '', DOL_DOCUMENT_ROOT, $checksumconcat); // Fill array $file_list
228  // Complete with list of new files
229  foreach ($scanfiles as $keyfile => $valfile)
230  {
231  $tmprelativefilename = preg_replace('/^'.preg_quote(DOL_DOCUMENT_ROOT, '/').'/', '', $valfile['fullname']);
232  if (!in_array($tmprelativefilename, $file_list['insignature']))
233  {
234  $md5newfile = @md5_file($valfile['fullname']); // Can fails if we don't have permission to open/read file
235  $file_list['added'][] = array('filename'=>$tmprelativefilename, 'md5'=>$md5newfile);
236  }
237  }
238 
239  // Files missings
240  $out .= load_fiche_titre($langs->trans("FilesMissing"));
241 
242  $out .= '<div class="div-table-responsive-no-min">';
243  $out .= '<table class="noborder">';
244  $out .= '<tr class="liste_titre">';
245  $out .= '<td>#</td>';
246  $out .= '<td>'.$langs->trans("Filename").'</td>';
247  $out .= '<td class="right">'.$langs->trans("ExpectedSize").'</td>';
248  $out .= '<td class="center">'.$langs->trans("ExpectedChecksum").'</td>';
249  $out .= '</tr>'."\n";
250  $tmpfilelist = dol_sort_array($file_list['missing'], 'filename');
251  if (is_array($tmpfilelist) && count($tmpfilelist))
252  {
253  $i = 0;
254  foreach ($tmpfilelist as $file)
255  {
256  $i++;
257  $out .= '<tr class="oddeven">';
258  $out .= '<td>'.$i.'</td>'."\n";
259  $out .= '<td>'.dol_escape_htmltag($file['filename']).'</td>'."\n";
260  $out .= '<td class="right">';
261  if (!empty($file['expectedsize'])) $out .= dol_print_size($file['expectedsize']);
262  $out .= '</td>'."\n";
263  $out .= '<td class="center">'.dol_escape_htmltag($file['expectedmd5']).'</td>'."\n";
264  $out .= "</tr>\n";
265  }
266  } else {
267  $out .= '<tr class="oddeven"><td colspan="4" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
268  }
269  $out .= '</table>';
270  $out .= '</div>';
271 
272  $out .= '<br>';
273 
274  // Files modified
275  $out .= load_fiche_titre($langs->trans("FilesModified"));
276 
277  $totalsize = 0;
278  $out .= '<div class="div-table-responsive-no-min">';
279  $out .= '<table class="noborder">';
280  $out .= '<tr class="liste_titre">';
281  $out .= '<td>#</td>';
282  $out .= '<td>'.$langs->trans("Filename").'</td>';
283  $out .= '<td class="center">'.$langs->trans("ExpectedChecksum").'</td>';
284  $out .= '<td class="center">'.$langs->trans("CurrentChecksum").'</td>';
285  $out .= '<td class="right">'.$langs->trans("ExpectedSize").'</td>';
286  $out .= '<td class="right">'.$langs->trans("CurrentSize").'</td>';
287  $out .= '<td class="right">'.$langs->trans("DateModification").'</td>';
288  $out .= '</tr>'."\n";
289  $tmpfilelist2 = dol_sort_array($file_list['updated'], 'filename');
290  if (is_array($tmpfilelist2) && count($tmpfilelist2))
291  {
292  $i = 0;
293  foreach ($tmpfilelist2 as $file)
294  {
295  $i++;
296  $out .= '<tr class="oddeven">';
297  $out .= '<td>'.$i.'</td>'."\n";
298  $out .= '<td>'.dol_escape_htmltag($file['filename']).'</td>'."\n";
299  $out .= '<td class="center">'.dol_escape_htmltag($file['expectedmd5']).'</td>'."\n";
300  $out .= '<td class="center">'.dol_escape_htmltag($file['md5']).'</td>'."\n";
301  $out .= '<td class="right">';
302  if ($file['expectedsize']) $out .= dol_print_size($file['expectedsize']);
303  $out .= '</td>'."\n";
304  $size = dol_filesize(DOL_DOCUMENT_ROOT.'/'.$file['filename']);
305  $totalsize += $size;
306  $out .= '<td class="right">'.dol_print_size($size).'</td>'."\n";
307  $out .= '<td class="right">'.dol_print_date(dol_filemtime(DOL_DOCUMENT_ROOT.'/'.$file['filename']), 'dayhour').'</td>'."\n";
308  $out .= "</tr>\n";
309  }
310  $out .= '<tr class="liste_total">';
311  $out .= '<td></td>'."\n";
312  $out .= '<td>'.$langs->trans("Total").'</td>'."\n";
313  $out .= '<td class="center"></td>'."\n";
314  $out .= '<td class="center"></td>'."\n";
315  $out .= '<td class="center"></td>'."\n";
316  $out .= '<td class="right">'.dol_print_size($totalsize).'</td>'."\n";
317  $out .= '<td class="right"></td>'."\n";
318  $out .= "</tr>\n";
319  } else {
320  $out .= '<tr class="oddeven"><td colspan="7" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
321  }
322  $out .= '</table>';
323  $out .= '</div>';
324 
325  $out .= '<br>';
326 
327  // Files added
328  $out .= load_fiche_titre($langs->trans("FilesAdded"));
329 
330  $totalsize = 0;
331  $out .= '<div class="div-table-responsive-no-min">';
332  $out .= '<table class="noborder">';
333  $out .= '<tr class="liste_titre">';
334  $out .= '<td>#</td>';
335  $out .= '<td>'.$langs->trans("Filename").'</td>';
336  $out .= '<td class="center">'.$langs->trans("ExpectedChecksum").'</td>';
337  $out .= '<td class="center">'.$langs->trans("CurrentChecksum").'</td>';
338  $out .= '<td class="right">'.$langs->trans("Size").'</td>';
339  $out .= '<td class="right">'.$langs->trans("DateModification").'</td>';
340  $out .= '</tr>'."\n";
341  $tmpfilelist3 = dol_sort_array($file_list['added'], 'filename');
342  if (is_array($tmpfilelist3) && count($tmpfilelist3))
343  {
344  $i = 0;
345  foreach ($tmpfilelist3 as $file)
346  {
347  $i++;
348  $out .= '<tr class="oddeven">';
349  $out .= '<td>'.$i.'</td>'."\n";
350  $out .= '<td>'.dol_escape_htmltag($file['filename']);
351  if (!preg_match('/^win/i', PHP_OS)) {
352  $htmltext = $langs->trans("YouCanDeleteFileOnServerWith", 'rm '.DOL_DOCUMENT_ROOT.$file['filename']); // The slash is included int file['filename']
353  $out .= ' '.$form->textwithpicto('', $htmltext, 1, 'help', '', 0, 2, 'helprm'.$i);
354  }
355  $out .= '</td>'."\n";
356  $out .= '<td class="center">'.dol_escape_htmltag($file['expectedmd5']).'</td>'."\n";
357  $out .= '<td class="center">'.dol_escape_htmltag($file['md5']).'</td>'."\n";
358  $size = dol_filesize(DOL_DOCUMENT_ROOT.'/'.$file['filename']);
359  $totalsize += $size;
360  $out .= '<td class="right">'.dol_print_size($size).'</td>'."\n";
361  $out .= '<td class="right">'.dol_print_date(dol_filemtime(DOL_DOCUMENT_ROOT.'/'.$file['filename']), 'dayhour').'</td>'."\n";
362  $out .= "</tr>\n";
363  }
364  $out .= '<tr class="liste_total">';
365  $out .= '<td></td>'."\n";
366  $out .= '<td>'.$langs->trans("Total").'</td>'."\n";
367  $out .= '<td class="center"></td>'."\n";
368  $out .= '<td class="center"></td>'."\n";
369  $out .= '<td class="right">'.dol_print_size($totalsize).'</td>'."\n";
370  $out .= '<td class="right"></td>'."\n";
371  $out .= "</tr>\n";
372  } else {
373  $out .= '<tr class="oddeven"><td colspan="6" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
374  }
375  $out .= '</table>';
376  $out .= '</div>';
377  } else {
378  print 'Error: Failed to found dolibarr_htdocs_dir into XML file '.$xmlfile;
379  $error++;
380  }
381 
382 
383  // Scan scripts
384  /*
385  if (is_object($xml->dolibarr_script_dir[0]))
386  {
387  $file_list = array();
388  $ret = getFilesUpdated($file_list, $xml->dolibarr_htdocs_dir[0], '', ???, $checksumconcat); // Fill array $file_list
389  }*/
390 
391 
392  asort($checksumconcat); // Sort list of checksum
393  //var_dump($checksumconcat);
394  $checksumget = md5(join(',', $checksumconcat));
395  $checksumtoget = trim((string) $xml->dolibarr_htdocs_dir_checksum);
396 
397  /*var_dump(count($file_list['added']));
398  var_dump($checksumget);
399  var_dump($checksumtoget);
400  var_dump($checksumget == $checksumtoget);*/
401 
402  $resultcomment = '';
403 
404  $outexpectedchecksum = ($checksumtoget ? $checksumtoget : $langs->trans("Unknown"));
405  if ($checksumget == $checksumtoget)
406  {
407  if (count($file_list['added']))
408  {
409  $resultcode = 'warning';
410  $resultcomment = 'FileIntegrityIsOkButFilesWereAdded';
411  $outcurrentchecksum = $checksumget.' - <span class="'.$resultcode.'">'.$langs->trans($resultcomment).'</span>';
412  } else {
413  $resultcode = 'ok';
414  $resultcomment = 'Success';
415  $outcurrentchecksum = '<span class="'.$resultcode.'">'.$checksumget.'</span>';
416  }
417  } else {
418  $resultcode = 'error';
419  $resultcomment = 'Error';
420  $outcurrentchecksum = '<span class="'.$resultcode.'">'.$checksumget.'</span>';
421  }
422 
423  // Show warning
424  if (empty($tmpfilelist) && empty($tmpfilelist2) && empty($tmpfilelist3) && $resultcode == 'ok') {
425  setEventMessages($langs->trans("FileIntegrityIsStrictlyConformedWithReference"), null, 'mesgs');
426  } else {
427  if ($resultcode == 'warning') {
428  setEventMessages($langs->trans($resultcomment), null, 'warnings');
429  } else {
430  setEventMessages($langs->trans("FileIntegritySomeFilesWereRemovedOrModified"), null, 'errors');
431  }
432  }
433 
434  print load_fiche_titre($langs->trans("GlobalChecksum"));
435  print $langs->trans("ExpectedChecksum").' = '.$outexpectedchecksum.'<br>';
436  print $langs->trans("CurrentChecksum").' = '.$outcurrentchecksum;
437 
438  print '<br>';
439  print '<br>';
440 
441  // Output detail
442  print $out;
443 }
444 
445 // End of page
446 llxFooter();
447 $db->close();
448 
449 exit($error);
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
getFilesUpdated(&$file_list, SimpleXMLElement $dir, $path= '', $pathref= '', &$checksumconcat=array())
Function to get list of updated or modified files.
Definition: files.lib.php:2977
dol_filesize($pathoffile)
Return size of a file.
Definition: files.lib.php:555
getURLContent($url, $postorget= 'GET', $param= '', $followlocation=1, $addheaders=array(), $allowedschemes=array('http', 'https'), $localurl=0)
Function to get a content from an URL (use proxy if proxy defined).
Definition: geturl.lib.php:38
llxHeader()
Empty header.
Definition: wrapper.php:45
setEventMessages($mesg, $mesgs, $style= 'mesgs', $messagekey= '')
Set event messages in dol_events session object.
load_fiche_titre($titre, $morehtmlright= '', $picto= 'generic', $pictoisfullpath=0, $id= '', $morecssontable= '', $morehtmlcenter= '')
Load a title with picto.
accessforbidden($message= '', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefilter=null, $sortcriteria="name", $sortorder=SORT_ASC, $mode=0, $nohook=0, $relativename="", $donotfollowsymlinks=0)
Scan a directory and return a list of files/directories.
Definition: files.lib.php:60
dol_is_file($pathoffile)
Return if path is a file.
Definition: files.lib.php:457
dol_sort_array(&$array, $index, $order= 'asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by second index function, which produces ascending (default) or descending output...
dol_uncompress($inputfile, $outputdir)
Uncompress a file.
Definition: files.lib.php:2033
print
Draft customers invoices.
Definition: index.php:89
dol_print_size($size, $shortvalue=0, $shortunit=0)
Return string with formated size.
dol_filemtime($pathoffile)
Return time of a file.
Definition: files.lib.php:567
llxFooter()
Empty footer.
Definition: wrapper.php:59
dol_mkdir($dir, $dataroot= '', $newmask=null)
Creation of a directory (this can create recursive subdir)