The new OOP structure for version 2.7.0

Registered by Greg

The new version 2.7.0 introduces a new Object Oriented structure: the starting code is now inside an instance of the PHPDS class. Eventually all globals will disappear.

Blueprint information

Status:
Complete
Approver:
TitanKing
Priority:
Undefined
Drafter:
Greg
Direction:
Needs approval
Assignee:
Greg
Definition:
Approved
Series goal:
Proposed for trunk-3.x
Implementation:
Implemented
Milestone target:
None
Started by
Greg
Completed by
TitanKing

Related branches

Sprints

Whiteboard

The new structure is a follow:

- a main instance of PHPDS is at the center
- each core class are represented as fields of the main PHPDS instance
- a generic mecanism allows access to all authorized fields using my_...()

for example, a method of class core can access the template:

class core {
    ...

    function foo()
    {
         $tpl = $this->my_template();
    }
}

The scripts are executed inside the template scope, so $this is the template, and the other core objects can be fetched similarily:

$db = $this->my_db();

SOON NO GLOBALS WILL BE AVAILABLE ANYMORE

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.