Project

General

Profile

Actions

Bug #54916

closed

Consolidate path methods into PathUtility

Added by Michiel Roos almost 11 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
Code Cleanup
Target version:
-
Start date:
2014-01-12
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
5.3
Tags:
Complexity:
medium
Is Regression:
No
Sprint Focus:
Remote Sprint

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.

Actions #1

Updated by Philipp Gampe almost 11 years ago

  • Category set to Code Cleanup
  • Status changed from New to Accepted
  • Assignee set to Michiel Roos

Make sure to validate every method if it can be used out of context.

Actions #2

Updated by Mathias Schreiber almost 10 years ago

Still cooking? :)

Actions #3

Updated by Anja Leichsenring almost 10 years ago

  • Sprint Focus set to On Location Sprint
Actions #4

Updated by Anja Leichsenring over 9 years ago

  • Sprint Focus changed from On Location Sprint to Remote Sprint
Actions #5

Updated by Mathias Schreiber about 9 years ago

  • Target version deleted (6.2.0)
Actions #6

Updated by Susanne Moog over 4 years ago

  • Status changed from Accepted to Closed

Closing as I don't think anyone is currently actively working on it and looking at the issue and the methods most of these are either
- legacy code which will break a lot of installations if removed / deprecated (GeneralUtility)
- context dependent different implementations (for example FAL vs. PathUtility)
- wrappers for each other (a lot of methods call Path/GeneralUtility in the end)

If you still want to spend time reworking this part, feel free to reopen the issue.

Actions

Also available in: Atom PDF