This topic is locked

Where is loginonload global event in PHPRUNNER 5.0

3/1/2009 18:45:03
PHPRunner General questions
M
MikeB941 author

When I MIGRATE a 4.1 PHPRUNNER project to PHPRUNNER 5.0 build 766 the loginonload global event (Login Onload) is present, but I don't see the loginonload event for new projects created in PHPRUNNER 5.0 build 766?
Was it moved? Is there another way to store common functions in PHPRUNNER 5.0?
Thanks for all your help! Take Care... Mike.

Sergey Kornilov admin 3/2/2009

Use include/header.php file to store common functions.
LoginOnLoad is a wrong place to store common functions anyway. It's only executed once when login page is loaded.

M
MikeB941 author 3/3/2009

Thanks for the update Sergey - but it's WAY more convenient to keep all the code for a project WITHIN PHPRUNNER (i.e. in events) rather than having some of t maintained outside of PHPRUNNER in independent include files.
Would it be possible to get a GLOBAL FUNCTIONS event (for lack of a better word) added that would be the standard place to store functions and code that is commonly called by other events, etc. within a project?
Thanks again for such a great product! Take Care... Mike.

Sergey Kornilov admin 3/3/2009

Mike,
I see what you saying. I believe that keeping those common functions in header.php gives you more flexibility. I.e. you can create a new project and simply copy this file there or if you need to change one of common functions you don't have to rebuild PHPRunner project.
Events are not designed to store functions. Event is a piece of code that runs at certain point.

M
MikeB941 author 3/3/2009

I hear you Sergey on the purpose of the events (it's just many of "cheated" by using the login onload to store common code) - then would it be possible to get something (maybe on the miscellaneous page?) called GLOBAL CODE that's placed right before/after the include for the header.php when the code is generated (my goal is try and keep all the code WITHIN PHPRUNNER - we could still easily copy the code from one project to the next if we had this kind of GLOBAL CODE location within PHPRUNNER where such things could be stored).
Thanks again for all your help!
Take Care... Mike.

Sergey Kornilov admin 3/3/2009

Mike,
btw, check PHPRunner 5.1 that allows you to edit header/footer files right in Visual Editor.

M
MikeB941 author 3/17/2009

Hi Sergey:
I tried adding these global user functions to header.php but it looks like header.php is included within a function and so the "global" functions I included in header.php were only available in that function and not "global".
I wound up moving my include for my global user functions to dbcommon.php but wanted to make sure I wasn't doing something wrong because header.php would be cleaner without having to modify dbcommon.php.
It would be GREAT if there was a globaluserfunctions.php that phprunner included at the global level and even greater if this was directly editable in phprunner.
Thanks again for all your help! Take Care... Mike.