Radicore Forum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » RADICORE development » Framework » Maintaining state (Is Radicore's use of saving state typical of all webapps?)
Re: Maintaining state [message #4940 is a reply to message #4937] Thu, 27 August 2015 06:08 Go to previous messageGo to previous message
AJM is currently offline  AJM
Messages: 2348
Registered: April 2006
Location: Surrey, UK
Senior Member
If you look at the initSession() function inside include.session.inc you will see that it looks for an entry in $_SESSION['pages'][$PHP_SELF]), and then extracts $_SESSION['pages'][$PHP_SELF][$task_id] into a global variable called $script_vars. The contents of $script_vars is then extracted into individual variables such as $where, $search, et cetera.

There is a separate copy of $script_vars for each script and this is is constructed BEFORE the script is called by the calling script. This means that if script "A" calls script "B" then $script_vars for "B" will be constructed by "A" using the scriptNext() function, and this will include any arguments that need to be passed from "A" to "B". When control is passed from "A" to "B" the $script_vars for "A" will remain in $_SESSION so that when control is returned to "A" it will be able to resume from where it left off. When "B" terminates the scriptPrevious() function will cause $script_vars for "B" to be dropped (unless the "Keep data" option on MNU_TASK is set), update the $script_vars for "A" with any values that need to be returned, then cause "A" to be reactivated. Script "A" will then be able to resume from where it left off, but now it will also have any values that were returned from script "B".


 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: pdf.styles.inc
Next Topic: Task ID/Script ID
Goto Forum:
  


Current Time: Sun May 05 13:31:28 EDT 2024

Total time taken to generate the page: 0.01027 seconds