drupal_realpath() function was originally written to ease porting of 6.x code to use 7.x stream wrappers. However, it assumes that every URI may be resolved to an absolute local filesystem path, and this assumption fails when stream wrappers are used to support remote file storage. Remote stream wrappers may implement the realpath() method by always returning FALSE. The use of
drupal_realpath() is therefore discouraged, and may even be deprecated.
The documentation for the
drupal_realpath() should be rewritten to
- Explain why it should generally not be used.
- Point to other functionality that should be used in most cases.
- Point to at least one legitimate use case.
User interface changes
An API change node should be written to explain that the use of
drupal_realpath() is now discouraged or deprecated.
Original report by Damien Tournoud
drupal_realpath() should generally not be used, as it is only meaningful on local filesystems (see for the full discussion). We should extend its documentation to make that fact clear.
PASSED: [[SimpleTest]]: [MySQL] 40,349 pass(es). View
PASSED: [[SimpleTest]]: [MySQL] 55,891 pass(es). View
PASSED: [[SimpleTest]]: [MySQL] 39,980 pass(es). View
PASSED: [[SimpleTest]]: [MySQL] 37,297 pass(es). View
PASSED: [[SimpleTest]]: [MySQL] 32,994 pass(es). View