From: Matthew M. <ma...@tu...> - 2002-08-07 00:23:58
|
Greetings all, There are some major changes in the core that need explaining. First, CVS. The development team has been working on a new format for CVS. The core will be separated into its own checkout. Modules will be put into a different directory as will themes. There will also be levels of permission on these directories. Expect these changes to go into effect soon. The second big change is a recoding of the core to allow register globals to be turned off. This is in response to the direction PHP is taking. Since they went to all the trouble of creating their predefined variables, we might as well take advantage of them :) What this means was a change in the way the core works. Traditional globals are no longer used. They were extremely convenient but unfortunately not so secure. Sessions also changed, but you will not have to worry about them. The new code takes care of that. So what is required of module developers? Well there is good news and bad news. The good news. Before, you had to "global" essential objects in your function like so: function foo(){ global $core, $OBJ_layout, $OBJ_fatcat; ..code You can change those to: function foo(){ extract($GLOBALS); ..code The bright side is that you should never have to worry about not having the object you need in your function. Now the bad news. First, content variables are kind of goofy. Sometimes you need to send your content variable to the GLOBALS array like so: function foo() { ... code ... $GLOBALS["CNT_my_mod"] = $CNT_my_mod; } The old global was nice because if called you could read and write to the variable and the changes would be made. Not so with register_globals turned off. You must plug the information back into the $GLOBALS array. Program accordingly. Something else you will need to change are post, get, and cookie variables. These processes do not initialize a usable variable. You will need to call the variable from the appropriate array: $_POST, $_GET, or $_COOKIE. On the bright side, they are automatically global, so you can easily access them in your functions. You can also use $_REQUEST if you are getting both posts and gets to your file. I apologize if these are ideas you are already familiar with, but you will probably need to make adjustments to your current modules to get them to function. One more thing, as the core has gone through many changes since I wrote the old module compatibility, we are going to revisit this again later. We have taken out legacy code and will rewrite scripts to handle them later. Please ignore the documentation that explains conversions for now. I hope these changes will make phpWebSite better in the long run. I think it will. I thank the Sourceforge community for bringing it to my attention. Sincerely, Matt McNaney ----------------------------- Matthew McNaney Internet Systems Architect Electronic Student Services Email: ma...@tu... URL: http://phpwebsite.appstate.edu Phone: 828-262-6493 ICQ: 141057403 |