The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#11
|
|||
|
|||
The latest code block I posted is already at the global level. It would be easy for me to raise an error flag, but the problem is I would have to have a gargantuan tree of nested ifs (at least ten, more likely around 20) in order to gracefully have the code flow to the end of the file (the point at which the cron system resumes its work with the next job).
|
#12
|
|||
|
|||
so then are you trying to break the control of the cron job to stop the following scheduled cron jobs, because I see that you are logging the error that has occurred, and if thats the case couldn't you simple add a continue ; to end that section of the while loop in the file, after it the included cron php files are within the actual loop, it would then resume the next cron job after all, because the continue only breaks that certain loop.
Cheers, g-force2k2 |
#13
|
|||
|
|||
To clear the ambiguity, I'm trying to make my custom cron job (vbms_checkmail.php) gracefully terminate and yield control to the next scheduled job (whatever.php), if there is any.
|
#14
|
|||
|
|||
Alright, then couldn't continue ; possibly do the trick?
Cheers, g-force2k2 |
#15
|
|||
|
|||
That's actually a really good idea. The only problem would be that it could reference the wrong loop (for example, if I want to exit from within a loop).
Or wait, how would it work exactly? If continue is used in a function where there aren't even loops, would PHP just reversely traverse the code tree until it finds a loop, and then force the next iteration? edit: http://www.php.net/continue for reference doesn't mention anything other than the freaky fact it supports an argument. I wish PHP was as clean as Java but as easy as it is now... |
#16
|
|||
|
|||
Hmm... very interesting, I did some tests with continue ; in both an included file and a function and both returned errors, but something else did work.
PHP Code:
numbermain.php PHP Code:
PHP Code:
PHP Code:
Code:
1 2 3 4 6 7 8 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 Cheers, g-force2k2 |
#17
|
|||
|
|||
Well remember that because PHP's file inclusion functions are essentially identical to the #include preprocessor directive in C--just dumps a file into another file--the code being run is this:
PHP Code:
|
#18
|
|||
|
|||
Quote:
Cheers, g-force2k2 |
#19
|
|||
|
|||
Quote:
Quote:
|
#20
|
|||
|
|||
Interestingly, it looks like exit; will work. vB registers a shutdown function via register_shutdown_function() named exec_cron() that will, hopefully, cause the cron jobs to continue to run.
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|