/** * @param resource|string $data * @param string $path * @param string $relpath * @param callable $write_callback * @param string $content_type */ private static function _output($data, $path, $relpath, $write_callback, $content_type) { if (isset($data)) { CoreUtils::createUploadFolder($path); $write_callback($path, $data); } CoreUtils::fixPath("{$relpath}?t=" . filemtime($path)); header("Content-Type: image/{$content_type}"); readfile($path); exit; }