You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(31) |
Feb
(4) |
Mar
(39) |
Apr
(4) |
May
(36) |
Jun
(6) |
Jul
(11) |
Aug
(6) |
Sep
(9) |
Oct
(8) |
Nov
(4) |
Dec
(1) |
2004 |
Jan
(11) |
Feb
|
Mar
(1) |
Apr
(8) |
May
(2) |
Jun
|
Jul
|
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
From: Jason S. <jsw...@ya...> - 2003-05-22 16:00:41
|
--- Alex <ale...@ya...> wrote: > Hi Jason, I seems almost like you are passing request / session state (data) > there. If that is indeed the case, then you'd best put the id in the > request/session and retrieve it again in the edit action/template. Adding it to the forward path _IS_ adding it to the request (for the next page view), right? In this case, I do not want to have it be a session variable for a couple of reasons: 1) if they want to bookmark editing a particular item, they can go back directly 2) if they use their history for navigation, they can return to editing a previous item If I adopted use of the session, they would be forced to alway go back through the overall item navigation to get to the particular item they want to edit. Any holes in that logic? Jason P.S. I just received word that my second MVC article for PHP|A will be the sample article for the June issue, so it will be available for everyone to read! __________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. http://search.yahoo.com |
From: Alex <ale...@ya...> - 2003-05-22 12:33:24
|
Hi Jason, I seems almost like you are passing request / session state (data) there. If that is indeed the case, then you'd best put the id in the request/session and retrieve it again in the edit action/template. For this thing, I myself added the HttpRequestServletand HttpSession classes. (see previous messages for url)This, to me, sounds a bit like request state. You would use the php $SESSION for this in the phrame 2.0 release, if I remember correctly. I could be wrong of course, seeing as though I haven't seen your exact situation. Just my 2cts. If you do find that you use it often, then indeed: we'd best add a function for it now! :o) Perhaps if somebody fired up their text-editor/zip/repackage/upload tool to add this, perhaps also fix the way actions are included and fix the phrame.php -> index.php http-redirecting...We'd have a valuable (and backwards compatible) update for the phrame 2.0 package! Kind regards, Alex Jason Sweat <jsw...@ya...> wrote:At the end for my Action::Perform methods, I seem to often have code that looks like this: $o_forward =& $poActionMapping->Get('edit'); $o_forward->SetPath($o_forward->GetPath().'&id='.$i_id); return $o_forward; An example of this might be a user selecting a particular item to edit from a list. You would have a view for "edititem" but you typically have to pass which item via a URL parameter. Would it make sense to add an ActionForward::AppendPath method so these could just be written: $o_forward->AppendPath('&id='.$i_id); It could easily be written as: function AppendPath($add_path) { $this->_path += $add_path; } Thoughts? Jason __________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. http://search.yahoo.com ------------------------------------------------------- This SF.net email is sponsored by: ObjectStore. If flattening out C++ or Java code to make your application fit in a relational database is painful, don't do it! Check out ObjectStore. Now part of Progress Software. http://www.objectstore.net/sourceforge _______________________________________________ Phrame-devel mailing list Phr...@li... https://lists.sourceforge.net/lists/listinfo/phrame-devel --------------------------------- Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. |
From: Jason S. <jsw...@ya...> - 2003-05-21 17:59:56
|
At the end for my Action::Perform methods, I seem to often have code that looks like this: $o_forward =& $poActionMapping->Get('edit'); $o_forward->SetPath($o_forward->GetPath().'&id='.$i_id); return $o_forward; An example of this might be a user selecting a particular item to edit from a list. You would have a view for "edititem" but you typically have to pass which item via a URL parameter. Would it make sense to add an ActionForward::AppendPath method so these could just be written: $o_forward->AppendPath('&id='.$i_id); It could easily be written as: function AppendPath($add_path) { $this->_path += $add_path; } Thoughts? Jason __________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. http://search.yahoo.com |
From: Jason S. <jsw...@ya...> - 2003-05-20 16:26:43
|
--- Mike Carter <mi...@bu...> wrote: > Basically, for each module should it be in its own directory with its > own set of action, models etc. folders? Or should all modules share the > same single set of folders? I have not developed anything yet that got out of hand with the app/models app/actions app/views type structure, but I also have not been architecting the apps with plugin in mind. I think what I might be inclined to do at that point is make sure my class naming convention clearly identified classes as models, actions, forms, views, etc. and instead use: app/mods/mod1/*.php app/mods/mod2/*.php ... Phrame itself (2.0 version) would not care about this structure, but I would have to modify my "auto-include" for actions and forms to accomadate the multiple variable include paths. HTH __________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. http://search.yahoo.com |
From: Mike C. <mi...@bu...> - 2003-05-19 22:22:02
|
Hi, This isn=92t strictly a technical question but I was wondering what the preferred/common method of structuring MVC based web applications was. If a system was made up of a number of distinct modules which were all accessed through an interface which required a single authentication login - how should they be organised in the directory structure? Erm, maybe that sounded a bit confusing. Basically, for each module should it be in its own directory with its own set of action, models etc. folders? Or should all modules share the same single set of folders? I realise this can be purely down to the developer but I'd like to know if there is a favored method. Regards, MC. _________________________________________ Mike Carter ICQ#: 29173597 More ways to contact me: http://wwp.icq.com/29173597 _________________________________________ --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.478 / Virus Database: 275 - Release Date: 06/05/2003 =20 |
From: Jason S. <jsw...@ya...> - 2003-05-19 13:15:43
|
Scott Lillig <sco...@ho...> wrote: > Jason, > > I'm curious if you have had a chance to review any of the changes Alex as > well as Tony have made to PHRAME and any thoughts. I reviewed Tony's code when he did some of his initial development. Probably the main concern I had was with elimination of the concepts of Actions. I thought this aspect of Phrames Struts heritage was valuable. I think I posted back to the list (Mar-Apr time-frame I think) regarding this. I visited Alex's site and looked over the release notes, but have not had time to look at the modification. So items he listed sounded very interesting. Sorry I can't be of more help. Jason __________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. http://search.yahoo.com |
From: Alex <ale...@ya...> - 2003-05-19 09:21:53
|
Hi Mike, I have not read the php|a article, so I am not familiar ifeverything said there works with my modifications. Seeing as it was an introduction to MVC, my guess is yes. But: I did edit the phrame 2.0 base a bit so that could break things a bit. Just give it a try and see. Keep me posted on your findings. Kind regards, Alex Mike Carter <mi...@bu...> wrote: > -----Original Message----- > From: phr...@li... > [mailto:phr...@li...] On Behalf Of Alex > Sent: 11 May 2003 10:29 > To: phr...@li... > Subject: [Phrame-devel] phrame - my modifications [package updated] > > > Hi All, > > I've posted updates to my changes over phrame 2.0. > > Get it here: > http://www.geocities.com/alex_has_email/ > > Changes over previous posting are: > > - Removed some bugs and cleaned up a lot of code > - The HttpServletRequest object is now mapped as > $request with Smarty & TPHP > - Tried to merge in Jason's mods Does this mean that everything discussed in the tutorials from php|a will work with your package too? I've not yet subscribed to php|a. But am sitting on the fence just deciding what to do. Regards, Mike C. --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.478 / Virus Database: 275 - Release Date: 06/05/2003 ------------------------------------------------------- This SF.net email is sponsored by: If flattening out C++ or Java code to make your application fit in a relational database is painful, don't do it! Check out ObjectStore. Now part of Progress Software. http://www.objectstore.net/sourceforge _______________________________________________ Phrame-devel mailing list Phr...@li... https://lists.sourceforge.net/lists/listinfo/phrame-devel --------------------------------- Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. |
From: Scott L. <sco...@ho...> - 2003-05-19 08:42:14
|
Jason, I'm curious if you have had a chance to review any of the changes Alex as well as Tony have made to PHRAME and any thoughts. Cheers, Scott -----Original Message----- From: phr...@li... [mailto:phr...@li...] On Behalf Of Mike Carter Sent: Sunday, May 18, 2003 12:01 PM To: 'Alex'; phr...@li... Subject: RE: [Phrame-devel] phrame - my modifications [package updated] > -----Original Message----- > From: phr...@li... > [mailto:phr...@li...] On Behalf Of Alex > Sent: 11 May 2003 10:29 > To: phr...@li... > Subject: [Phrame-devel] phrame - my modifications [package updated] > > > Hi All, > > I've posted updates to my changes over phrame 2.0. > > Get it here: > http://www.geocities.com/alex_has_email/ > > Changes over previous posting are: > > - Removed some bugs and cleaned up a lot of code > - The HttpServletRequest object is now mapped as > $request with Smarty & TPHP > - Tried to merge in Jason's mods Does this mean that everything discussed in the tutorials from php|a will work with your package too? I've not yet subscribed to php|a. But am sitting on the fence just deciding what to do. Regards, Mike C. --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.478 / Virus Database: 275 - Release Date: 06/05/2003 ------------------------------------------------------- This SF.net email is sponsored by: If flattening out C++ or Java code to make your application fit in a relational database is painful, don't do it! Check out ObjectStore. Now part of Progress Software. http://www.objectstore.net/sourceforge _______________________________________________ Phrame-devel mailing list Phr...@li... https://lists.sourceforge.net/lists/listinfo/phrame-devel |
From: Jason S. <jsw...@ya...> - 2003-05-19 03:15:31
|
Hi Mike, > Having read the php|architect article today on MVC and Phrame use I'm > still not 100% sure how you would go about implementing something like > user login authentication and then permission checking on each page. > > Does anybody have an example of how it all fits together? I was > thinking of using one of the PEAR authentication classes to do the job. The first article was intended to truly be an introduction to the concepts of MVC. There will be a followup article next month, with much more concrete example. One of these facets is security. I implemented a very simple User mode, that basically allows one to login (or just be recognized) as the "admin" for a site. For any user authentication system, the key will be your User model. This model will need to handle things like: being able to report if a user is currently (probably session or cookie based) being able to validate a login (password to db password compare perhaps?) report current user information from some persistant store (db again?) Some of these exposed methods might be accessed by a view- for example User::IsValid might determine if you display a user name vs a login form on a view. Other methods might be accessed in Action::Perform methods. The example might be a user logging in, this would post to a LoginAction, which would take the posted username and password, and access a method of the User class to determine if a valid login was performed. HTH > At least I understand a bit more of what code goes in which parts of the > MVC now - after reading the article. > > Thanks Jason! Glad it helped clarify some, that is why I wrote it :) Jason __________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. http://search.yahoo.com |
From: Mike C. <mi...@bu...> - 2003-05-18 22:40:01
|
Hi all, Having read the php|architect article today on MVC and Phrame use I'm still not 100% sure how you would go about implementing something like user login authentication and then permission checking on each page. Does anybody have an example of how it all fits together? I was thinking of using one of the PEAR authentication classes to do the job. At least I understand a bit more of what code goes in which parts of the MVC now - after reading the article. Thanks Jason! Regards, Mike. _________________________________________ Mike Carter ICQ#: 29173597 More ways to contact me: http://wwp.icq.com/29173597 _________________________________________ --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.478 / Virus Database: 275 - Release Date: 06/05/2003 |
From: Mike C. <mi...@bu...> - 2003-05-18 17:02:55
|
> -----Original Message----- > From: phr...@li... > [mailto:phr...@li...] On Behalf Of Alex > Sent: 11 May 2003 10:29 > To: phr...@li... > Subject: [Phrame-devel] phrame - my modifications [package updated] > > > Hi All, > > I've posted updates to my changes over phrame 2.0. > > Get it here: > http://www.geocities.com/alex_has_email/ > > Changes over previous posting are: > > - Removed some bugs and cleaned up a lot of code > - The HttpServletRequest object is now mapped as > $request with Smarty & TPHP > - Tried to merge in Jason's mods Does this mean that everything discussed in the tutorials from php|a will work with your package too? I've not yet subscribed to php|a. But am sitting on the fence just deciding what to do. Regards, Mike C. --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.478 / Virus Database: 275 - Release Date: 06/05/2003 |
From: Arnold C. <arn...@ya...> - 2003-05-16 05:25:07
|
--- Jason Sweat <jsw...@ya...> wrote: > Hi Arnold, > > If > > anyone is interested in being added as a developer > or > > administrator to the project please let me know. > I have not done this at sourceforge yet (dev or > admin), but I would be happy to > learn and help with either. What do you want the > criteria to be for checking > in changes? I don't really have a plan for this at the moment. I'd like to keep it simple. Maybe a good idea would be that the active members of the developer list vote over changes that should be incorporated? I think that would be the most democratic approach and would allow more people to become committers. > > > Please put any bugs you > > find in the bug tracker at > Threw in the Stack::Peek() bug. Thanks! I really think we should continue to utilize the sourceforge site for managing the project. > > > Any more ideas on future development are welcome. > The > > discussion has already begun and I'd like to get > more > > opinions. I'd also like to remind everyone that > > subsequent releases will be released under the > lgpl > > (lesser gpl). > Would that apply immediatly to any CVS changes to > the Phrame 2.0 code? I > remebered you mentioning in the past that you had a > development version you > wanted to post as well. Where are you on that now? > > Regards, > > Jason I'd like to change the license of the project immediately so yes, any subsequent changes should be under the lgpl and therefore put the entire project under the new lgpl license. As for the updated code, I sent what I had (it was very rough) to Tony and he made some more changes. I haven't heard from Tony about access to his repository to get the latest version of that code. > > __________________________________ > Do you Yahoo!? > The New Yahoo! Search - Faster. Easier. Bingo. > http://search.yahoo.com __________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. http://search.yahoo.com |
From: <ja...@ie...> - 2003-05-14 11:34:10
|
Thanks, Jason. It's solved now. Yes, It was actually named as array (It's a form designed by another mate) although without the "multi" parameter. I would think that this should not make any difference, however... Well, anyway It's already running now. Thanks again for your kind help. Jos=E9 Alfonso. --On mi=E9rcoles, 14 mayo 2003 04:07 -0700 Jason Sweat = <jsw...@ya...>=20 wrote: > Is your select named like and array? > i.e. <select name=3D"foo[]" multi=3D"multi"> > ... > </select> |
From: Jason S. <jsw...@ya...> - 2003-05-14 11:07:51
|
Hi José_Accino, > I'm using original Phrame framework to make a medium size app. All > by all, it runs nice. I've a question, however. Is ActionForm->get > unable to return form data from multiple options fields?. Is your select named like and array? i.e. <select name="foo[]" multi="multi"> ... </select> then $ActionForm->Get(foo) should be an array. Here is a snippet from the upcoming article that deals with a similar, but not exact, issue: From a smarty template (trimmed down): {section name=g loop=$group} {assign var=gid value=$group[g].link_group_id} {if $smarty.section.g.first} <form action="{$action_link}" method="post"> <div> <table> {/if} <tr> <th colspan="2"> {if $smarty.section.g.first} <input type="hidden" name="{$action}" value="UpdGroup" /> {else} <hr /> {/if} <h2>{$group[g].group_name}</h2> </th> </tr> <tr> <th>Name:</th> <td> <!-- *********************** NOTICE THIS HIDDEN NAME *********************** --> <input type="hidden" name="groups[]" value="{$gid}" /> <input type="text" name="group_name{$gid}" value="{$group[g].group_name}" size="45" max="50" /> </td> </tr> <tr> <th>Description:</th> <td><textarea name="group_desc{$gid}" rows="4" cols="40">{$group[g].group_desc}</textarea></td> </tr> {if $smarty.section.g.last} <tr> <th colspan="2"> <hr /> <input type="submit" value="Update" /> </th> </tr> </table> </div> </form> {/if} {sectionelse} <h2>Warning</h2> <p>There are no groups, please add one.</p> {/section} And here is the extended ActionForm that processes it: <?php /** * GroupForm class definition * * @author Jason E. Sweat * @since 2003-04-29 * @package PHP_Architect_MVC_links_example * @subpackage Forms */ /** * GroupForm class definition * @package PHP_Architect_MVC_links_example * @subpackage Forms */ class GroupForm extends ActionForm { /** * update list */ var $_moUpdList; /** * override PutAll method for custom processing * * @param array $paIn input array * @return void */ function PutAll($paIn) { Parent::PutAll($paIn); $a_list = array(); // notice that I expect groups to be an array here $a_loop = $this->Get('groups'); if (is_array($a_loop)) { for ($i=&new ArrayIterator($a_loop); $i->IsValid(); $i->Next()) { $i_upd_key = (int)$i->GetCurrent(); $a_add = array( 'link_group_id' => $i_upd_key ,'group_name' => stripslashes($this->Get('group_name'.$i_upd_key)) ,'group_desc' => stripslashes($this->Get('group_desc'.$i_upd_key)) ); $a_list[] = $a_add; } } $this->_moUpdList =&new ArrayList($a_list); } /** * return list iterator for updates * * @return object list iterator */ function &GetList() { return $this->_moUpdList->ListIterator(); } } ?> > PS. Nice article on php|a, Jason. I look forward for the next one! Thank you. HTH Jason __________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. http://search.yahoo.com |
From: <ja...@ie...> - 2003-05-14 09:18:04
|
I'm using original Phrame framework to make a medium size app. All by all, it runs nice. I've a question, however. Is ActionForm->get unable to return form data from multiple options fields?. Until now, I only been able to get the last selected value ... Thanks in advance. Jos=E9 Alfonso. PS. Nice article on php|a, Jason. I look forward for the next one! |
From: Alex <ale...@ya...> - 2003-05-11 09:29:18
|
Hi All, I've posted updates to my changes over phrame 2.0. Get it here: http://www.geocities.com/alex_has_email/ Changes over previous posting are: - Removed some bugs and cleaned up a lot of code - The HttpServletRequest object is now mapped as $request with Smarty & TPHP - Tried to merge in Jason's mods - Improved the RequestDispatcher system - Improved subdirectory support - Enabled <forward .... redirect="true"/> - Added more tests and examples to the package Changes over Phrame 2.0 are: - Not *all* actions & forms are loaded by default anymore - Implemented a RequestDispatcher for different types of requests and templates - You can now forward to other actions - phrame-config.xml XML-configuration like Struts - Request and Session state like JSP and Struts - Ready for use WEB-INF directory structure with Smarty 2.5.0 already in it. - Use Action Servlet Mappings like *.action and *.do - You can call on templates directly (like JSP) Have fun testing! Kind regards, Alex __________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. http://search.yahoo.com |
From: Jason S. <jsw...@ya...> - 2003-05-07 20:50:11
|
The May issue of php|a is now available, and "An Introduction to MVC Using PHP" is the lead story! (http://www.phparch.com/issuedata/2003/may/) In it, I cover some general background on MVC, and present an in depth look at a modified version of the Phrame "hello" example (tweaked to use Smarty instead of XSLT, and a few other mods). The article is really part 1 of 2. The second will appear next month with a much more robust, db based Phrame MVC example. If anyone has feedback regarding the article, please feel free to post it on this list, or on the php|a forum or email me directly. Thanks! Jason __________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. http://search.yahoo.com |
From: Arnold C. <arn...@ya...> - 2003-05-07 00:24:27
|
I'm sorry I haven't been more active on the list lately. I am in the process of moving this week. I think it's great that others have have been contributing and introducing new ideas on the list. If anyone is interested in being added as a developer or administrator to the project please let me know. I have moved the web site from phrame.itsd.ttu.edu to phrame.sourceforge.net to make future maintenance easier and more accessible. If anyone is interested in contributing content or updates please let me know. :) I'd like to get the communities help in putting together a bugfix release. Please put any bugs you find in the bug tracker at http://sourceforge.net/tracker/?group_id=66668&atid=515308 and upload a patch at http://sourceforge.net/tracker/?group_id=66668&atid=515310 if you have one. Any more ideas on future development are welcome. The discussion has already begun and I'd like to get more opinions. I'd also like to remind everyone that subsequent releases will be released under the lgpl (lesser gpl). Arnold --- Scott Lillig <sco...@ho...> wrote: > I am new to this list and new to using Phrame. I > have worked with Struts > previously and was more than delighted to see Phrame > here on > sourceforge.net. I feel this will be great for > anyone wanting to keep up > with the familiarity of the Struts concepts and > skills when working with PHP > or JSP or both together. > > > Now to the questions: > > I have noticed that Phrame started off pretty strong > on SourceForge and then > seemed to have died down considerably and just > recently, thanks to an > obvious select few, started churning again. Curious > what Arnold's plans are > on going forward with this project as an owner in > regards to keeping the > SourceForge site updated, releasing future versions, > working with other > contributors, and licensing issues with Texas Tech > Univ.? > > I have started playing around with Phrame and very > pleased with the start, > but am now wanting to start developing seriously > with it for production use > and am seeing possible contributors providing > different implementations of > their experience on the list, but see no project > leadership in implementing > these into CVS or next version releases, bugs, > tasks, etc. on SourceForge. > > It seems Jason and Tony is doing a considerable > amount of work and updates > in their experience using Arnold's initial Phrame. > Is there any chance the > three of you or any other volunteers could > collaborate on keeping the > project site up to date? > > I would love to volunteer my time to help out in > anyway I can, please let me > know how I can help. Just would hate to see > something so promising turn > into a piecemeal project and fade away. > > Also, just purchased a years subscription to > PHP/Architecture after I saw > Jason wrote an article using Phrame in the May > issue! > > Cheers to Arnold and the Texas Tech team for getting > this started. Looking > forward to a Phrame Phuture! > > Scott > > > ATTACHMENT part 2 application/ms-tnef name=winmail.dat __________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. http://search.yahoo.com |
From: Alex B. <ale...@ya...> - 2003-05-06 18:47:08
|
Hi all, I've made some modifications to the phrame 2.0 release, and prepared a package of the mods. You can find it here: http://www.geocities.com/alex_has_email/phrame-alex/ Please note that these modifications have not been well tested and do not come from the phrame project itself. As such they are pretty much unsupported. I've changed quite a bit, among things: - action & form are included only when used. - added phrame-config.xml file. (like struts) - session & request state with HttpRequestServlet and HttpSession. (like java) - implemented a new viewdispatcher system, no more unwanted header(location: calls. - merged in smarty 2.5.0 as templating engine. - some working examples. (you needs mod_rewrite and .htaccess for most of that) Have fun playing with these changes. Feedback welcomed. Kind regards, Alex __________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. http://search.yahoo.com |
From: Jason S. <jsw...@ya...> - 2003-05-06 02:25:27
|
Several people seem to have had troubles applying the diff (probably because the mail client mangled the line wraps). Here is my edited version of the ActionController.php for anyone who is interested. Regards, Jason <?php /** * The ActionController class represents the controller in the * Model-View-Controller (MVC) design pattern. The ActionController receives * and processes all requests that change the state of the application. * * Generally, a "Model2" application is architected as follows: * <ul> * <li>The user interface will generally be created with either PHP pages, * which will not themselves contain any business logic. These pages represent * the "view" component of an MVC architecture.</li> * <li>Forms and hyperlinks in the user interface that require business logic * to be executed will be submitted to a request URI that is mapped to the * ActionController. The ActionController receives and processes all requests * that change the state of a user's interaction with the application. This * component represents the "controller" component of an MVC architecture.</li> * <li>The ActionController will select and invoke an Action class to perform * the requested business logic.</li> * <li>The Action classes will manipulate the state of the application's * interaction with the user, typically by creating or modifying classes that * are stored as session attributes. Such classes represent the "model" * component of an MVC architecture.</li> * <li>Instead of producing the next page of the user interface directly, * Action classes will forward control to an appropriate PHP page to produce * the next page of the user interface.</li> * </ul> * The standard version of ActionController implements the following logic for * each incoming HTTP request. You can override some or all of this * functionality by subclassing this class and implementing your own version of * the processing. * <ul> * <li>Identify, from the incoming request URI, the substring that will be used * to select an Action procedure.</li> * <li>Use this substring to map to the class name of the corresponding Action * class (a subclass of the Action class).</li> * <li>If this is the first request for a particular Action class, instantiate * an instance of that class and cache it for future use.</li> * <li>Optionally populate the properties of an ActionForm class associated * with this ActionMapping and cache it for future use.</li> * <li>Call the perform() method of this Action class. Passing in the mapping * and the request that were passed to the ActionController by the bootstrap. * </li> * </ul> * * The standard version of ActionController is configured based on the * following initialization parameters, which you will specify in the options * for your application. Subclasses that specialize this ActionController are * free to define additional initialization parameters. * <ul> * <li><b>options</b> - This sets the ActionController options.</li> * </ul> * * @author Arnold Cano * @version $Id: ActionController.php,v 1.1.1.1 2002/11/19 16:46:54 arcano Exp $ */ class ActionController extends Object { /** * @var array */ var $_options; /** * @var HashMap */ var $_actionMappings; /** * @var HashMap */ var $_actionForms; /** * @var HashMap */ var $_actions; /** * Create a ActionController specifying the options. * * @access public * @param array $options */ function ActionController($options) { if (!is_array($options)) { trigger_error('Invalid options file'); return; } $this->_options = $options; //initialize cache $this->_actionMappings = new HashMap(); $this->_actionForms = new HashMap(); $this->_actions = new HashMap(); } /** * Process the request. * * @access public * @param array $mappings * @param array $request */ function process($mappings, $request) { if (!is_array($mappings)) { trigger_error('Invalid mappings file'); return; } if (!is_array($request)) { trigger_error('Invalid request'); return; } if(!defined('DISABLE_PHRAME_ERROR_HANDLING') || DISABLE_PHRAME_ERROR_HANDLING === false) error_reporting($this->_options[_ERROR_REPORTING]); $actionMapping = $this->_processMapping($mappings, $request); $actionForm = $this->_processForm($mappings, $request); if (is_object($actionForm)) { $_SESSION[_FORM] = $actionForm; if ($actionMapping->getValidate()) { if (!$this->_processValidate($actionMapping, $actionForm)) { return; } } } $actionForward = $this->_processAction($actionMapping, $actionForm); if (is_object($actionForward)) { $this->_processForward($actionForward); } } /** * Identify and return an appropriate ActionMapping. * * @access private * @param array $mappings * @param array $request * @return ActionMapping */ function &_processMapping($mappings, $request) { $name = $request[_ACTION]; $mapping = $mappings[_ACTION_MAPPINGS][$name]; $actionMapping = $this->_actionMappings->get($name); if (!is_object($actionMapping)) { $actionMapping = new ActionMapping($name, $mapping); if ($this->_options[_CACHE]) { $this->_actionMappings->put($name, $actionMapping); } } return $actionMapping; } /** * Identify and optionally return an appropriate populated ActionForm. * * @access private * @param array $mappings * @param array $request * @return ActionForm */ function &_processForm($mappings, $request) { $name = $request[_ACTION]; $mapping = $mappings[_ACTION_MAPPINGS][$name]; //verify that a form has been mapped if (isset($mapping[_NAME])) { $form = $mappings[_ACTION_FORMS][$mapping[_NAME]]; $type = $form[_TYPE]; $actionForm = $this->_actionForms->get($name); if (!is_object($actionForm)) { if (!class_exists($type)) { require_once "forms/$type.php"; } if (!class_exists($type)) { trigger_error("Invalid ActionForm '$name' type '$type'"); return; } $actionForm = new $type(); if ($this->_options[_CACHE]) { $this->_actionForms->put($name, $actionForm); } } //reset all properties to their default state $actionForm->reset(); //populate the properties from the request $actionForm->putAll($request); } return $actionForm; } /** * Call the validate() method of the specified ActionForm. * * @access private * @param ActionMapping $actionMapping * @param ActionForm $actionForm * @return boolean */ function _processValidate(&$actionMapping, &$actionForm) { $isValid = TRUE; if(!defined('DISABLE_PHRAME_ERROR_HANDLING') || DISABLE_PHRAME_ERROR_HANDLING === false) set_error_handler($this->_options[_ERROR_HANDLER]); if (!$actionForm->validate()) { $input = $actionMapping->getInput(); //forward errors back to view header("Location: $input&".SID); $isValid = FALSE; } if(!defined('DISABLE_PHRAME_ERROR_HANDLING') || DISABLE_PHRAME_ERROR_HANDLING === false) restore_error_handler(); return $isValid; } /** * Ask the specified Action instance to handle this request. * * @access private * @param ActionMapping $actionMapping * @param ActionForm $actionForm * @return ActionForward */ function &_processAction(&$actionMapping, &$actionForm) { $name = $actionMapping->getName(); $type = $actionMapping->getType(); $action = $this->_actions->get($name); if (!is_object($action)) { if (!class_exists($type)) { require_once "actions/$type.php"; } if (!class_exists($type)) { trigger_error("Invalid Action '$name' type '$type'"); return; } $action = new $type(); if ($this->_options[_CACHE]) { $this->_actions->put($name, $action); } } set_error_handler($this->_options[_ERROR_HANDLER]); $actionForward = $action->perform($actionMapping, $actionForm); restore_error_handler(); return $actionForward; } /** * Forward to the specified destination. * * @access private * @param ActionForward $actionForward */ function _processForward(&$actionForward) { $redirect = $actionForward->getRedirect(); $path = $actionForward->getPath(); if (!$redirect) { header("Location: $path&".SID); exit; } else { $_SESSION = array(); session_destroy(); header("Location: $path"); exit; } } } ?> --- Jason Sweat <jsw...@ya...> wrote: > One other change that was implemented in this diff file was the inclusion of > actions and forms from their respective directories if the appropriate class > is > not yet defined. Right now the directories actions and forms are hard coded, > and should probably be changed to Phrame constants. This changes allows for > only a minimum number of classes to be included when the Phrame application > starts. > > Regards, > > Jason > > --- Jason Sweat <jsw...@ya...> wrote: > > These changes are a bit more extensive, but I do not believe they have any > > backwards compatability issues. > > > > The first change is to allow for the _possible_ definition of the PHP > > constant > > DISABLE_PHRAME_ERROR_HANDLING. If this constant is defined, and it is not > > set > > to false, then this will _NOT_ set the custom error handling. This is very > > useful for debugging, as the error handler will generally hide PHP fatal > > errors > > when enabled. > > > > The second change is to pass by reference where objects are expected (and > > return by reference as well). > > > > The third change is the exit; after header(); mentioned in the prior post. > > > > Jason > > > > $ diff ActionController.php ActionController.jes.php > > 110c110,111 > > < error_reporting($this->_options[_ERROR_REPORTING]); > > --- > > > if(!defined('DISABLE_PHRAME_ERROR_HANDLING') || > > DISABLE_PHRAME_ERROR_ > > HANDLING === false) > > > error_reporting($this->_options[_ERROR_REPORTING]); > > 134c135 > > < function _processMapping($mappings, $request) > > --- > > > function &_processMapping($mappings, $request) > > 155c156 > > < function _processForm($mappings, $request) > > --- > > > function &_processForm($mappings, $request) > > 165a167,169 > > > require_once "forms/$type.php"; > > > } > > > if (!class_exists($type)) { > > 189c193 > > < function _processValidate($actionMapping, $actionForm) > > --- > > > function _processValidate(&$actionMapping, &$actionForm) > > 192c196,197 > > < set_error_handler($this->_options[_ERROR_HANDLER]); > > --- > > > if(!defined('DISABLE_PHRAME_ERROR_HANDLING') || > > DISABLE_PHRAME_ERROR_ > > HANDLING === false) > > > set_error_handler($this->_options[_ERROR_HANDLER]); > > 199c204,205 > > < restore_error_handler(); > > --- > > > if(!defined('DISABLE_PHRAME_ERROR_HANDLING') || > > DISABLE_PHRAME_ERROR_ > > HANDLING === false) > > > restore_error_handler(); > > 210c216 > > < function _processAction($actionMapping, $actionForm) > > --- > > > function &_processAction(&$actionMapping, &$actionForm) > > 216a223,225 > > > require_once "actions/$type.php"; > > > } > > > if (!class_exists($type)) { > > 236c245 > > < function _processForward($actionForward) > > --- > > > function _processForward(&$actionForward) > > 241a251 > > > exit; > > 245a256 > > > exit; > > > > __________________________________ > > Do you Yahoo!? > > The New Yahoo! Search - Faster. Easier. Bingo. > > http://search.yahoo.com > > > > > > ------------------------------------------------------- > > This sf.net email is sponsored by:ThinkGeek > > Welcome to geek heaven. > > http://thinkgeek.com/sf > > _______________________________________________ > > Phrame-devel mailing list > > Phr...@li... > > https://lists.sourceforge.net/lists/listinfo/phrame-devel > > > __________________________________ > Do you Yahoo!? > The New Yahoo! Search - Faster. Easier. Bingo. > http://search.yahoo.com > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Phrame-devel mailing list > Phr...@li... > https://lists.sourceforge.net/lists/listinfo/phrame-devel __________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. http://search.yahoo.com |
From: Scott L. <sco...@ho...> - 2003-05-05 22:37:29
|
Jason, Could you please post the 'After' version of the changes made to the ActionController.php code. I am having a hard time making sure I changed everything correctly from your previous post instructions. Looking forward to your new article, unfortunately I have to wait one more day to read it since it hasn't been posted to the php/a servers yet. Anxious, Scott |
From: Scott L. <sco...@ho...> - 2003-05-05 21:56:53
|
I am new to this list and new to using Phrame. I have worked with Struts previously and was more than delighted to see Phrame here on sourceforge.net. I feel this will be great for anyone wanting to keep up with the familiarity of the Struts concepts and skills when working with = PHP or JSP or both together. Now to the questions: I have noticed that Phrame started off pretty strong on SourceForge and = then seemed to have died down considerably and just recently, thanks to an obvious select few, started churning again. Curious what Arnold's plans = are on going forward with this project as an owner in regards to keeping the SourceForge site updated, releasing future versions, working with other contributors, and licensing issues with Texas Tech Univ.?=20 I have started playing around with Phrame and very pleased with the = start, but am now wanting to start developing seriously with it for production = use and am seeing possible contributors providing different implementations = of their experience on the list, but see no project leadership in = implementing these into CVS or next version releases, bugs, tasks, etc. on = SourceForge. It seems Jason and Tony is doing a considerable amount of work and = updates in their experience using Arnold's initial Phrame. Is there any chance = the three of you or any other volunteers could collaborate on keeping the project site up to date? I would love to volunteer my time to help out in anyway I can, please = let me know how I can help. Just would hate to see something so promising turn into a piecemeal project and fade away. Also, just purchased a years subscription to PHP/Architecture after I = saw Jason wrote an article using Phrame in the May issue! =20 Cheers to Arnold and the Texas Tech team for getting this started. = Looking forward to a Phrame Phuture! Scott |
From: Jason S. <jsw...@ya...> - 2003-05-05 12:51:02
|
One other change that was implemented in this diff file was the inclusion of actions and forms from their respective directories if the appropriate class is not yet defined. Right now the directories actions and forms are hard coded, and should probably be changed to Phrame constants. This changes allows for only a minimum number of classes to be included when the Phrame application starts. Regards, Jason --- Jason Sweat <jsw...@ya...> wrote: > These changes are a bit more extensive, but I do not believe they have any > backwards compatability issues. > > The first change is to allow for the _possible_ definition of the PHP > constant > DISABLE_PHRAME_ERROR_HANDLING. If this constant is defined, and it is not > set > to false, then this will _NOT_ set the custom error handling. This is very > useful for debugging, as the error handler will generally hide PHP fatal > errors > when enabled. > > The second change is to pass by reference where objects are expected (and > return by reference as well). > > The third change is the exit; after header(); mentioned in the prior post. > > Jason > > $ diff ActionController.php ActionController.jes.php > 110c110,111 > < error_reporting($this->_options[_ERROR_REPORTING]); > --- > > if(!defined('DISABLE_PHRAME_ERROR_HANDLING') || > DISABLE_PHRAME_ERROR_ > HANDLING === false) > > error_reporting($this->_options[_ERROR_REPORTING]); > 134c135 > < function _processMapping($mappings, $request) > --- > > function &_processMapping($mappings, $request) > 155c156 > < function _processForm($mappings, $request) > --- > > function &_processForm($mappings, $request) > 165a167,169 > > require_once "forms/$type.php"; > > } > > if (!class_exists($type)) { > 189c193 > < function _processValidate($actionMapping, $actionForm) > --- > > function _processValidate(&$actionMapping, &$actionForm) > 192c196,197 > < set_error_handler($this->_options[_ERROR_HANDLER]); > --- > > if(!defined('DISABLE_PHRAME_ERROR_HANDLING') || > DISABLE_PHRAME_ERROR_ > HANDLING === false) > > set_error_handler($this->_options[_ERROR_HANDLER]); > 199c204,205 > < restore_error_handler(); > --- > > if(!defined('DISABLE_PHRAME_ERROR_HANDLING') || > DISABLE_PHRAME_ERROR_ > HANDLING === false) > > restore_error_handler(); > 210c216 > < function _processAction($actionMapping, $actionForm) > --- > > function &_processAction(&$actionMapping, &$actionForm) > 216a223,225 > > require_once "actions/$type.php"; > > } > > if (!class_exists($type)) { > 236c245 > < function _processForward($actionForward) > --- > > function _processForward(&$actionForward) > 241a251 > > exit; > 245a256 > > exit; > > __________________________________ > Do you Yahoo!? > The New Yahoo! Search - Faster. Easier. Bingo. > http://search.yahoo.com > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Phrame-devel mailing list > Phr...@li... > https://lists.sourceforge.net/lists/listinfo/phrame-devel __________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. http://search.yahoo.com |
From: Jason S. <jsw...@ya...> - 2003-05-05 02:50:40
|
These changes are a bit more extensive, but I do not believe they have any backwards compatability issues. The first change is to allow for the _possible_ definition of the PHP constant DISABLE_PHRAME_ERROR_HANDLING. If this constant is defined, and it is not set to false, then this will _NOT_ set the custom error handling. This is very useful for debugging, as the error handler will generally hide PHP fatal errors when enabled. The second change is to pass by reference where objects are expected (and return by reference as well). The third change is the exit; after header(); mentioned in the prior post. Jason $ diff ActionController.php ActionController.jes.php 110c110,111 < error_reporting($this->_options[_ERROR_REPORTING]); --- > if(!defined('DISABLE_PHRAME_ERROR_HANDLING') || DISABLE_PHRAME_ERROR_ HANDLING === false) > error_reporting($this->_options[_ERROR_REPORTING]); 134c135 < function _processMapping($mappings, $request) --- > function &_processMapping($mappings, $request) 155c156 < function _processForm($mappings, $request) --- > function &_processForm($mappings, $request) 165a167,169 > require_once "forms/$type.php"; > } > if (!class_exists($type)) { 189c193 < function _processValidate($actionMapping, $actionForm) --- > function _processValidate(&$actionMapping, &$actionForm) 192c196,197 < set_error_handler($this->_options[_ERROR_HANDLER]); --- > if(!defined('DISABLE_PHRAME_ERROR_HANDLING') || DISABLE_PHRAME_ERROR_ HANDLING === false) > set_error_handler($this->_options[_ERROR_HANDLER]); 199c204,205 < restore_error_handler(); --- > if(!defined('DISABLE_PHRAME_ERROR_HANDLING') || DISABLE_PHRAME_ERROR_ HANDLING === false) > restore_error_handler(); 210c216 < function _processAction($actionMapping, $actionForm) --- > function &_processAction(&$actionMapping, &$actionForm) 216a223,225 > require_once "actions/$type.php"; > } > if (!class_exists($type)) { 236c245 < function _processForward($actionForward) --- > function _processForward(&$actionForward) 241a251 > exit; 245a256 > exit; __________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. http://search.yahoo.com |
From: Jason S. <jsw...@ya...> - 2003-05-05 02:44:59
|
At a bare minimum, I think you need to issue an exit; after the header() to redirect. I would alter the ActionContoller::_processForward() to one of the following: function _processForward($actionForward) { $redirect = $actionForward->getRedirect(); $path = $actionForward->getPath(); if (!$redirect) { header("Location: $path&".SID); exit; } else { $_SESSION = array(); session_destroy(); header("Location: $path"); exit; } } or function _processForward($actionForward) { $redirect = $actionForward->getRedirect(); $path = $actionForward->getPath(); if (!$redirect) { header("Location: $path&".SID); } else { $_SESSION = array(); session_destroy(); header("Location: $path"); } exit; } __________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. http://search.yahoo.com |