Adding a new pseudocron task when installing a new module

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
otsakir
Forum Members
Forum Members
Posts: 17
Joined: Wed Mar 07, 2012 4:26 pm

Adding a new pseudocron task when installing a new module

Post by otsakir »

Hi,
I am working on an extension module for Products which aims to do some administrative tasks such as enabling/disabling products based on some conditions or hold some sales statistics etc. To that end, i need to implement a pseudocron task that will run asynchronously and update various database fields of Products or other modules.

From what i've seen in other posts:
e.g.
http://forum.cmsmadesimple.org/viewtopi ... =4&t=49995

one has to implement the task functionality inside a class that should be put in /lib/tasks directory.

So, what is the best way of achieving this in a typical module installation/removal ? I mean, how can I install this task class file as a part of the installation procedure? Should I copy it explicitly to the root_path/lib/tasks directory or is there another way ?

By the way, i am using cmsms 1.10.3
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: Adding a new pseudocron task when installing a new modul

Post by calguy1000 »

Take a look at the CGSmartImage module. It has a psuedocron task.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
otsakir
Forum Members
Forum Members
Posts: 17
Joined: Wed Mar 07, 2012 4:26 pm

Re: Adding a new pseudocron task when installing a new modul

Post by otsakir »

Oops! I hadn't noticed that task while grep-ing...

Worked like a charm. Thanks.
Post Reply

Return to “Developers Discussion”