public function addFileToArchive($rootFolderPath, $localFilePath, $existingFileMode = self::EXISTING_FILES_OVERWRITE)
    {
        $this->addFileToArchiveWithCompressionMethod(
            $rootFolderPath,
            $localFilePath,
            $existingFileMode,
            \ZipArchive::CM_DEFAULT
        );
    }
public function addFileToArchive($rootFolderPath, $localFilePath, $existingFileMode = self::EXISTING_FILES_OVERWRITE)
    {
        $this->addFileToArchiveWithCompressionMethod(
            $rootFolderPath,
            $localFilePath,
            $existingFileMode,
            \ZipArchive::CM_DEFAULT
        );
    }
public function addFileToArchive ( $ rootFolderPath , $ localFilePath , $ existingFileMode = self :: EXISTING_FILES_OVERWRITE ) { $ this -> addFileToArchiveWithCompressionMethod ( $ rootFolderPath , $ localFilePath , $ existingFileMode , \ ZipArchive :: CM_DEFAULT ) ; }
Adds the given file, located under the given root folder to the archive.
The file will be compressed.

Example of use:
addFileToArchive('/tmp/xlsx/foo', 'bar/baz.xml');
=> will add the file located at '/tmp/xlsx/foo/bar/baz.xml' in the archive, but only as 'bar/baz.xml'

@param string $rootFolderPath Path of the root folder that will be ignored in the archive tree.
@param string $localFilePath Path of the file to be added, under the root folder
@param string|void $existingFileMode Controls what to do when trying to add an existing file
@return void
Adds the given file located under the given root folder to the archive . The file will be compressed .