validateTarStructure.php
Table of Contents
Functions
- validateTarStructure() : bool
- Validates the internal structure of a tar file.
Functions
validateTarStructure()
Validates the internal structure of a tar file.
validateTarStructure(string $filePath) : bool
This function checks whether the given file is a valid, readable tar archive.
It uses the PharData
class to attempt parsing the archive and iterates over
a few entries to confirm structural integrity.
Note: Compressed tar files (e.g., .tar.gz
, .tar.bz2
) are not supported directly.
Decompress them before using this function.
Parameters
- $filePath : string
-
Path to the tar file.
Tags
Return values
bool —True if the file has a valid tar structure, false otherwise.