/** * Some of the functions need a file as a resource for various reasons (e.g. to check the mime type). * If the resource is some type of variable instead this function will create a temporary file. * * * @param string $fileName * @param string $data */ protected static function tempStore($fileName, $data) { $filePath = rtrim(sys_get_temp_dir(), '/') . '/PHP_Jig/Converter/' . session_id(); FsUtils::mkDir($filePath); file_put_contents($filePath . '/' . $fileName, $data); return $filePath . '/' . $fileName; }