You are here

function resmushit_delete_temp_file in reSmush.it image style optimizer 7

Parameters

$temp_path: Delete temp file from the temporary directory.

1 call to resmushit_delete_temp_file()
resmushit_log in ./resmushit.inc

File

./resmushit.inc, line 54
Additional functions.

Code

function resmushit_delete_temp_file($temp_path) {
  $debug = FALSE;
  if (variable_get('resmushit_debug', 0) == 1) {
    $debug = TRUE;
  }
  $deleted = file_unmanaged_delete($temp_path);
  if ($debug) {
    $success = 'NO success!';
    if ($deleted) {
      $success = 'SUCCESS!';
    }

    // dpm('Deleting temporary file: ' . $temp_path);
    watchdog('reSmush.it', 'Deleting temporary file: %temp_path ... %success', array(
      '%temp_path' => $temp_path,
      '%success' => $success,
    ), WATCHDOG_INFO);
  }
}