This topic is locked

Best Practice on Modifying Generated Output

3/13/2009 12:12:26 PM
PHPRunner General questions
M
MikeB941 author

I've always wondered about the best method/practice for modifying phprunner generated output so that your changes aren't lost accidentally.
Specifically, I recently made a TERRIFIC change to include/dbcommon.php from Jane to solve a cookie sharing problem I was having between two different phprunner applications running at the same time under Firefox 3.0.7.
I made the change directly on the server and in this case, the following uploads I did for the application for other reasons luckily didn't overwrite include/dbcommon.php from the source output on my laptop.
Just to be safe, I also modified the include/dbcommon.php file in the source output directory on my laptop as well.
HOWEVER, I frequently do a SAVE PROJECT AS with ascending version suffixes as I'm making major changes to an application so I can fallback to a previous version if I need to.
Of course when I do the first BUILD to populate the output directory for this new version of the application on my laptop, the include directory is regenerated and my change to include/dbcommon.php is lost on my laptop.
Again, luckily, the following uploads for the application didn't overwrite the modified include/dbcommon.php on the server BUT WHAT IS THE BEST METHOD/PRACTICE to modify generate PHPRUNNER code so that you don't inadvertently lose those changes through a subsequent build or upload.
I know this include/dbcommon.php is a special case because it doesn't get overwritten/regenerated as easily as when I modify something on like a list.php for example. So I'd also really appreciate advise on the best practice/method for modifying the more commonly generated output such as list.php, etc.
Thanks a million for all your help! Take Care... Mike.

R
randall 3/13/2009

Here's how I do it: I create directories in the output directory called Modified Includes and Modified Templates in which I store my own versions. Then, I just select all the files from whatever directory and copy them over the generated output. It isn't elegant but it works well for me.

A
alang 3/13/2009

If you want to apply changes to ALL your projects, you can edit the file in your installed location, ie C:\Program Files\PHPRunnerx.x\include.
If you only want to apply changes to some of your projects, create your own business template (under C:\Program Files\PHPRunnerx.x\templates\business) where you can have customised code modules that "override" the default ones when that template is selected for a particular project.
In both cases, you will need to redo of course when you upgrade your PHPR version.

Sergey Kornilov admin 3/13/2009

I recommend to follow the path AlanG suggests.

M
MikeB941 author 3/17/2009

Thanks very much! Take Care... Mike.

R
rgfischerjr 3/19/2009

I know this include/dbcommon.php is a special case because it doesn't get overwritten/regenerated as easily as when I modify something on like a list.php for example. So I'd also really appreciate advise on the best practice/method for modifying the more commonly generated output such as list.php, etc.


MikeB - dbcommon is a tough one for me bacause of localhost and webhost differences. I created a web_dbcommon.php and modified the template to use if file_exist load webdbcommon else load dbcommon. web_dbcommon.php is always on the webserver and not on local host.