Details

    • Type: Task Task
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Won't Fix
    • Affects Version/s: 1.9
    • Fix Version/s: None
    • Component/s: Unknown
    • Labels:
    • Environment:
      Any
    • Database:
      Any
    • Affected Branches:
      MOODLE_19_STABLE
    • Rank:
      204

      Description

      For the target release, we need to re-organize GLOBALS used by Moodle a bit. If I'm not forgetting anything they are:

      • CFG
      • COURSE
      • USER
      • THEME

      The objective should be that every global should contain EXCLUSIVELY its own data, no data belonging to another variable. So all the user (session!) related info should go to USER and all the course related info should go to COURSE.

      This'll have at least two benefits:

      • Organization. Every variable in its place.
      • Caching. CFG can be cached globally (memcached..) and USER can be cached at session level. This are at least two less queries per page.

      Ciao

        Activity

        Hide
        Jon Papaioannou added a comment -

        A couple of other global-like things come to mind:

        1. $PAGE exists in some scenarios.

        2. $adminroot is "used as" a global, meaning that it's passed as a parameter in function calls. The one example of this I have seen is notice(). While this is not a global variable as such, it could very well be and should probably get the same treatment.

        Show
        Jon Papaioannou added a comment - A couple of other global-like things come to mind: 1. $PAGE exists in some scenarios. 2. $adminroot is "used as" a global, meaning that it's passed as a parameter in function calls. The one example of this I have seen is notice(). While this is not a global variable as such, it could very well be and should probably get the same treatment.
        Hide
        Jon Papaioannou added a comment -

        Exploring the roles/capabilities system right now by trying to fix a bug. Came across another implied global...

        has_capability() checks for $CONTEXT.

        Show
        Jon Papaioannou added a comment - Exploring the roles/capabilities system right now by trying to fix a bug. Came across another implied global... has_capability() checks for $CONTEXT.
        Hide
        Michael de Raadt added a comment -

        Thanks for reporting this issue.

        We have detected that this issue has been inactive for over a year. It was reported as affecting versions that are no longer supported.

        If you believe that this issue is still relevant to current versions (2.5 and beyond), please comment on the issue. Issues left inactive for a further month will be closed.

        Michael d.

        TW9vZGxlDQo=

        Show
        Michael de Raadt added a comment - Thanks for reporting this issue. We have detected that this issue has been inactive for over a year. It was reported as affecting versions that are no longer supported. If you believe that this issue is still relevant to current versions (2.5 and beyond), please comment on the issue. Issues left inactive for a further month will be closed. Michael d. TW9vZGxlDQo=
        Hide
        Michael de Raadt added a comment -

        I'm closing this issue as it has been inactive for over a year has been recorded as affecting versions that are no longer supported.

        This is being done as part of a bulk annual clean-up of issues.

        If you still believe this is an issue in supported versions, please create a new issue.

        Show
        Michael de Raadt added a comment - I'm closing this issue as it has been inactive for over a year has been recorded as affecting versions that are no longer supported. This is being done as part of a bulk annual clean-up of issues. If you still believe this is an issue in supported versions, please create a new issue.

          People

          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: