Problem/Motivation

The pear/archive_tar package (and its transitive dependencies pear/pear-core-minimal and pear/console_getopt) are abandoned. pear/console_getopt was officially archived on GitHub and Packagist as of February 1, 2026.

Drupal core is already working on removing pear/archive_tar in favor of PHP's native PharData class (see #3571185 and #3027290).

The Webform module directly instantiates \Archive_Tar in four places:

  • src/Plugin/WebformExporterBase.php - addToTarArchive() method and $archive property type hint
  • modules/webform_devel/src/Form/WebformDevelEntityFormApiExportForm.php - tar.gz export in submitForm()
  • tests/src/Functional/WebformResultsExportDownloadTest.php - archive content verification
  • modules/webform_entity_print/tests/src/Functional/WebformEntityPrintFunctionalTest.php - archive content verification

These should be replaced with PHP's native PharData class to eliminate the dependency on abandoned PEAR packages.

Steps to reproduce

  1. Run composer why pear/console_getopt - shows the package is required transitively via pear/archive_tar.
  2. Search the webform codebase for \Archive_Tar - four files reference it directly.

Proposed resolution

Replace all \Archive_Tar usage with PHP's native PharData class:

  • WebformExporterBase::addToTarArchive(): Replace new \Archive_Tar($path, 'gz') with PharData. Use PharData::addFile(), PharData::addFromString(), and PharData::buildFromDirectory() for the add file/string/directory operations. Update the $archive property type hint from \Archive_Tar|\ZipArchive to \PharData|\ZipArchive.
  • WebformDevelEntityFormApiExportForm::submitForm(): Replace new \Archive_Tar($path, 'gz') and addString() calls with PharData equivalents.
  • WebformResultsExportDownloadTest and WebformEntityPrintFunctionalTest: Replace new \Archive_Tar($filepath, 'gz') and listContent() with PharData iteration to list archive entries.

Remaining tasks

  • Create a patch replacing \Archive_Tar with PharData in all four files.
  • Verify that PharData correctly handles .tar.gz creation, file addition, string addition, and directory addition with path modification.
  • Review and test.

User interface changes

None.

API changes

The protected $archive property type hint in WebformExporterBase changes from \Archive_Tar|\ZipArchive to \PharData|\ZipArchive. The addToTarArchive() method signature remains unchanged.

Data model changes

None.

Issue fork webform-3578701

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

eduardo morales alberti’s picture

Waiting for tests

eduardo morales alberti’s picture

Status: Active » Needs work

Pending to stabilize tests

eduardo morales alberti’s picture

Status: Needs work » Needs review

Ready to review

eduardo morales alberti’s picture

Ready to review