From: Jason S. <jsw...@ya...> - 2003-03-05 16:08:47
|
It is not nescesary. The only thing I keep in the $_SESSION is the error list. In my implementations I have not added it to the session. Here is an example PHP script from one of my implementations. There is some other neat stuff I have been waiting to see the next version of Phrame for to see if my changes are compatible, like the $controller->ShowView() method. <?php /** * depot inventory dashboard web site * * implemented using the MVC pattern, using Phrame * * @author Jason E. Sweat * @since 2003-02-13 * @package Depot * @version * <pre> * $Log: depot_inv.php,v $ * Revision 1.3 2003/02/13 19:09:39 sweatje * inital start at conversion to MVC framework * * </pre> * */ error_reporting(E_ALL); /** * common definitions for this applicaiton * * includes the mappings, options and errorHandler function from the phrame sample application */ require_once('depot_inv_setup.php'); //initialize error handler if (!array_key_exists(_ERRORS, $_SESSION)) { $go_errors = new Stack(); $_SESSION[_ERRORS] = $go_errors; } $go_controller = new DepotInvController($go_map->GetOptions()); if (array_key_exists(_ACTION, $_REQUEST)) { //release control to controller for further processing $go_controller->Process($go_map->GetMappings(), $_REQUEST); } else { //release control to controller for displaying a view $go_controller->ShowView(); exit; } //debugging code trigger_error('Action with no redirect?'); if (true) { print "<pre>"; var_dump($_SESSION); } ?> --- Tony Bibbs <to...@to...> wrote: > Is it really necessary to stick the controller in the session? I'm trying > to see the value in jamming a potentially large amount of stuff into a > session which, I think, unnecessarily hogs server resources. Is the > initialization overhead of the controller really that bad? Also, if it > is, why put it in each user's session? Why not make it a static variable? > > I hope someone responds to my earlier posts, I'm ready to start tweaking > things but would like some feedback first. > > -- > Tony Bibbs "I guess you have to remember that those who don't > to...@to... hunt or fish often see those of us who do as > harmlessly strange and sort of amusing. When you > think about it, that might be a fair assessment." > --Unknown > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: Etnus, makers of TotalView, The debugger > for complex code. Debugging C/C++ programs can leave you feeling lost and > disoriented. TotalView can help you find your way. Available on major UNIX > and Linux platforms. Try it free. www.etnus.com > _______________________________________________ > Phrame-devel mailing list > Phr...@li... > https://lists.sourceforge.net/lists/listinfo/phrame-devel __________________________________________________ Do you Yahoo!? Yahoo! Tax Center - forms, calculators, tips, more http://taxes.yahoo.com/ |