Setting up crons

3 posts by 2 authors in: Forums > CMS Builder
Last Post: October 23   (RSS)

By mark99 - October 23

By the way, while debugging I found that the cron.php file in the 3.62 release lacks the closing ?> line at the bottom, which was present in the previous 3.59 release I was on. Seems to work fine without it, but I'm just wondering why it was removed?

By Dave - October 23

Hi Mark, 

You can find a sample cron plugin here with inline instructions: /cmsb/plugins/cron-example.php  

We sometimes include a "Run Manually" link on the plugin menu for crons we want to be able to run on demand, but another way might be to erase that cron job's entries from the cron log  here: admin.php?menu=_cron_log  That way it will think it hasn't run recently when you click "Run Now".

Regarding removing the trailing closing PHP tag, it's not required and removing it is something everyone has started doing more industry-wide.  The reasoning behind this recommendation is to prevent accidental whitespace or new lines being added after the closing tag, which could lead to unwanted output or errors like "Headers already sent".

We've been upgrading our code recently to match the current industry standards (which came into being long after CMSB was first released) and that particular standard is part of a PHP standardization specification called PSR-12: https://www.php-fig.org/psr/psr-12/#22-files  

Hope that helps!  Let me know any questions.  

Dave Edis - Senior Developer
interactivetools.com