| 1 | <?php |
||
| 9 | class LogHelper |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * Truncates a file to a given length but keep the end. |
||
| 13 | * Takes the filepointer, handle, and truncates the file to length, size. |
||
| 14 | * It will not just cut it but search for a newline so you avoid corrupting your csv or logfiles. |
||
| 15 | * @param string $filename |
||
| 16 | * @param $maxfilesize in byte |
||
| 17 | * @return bool |
||
| 18 | * @see http://php.net/manual/en/function.ftruncate.php#103591 |
||
| 19 | */ |
||
| 20 | public static function ftruncatestart(string $filename, $maxfilesize) : bool |
||
| 49 | } |
||
| 50 |