This commit is contained in:
2024-05-20 15:37:46 +03:00
commit 00b7dbd0b7
10404 changed files with 3285853 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
<?php
namespace WebpConverter\Conversion;
/**
* Excludes re-conversion of files that caused converting error.
*/
class CrashedFilesOperator {
const CRASHED_FILE_EXTENSION = 'crashed';
/**
* @param string $output_path .
*
* @return void
*/
public function create_crashed_file( string $output_path ) {
$file = fopen( $output_path . '.' . self::CRASHED_FILE_EXTENSION, 'w' );
if ( $file === false ) {
return;
}
fclose( $file );
}
/**
* @param string $output_path .
*
* @return void
*/
public function delete_crashed_file( string $output_path ) {
if ( ! file_exists( $output_path ) || ! file_exists( $output_path . '.' . self::CRASHED_FILE_EXTENSION ) ) {
return;
}
unlink( $output_path . '.' . self::CRASHED_FILE_EXTENSION );
}
}