Issue Bug Closed

#54916Consolidate path methods into PathUtility

Michiel Roos 01/12/14, 08:04 updated 03/16/20, 07:48

Description

There are many path related methods in the core that are named almost the same. Sometimes they are functionally identical and sometimes they are not. All path related methods should be moved to \TYPO3\CMS\Core\Utility\PathUtility and the other methods should be deprecated.

For getting an absolute path:
  • \TYPO3\CMS\Core\Resource\Driver\LocalDriver::getAbsolutePath()
  • \TYPO3\CMS\Extensionmanager\Utility\FileHandlingUtility::getAbsolutePath()
For getting a relative path:
  • \TYPO3\CMS\Backend\Module\ModuleLoader::getRelativePath()
  • \TYPO3\CMS\Core\Utility\PathUtility::getRelativePath()
  • \TYPO3\CMS\Extensionmanager\Utility\FileHandlingUtility::getRelativePath()
  • \TYPO3\CMS\Install\FolderStructure\AbstractNode::getRelativePathBelowSiteRoot()
For checking is something is an absolute path:
  • \TYPO3\CMS\Core\Utility\GeneralUtility::isAbsPath()
  • \TYPO3\CMS\Core\Utility\PathUtility::isAbsolutePath()

We can grep out a list of method declarations in the core (excluding Tests, contrib, etc.), and then check this list for any duplicate method implementations.

I’ll cook a patch for the path methods.

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.