Issue Details (XML | Word | Printable)

Key: MDL-8325
Type: Task Task
Status: Open Open
Priority: Critical Critical
Assignee: Martin Dougiamas
Reporter: Eloy Lafuente (stronk7)
Votes: 0
Watchers: 2
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

Globals reorganization...

Created: 28/Jan/07 03:44 AM   Updated: 13/Aug/07 02:39 PM
Return to search
Component/s: Unknown
Affects Version/s: 1.9
Fix Version/s: 2.0

Environment: Any

Database: Any
Participants: Eloy Lafuente (stronk7), Jon Papaioannou and Martin Dougiamas
Security Level: None
Affected Branches: MOODLE_19_STABLE
Fixed Branches: MOODLE_20_STABLE


 Description  « Hide
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 :-)

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Jon Papaioannou added a comment - 25/Feb/07 09:43 AM
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.


Jon Papaioannou added a comment - 25/Feb/07 11:47 AM
Exploring the roles/capabilities system right now by trying to fix a bug. Came across another implied global...

has_capability() checks for $CONTEXT.