Replace uses of drupal_get_path() with __DIR__ where possible

Created on 7 October 2014, over 10 years ago
Updated 4 May 2025, 9 days ago

Problem/Motivation

Coming from #1308152-202: Add stream wrappers to access extension files there are many uses of drupal_get_path() in where the simple use of __DIR__ would have been sufficient and more performant.

Proposed resolution

Replace occurrences of drupal_get_path() with __DIR__ wherever the targeted file is known to share the same module directory with the calling code (and whose relative position will not change dynamically), and thus can be hard-coded.

Remaining tasks

Patch
Reviews (patch to review is #29)
Commit

User interface changes

None

API changes

None

📌 Task
Status

Fixed

Version

8.1 ⚰️

Component

extension system

Created by

🇳🇬Nigeria almaudoh

Live updates comments and jobs are added and updated live.
  • Needs backport to D7

    After being applied to the 8.x branch, it should be considered for backport to the 7.x branch. Note: This tag should generally remain even after the backport has been written, approved, and committed.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024