We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 23363
    • 43 Posts
    hi everybody,

    I want to run a cronjob and still use the modx class.
    Does anybody know how to initialize the class outside modx and what files i have to include.

    thank you for your effort.

    Jeroen, Amsterdam
      • 22303 MODX Staff
      • 10,725 Posts
      Quote from: pierun at Mar 20, 2008, 08:23 AM

      I want to run a cronjob and still use the modx class.
      What part of the DocumentParser class do you need access to in this cronjob?

      In 0.9.6.1+ you can try just including the index.php file from the root after defining MODX_API_MODE constant:
      define('MODX_API_MODE', true); 
      include('/path/to/index.php');
        • 23363
        • 43 Posts
        Dear Jason,

        Your solution works for me.

        First thank you for your quick reply and your time.

        Best regards,

        Jeroen
          • 24806
          • 43 Posts
          Why you doesn’t a run a Java or - if you have an own server - a similar (like Delphi) software on the server checking the date and time every day, starting with the system, and opening a page with a special code!?

          greetings
          Max
            I love MODx