The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
After looking into some error reports on my Thread of the Week hack, i found the reason of the errors in some strange (in my eyes) behaviour of job run using the Scheduled Task Manager.
Test script 'includes/cron/test.php': PHP Code:
Now add a new Task with the Scheduled Task Manager, pointing to this file, set it to log the action. If you now press "Run Now" and look at the lines written into the Scheduled Task Log. It will look like this: Code:
134 test 18:34, 6th Feb 2005 Line 1. Level: Main Line 2. Level: Function Line 3. Level: Main In function test1 i set the vars $log and $count to global, thus giving me access to the same vars as used in the mainline. I again add a line to the $log and increase $counter. Now return to mainline. Back in the main line $counter still contain the value as set in the function, and $log now contain 2 lines. I add 1 more line, write $log to the Scheduled Task log and finish. This is exactly what happens when i run it with the "Run Now" button. Now i repeat the test, but this time i let it run automatic, by setting a time for the Task to run. I wait till it has run, and go look in the Scheduled Task Log. I expect exactly the same output, since it is the same script. But, output is as follows: Code:
138 test 18:44, 6th Feb 2005 Line 1. Level: Main Line 2. Level: Main What am i missing here? PS Yes when i also in the main line declare these 2 vars as global, or if i would pass them as parameters to the function, i could make this work. But that is not the point. I just want to understand what is going on. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|