|
dolibarr 25.0.0-alpha
|
Library of repair functions. More...
Go to the source code of this file.
Functions | |
| checkElementExist ($id, $table) | |
| Check if an element exist. | |
| checkLinkedElements ($sourcetype, $targettype) | |
| Check linked elements and delete if invalid. | |
| clean_data_ecm_directories () | |
| Clean data into ecm_directories table. | |
| repairEcmFiles ($db, $entity, $documentroot, $confirmed=false, $maxdelete=100) | |
| Check an entity's ECM index against the filesystem, optionally removing missing-file entries. | |
| repairImagePathIsSafe ($path, $directory, $documentroot) | |
| Check an image repair path, including a missing destination, against its owner's directory. | |
Library of repair functions.
Definition in file repair.lib.php.
| checkElementExist | ( | $id, | |
| $table ) |
Check if an element exist.
| int | $id | Element id |
| string | $table | Table of Element |
Definition at line 31 of file repair.lib.php.
References $id.
Referenced by checkLinkedElements().
| checkLinkedElements | ( | $sourcetype, | |
| $targettype ) |
Check linked elements and delete if invalid.
| string | $sourcetype | Source element type |
| string | $targettype | Target element type |
Definition at line 57 of file repair.lib.php.
References checkElementExist().
| clean_data_ecm_directories | ( | ) |
Clean data into ecm_directories table.
Definition at line 130 of file repair.lib.php.
References $id, and dol_sanitizeFileName().
| repairEcmFiles | ( | $db, | |
| $entity, | |||
| $documentroot, | |||
| $confirmed = false, | |||
| $maxdelete = 100 ) |
Check an entity's ECM index against the filesystem, optionally removing missing-file entries.
The caller must validate the entity and, for confirmed requests, the installer CSRF token.
| DoliDB | $db | Database handler |
| int | $entity | Entity to repair (without shared entities) |
| string | $documentroot | Global documents directory; ECM paths are already relative to it |
| bool | $confirmed | Remove missing-file index entries |
| int | $maxdelete | Maximum number of entries to remove |
Definition at line 171 of file repair.lib.php.
References dol_is_dir(), dol_is_file(), dol_is_link(), and dol_osencode().
| repairImagePathIsSafe | ( | $path, | |
| $directory, | |||
| $documentroot ) |
Check an image repair path, including a missing destination, against its owner's directory.
| string | $path | File or directory to read or write |
| string | $directory | Owner's module directory |
| string | $documentroot | Installation's documents directory |
Definition at line 275 of file repair.lib.php.
References dol_is_dir(), dol_osencode(), and dol_strlen().