Amazon_S3_And_CloudFront::does_file_exist_local PHP Method

does_file_exist_local() public method

Does file exist local
public does_file_exist_local ( string $filename, string $time ) : boolean
$filename string
$time string
return boolean
    function does_file_exist_local($filename, $time)
    {
        global $wpdb;
        $path = wp_upload_dir($time);
        $path = ltrim($path['subdir'], '/');
        if ('' !== $path) {
            $path = trailingslashit($path);
        }
        $file = $path . $filename;
        $sql = $wpdb->prepare("\n\t\t\tSELECT COUNT(*)\n\t\t\tFROM {$wpdb->postmeta}\n\t\t\tWHERE meta_key = %s\n\t\t\tAND meta_value = %s\n\t\t", '_wp_attached_file', $file);
        return (bool) $wpdb->get_var($sql);
    }
Amazon_S3_And_CloudFront