|
dolibarr
13.0.2
|
Class to manage utility methods. More...
Public Member Functions | |
| __construct ($db) | |
| Constructor. More... | |
| purgeFiles ($choices= 'tempfilesold, logfile', $nbsecondsold=86400) | |
| Purge files into directory of data files. More... | |
| dumpDatabase ($compression= 'none', $type= 'auto', $usedefault=1, $file= 'auto', $keeplastnfiles=0, $execmethod=0) | |
| Make a backup of database CAN BE A CRON TASK. More... | |
| executeCLI ($command, $outputfile, $execmethod=0) | |
| Execute a CLI command. More... | |
| generateDoc ($module) | |
| Generate documentation of a Module. More... | |
| compressSyslogs () | |
| This saves syslog files and compresses older ones. More... | |
Class to manage utility methods.
Definition at line 28 of file utils.class.php.
| Utils::__construct | ( | $db | ) |
| Utils::compressSyslogs | ( | ) |
This saves syslog files and compresses older ones.
Nb of archive to keep is defined into $conf->global->SYSLOG_FILE_SAVES CAN BE A CRON TASK
Definition at line 774 of file utils.class.php.
References dol_delete_file(), dol_dir_list(), dol_filesize(), dol_include_once(), dol_is_file(), and dol_move().
| Utils::dumpDatabase | ( | $compression = 'none', |
|
$type = 'auto', |
|||
$usedefault = 1, |
|||
$file = 'auto', |
|||
$keeplastnfiles = 0, |
|||
$execmethod = 0 |
|||
| ) |
Make a backup of database CAN BE A CRON TASK.
| string | $compression | 'gz' or 'bz' or 'none' |
| string | $type | 'mysql', 'postgresql', ... |
| int | $usedefault | 1=Use default backup profile (Set this to 1 when used as cron) |
| string | $file | 'auto' or filename to build |
| int | $keeplastnfiles | Keep only last n files (not used yet) |
| int | $execmethod | 0=Use default method (that is 1 by default), 1=Use the PHP 'exec', 2=Use the 'popen' method |
Definition at line 197 of file utils.class.php.
References db, dol_delete_file(), dol_dir_list(), dol_mkdir(), dol_sanitizeFileName(), dol_syslog(), and GETPOST().
| Utils::executeCLI | ( | $command, | |
| $outputfile, | |||
$execmethod = 0 |
|||
| ) |
Execute a CLI command.
| string | $command | Command line to execute. |
| string | $outputfile | Output file (used only when method is 2). For exemple $conf->admin->dir_temp.'/out.tmp'; |
| int | $execmethod | 0=Use default method (that is 1 by default), 1=Use the PHP 'exec', 2=Use the 'popen' method |
Definition at line 512 of file utils.class.php.
References dol_syslog().
| Utils::generateDoc | ( | $module | ) |
Generate documentation of a Module.
| string | $module | Module name |
Definition at line 581 of file utils.class.php.
References db, dol_buildpath(), dol_copy(), dol_dir_list(), dol_include_once(), dol_is_dir(), dol_mkdir(), dol_now(), dol_print_date(), dol_print_error(), dolMd2Asciidoc(), and dolReplaceInFile().
| Utils::purgeFiles | ( | $choices = 'tempfilesold, |
|
| logfile' | , | ||
$nbsecondsold = 86400 |
|||
| ) |
Purge files into directory of data files.
CAN BE A CRON TASK
| string | $choices | Choice of purge mode ('tempfiles', '' or 'tempfilesold' to purge temp older than $nbsecondsold seconds, 'allfiles', 'logfile') |
| int | $nbsecondsold | Nb of seconds old to accept deletion of a directory if $choice is 'tempfilesold' |
Definition at line 57 of file utils.class.php.
References db, dol_delete_dir_recursive(), dol_delete_file(), dol_dir_list(), dol_mkdir(), dol_now(), and dol_syslog().