How is PHP able to run schedule tasks in such a way?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Hall of Famer
    Senior Member
    • Apr 2009
    • 356
    • 3.8.x

    How is PHP able to run schedule tasks in such a way?

    Well I remember there is a section in Vbulletin called schedule task in which admins simply create cronjobs through ACP. From my PHP experience, it is impossible to set up cronjobs without adding crons to server side through WHM/Cpanel. Now it seems that its possible to run cronjobs without consulting the hosting company. I wonder how Vbulletin is able to do that. I also noticed that a video sharing engine called Clipbucket has default cronjob sets too, so guess its not really a secret now?
  • Zachery
    Former vBulletin Support
    • Jul 2002
    • 59097

    #2
    Everytime a vbulletin page is called, cron.php is also called and if a task needs to be run it is executed in the background.

    Comment

    • Lynne
      Former vBulletin Support
      • Oct 2004
      • 26255

      #3
      They are not "real" cron jobs. Real cron jobs running at a specific time set up on the server. These are just Scheduled Tasks that get trigger by users on the forum. If you don't have a very active forum, then the Scheduled Tasks may not run at exactly the time you set them to run at.

      Please don't PM or VM me for support - I only help out in the threads.
      vBulletin Manual & vBulletin 4.0 Code Documentation (API)
      Want help modifying your vbulletin forum? Head on over to vbulletin.org
      If I post CSS and you don't know where it goes, throw it into the additional.css template.

      W3Schools <- awesome site for html/css help

      Comment

      • Hall of Famer
        Senior Member
        • Apr 2009
        • 356
        • 3.8.x

        #4
        Ah I see. I am asking this question since I am designing an adoptables script. Some users want their pets to level up/gain experience every X hours instead of receiving clicks, but this definitely requires cronjob. I cant just tell them to consult their host company to set up cronjobs, these are absolutely newbies at PHP and HTTP server, they are gonna have a real hard time get a time-based event to work.

        And btw, is it gonna increase server load and cause VB to run much slower if cron is called everytime a user accesses the forum? o_o

        Comment

        • Zachery
          Former vBulletin Support
          • Jul 2002
          • 59097

          #5
          If there is no task that needs to be ran, and no tasks in the backlog, no cron is run.

          Comment

          widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
          Working...