Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-35628

Replace all dirname(__FILE__) with __DIR__

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.3.2, 3.0.2
    • 3.2
    • Performance

    Description

      Since PHP 5.3, a new magic constant _DIR_ has been introduced having the same value as dirname(_FILE_). If nothing, we would save one function call per each usage (thence putting all the mess on the stack etc) as discussed at http://stackoverflow.com/questions/2749416/is-there-any-difference-between-dir-and-dirname-file-in-php

      We should also replace all include instances that use the dirname(_DIR) pattern with __DIR_ . '../' pattern.

      Attachments

        Issue Links

          Activity

            People

              mr-russ Russell Smith
              mudrd8mz David Mudrák (@mudrd8mz)
              David Mudrák (@mudrd8mz) David Mudrák (@mudrd8mz)
              Dan Poltawski Dan Poltawski
              Marina Glancy Marina Glancy
              Matteo Scaramuccia, Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Stevani Andolo
              Votes:
              2 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                5/Dec/16