Forums | Mahara Community

Developers /
Cron Not Working? Try this!


anonymous profile picture
Account deleted
Posts: 29

08 October 2011, 13:00

Hi,

Many of us are having trouble getting CRON to function properly! So here's an old trick to implement CRON.

  1. Go to "Site Administration."
  2. Choose "Edit Site Pages."
  3. Choose "Home" or "Logout" page.
  4. In the Tiny Editor (old version...we got to get this updated!) click on the icon to insert an image.
  5. For the URL, input the complete web URL to the "/lib/cron.php."
  6. Enter "0" for the remaining values.
  7. Save.
  8. Use the "HTML" option to locate the invisible pixel.

Each time a member logs into and sign out their account, CRON will run.

 The same process can be done to implement Javascript, ASP, PERL, CGI, and other files alike. Just link to the file directly (instead of CRON.php, use "thisfile.pl," "thisfile.asp," "thisfile.js," etc.)

Thank you!

LU: October 08, 2011 General edit.

 

 

Kristina Hoeppner's profile picture
Posts: 4863

08 October 2011, 18:29

Hello Mario,

In terms of the editor, you will be pleased to read that it seems to be fixed, cf. https://bugs.launchpad.net/mahara/+bug/530656 You can try to implement this on your 1.3 installation, but you may have to update TinyMCE.

Cheers

Kristina

anonymous profile picture
Account deleted
Posts: 112

09 October 2011, 9:03

Updating TinyMCE is a straight replace of the /js/tinymce directory.  Nothing else needs to be done.  I personally backed up the directory to "tinymce.org" just to be safe.  But so far, I have not had any problems.

Move the old directory to a new directory name and install a fresh install of TinyMCE -- just to be safe.

Melissa

François Marier's profile picture
Posts: 411

09 October 2011, 18:19

It's almost as simple as that. The only thing you're missing is that we have to reapply our patches to tinymce (as listed in htdocs/js/tinymce/README.Mahara).

Cheers,

Francois

anonymous profile picture
Account deleted
Posts: 29

10 October 2011, 11:30

Hi,

I have the 1.4 version of Tiny MCE, but the advanced options are not shown nor accessible. I'll attempt it on a beta install of Mahara to see what happens. When I had written "using an invisible pixel to implement CRON," I figured CRON to update the RSS feeds which didn't happen. At another site of mines, I actually syndicate between 610-782 posts that are orignated through RSS feeds. Most of which are security related. RSS / ATOM feeds are more important than most web programmers realize. The whole point of feeds were to keep members and users updated on information without having to directly enter a site. In more ways than one, I see Mahara attempting to "re-invent the wheel."

I have noticed the code is "uncessarily obscured, and difficult" in some areas. If this is the case then Team Mahara perhaps can consider < .cgi > kernels rather than < .php > files. Templates and plugins can easily be formed this way. It happens a lot; Platforms using PHP without understanding that with PHP underlies a PERL framework. Very few top running organizations or corporations on the planet use PHP when creating a platform because of that reason. In the case of CRON, I'm not sure why Team Mahara would write a CRON.php instead of using a PERL / CGI CRON kernel that's probably already available from CPAN.

In this case this is why it's stated: "Choose your platform wisely!"

I will look into creating an easier process for plugin development. I have trouble with the documentation and the code because I cannot follow through where something is: "starting, activating, initializing, and closing." The < index.php > seems like a "convalescent drop-off for code;" Noting that PHP avoids APACHE server instructions in order to exhibit "PHP" of scope and design (Code writers should write APACHE server code instead of using PHP to process an override.)

Document, document, and document your code every step of the way! Even if it's a single process! If necessary, leave a URL Ref. to the full explanation of what's happening, and why.

 

Thank you

anonymous profile picture
Account deleted
Posts: 808

10 October 2011, 16:46

Hi Mario,

You're right, there certainly is a bit of wheel reinventing in Mahara.  In the case of cron.php I believe the motiviation was to get around the problem of shared hosting providers limiting access to crontabs, but I'm not 100% sure about that.  Anyway, cron.php *should* update your feeds, it does happen on our installations.  However, by default it's only once per hour, on the hour (see the contents of the blocktype_cron table).

R.

François Marier's profile picture
Posts: 411

10 October 2011, 18:01

Hi Mario,

If you have any specific suggestions as to what is missing from our developer documentation, please add them here:

  https://wiki.mahara.org/index.php/Developer_Area/Documentation_Wishlist

We are trying to improve it over time but we need help identifying specific gaps.

Cheers,

Francois

anonymous profile picture
Account deleted
Posts: 29

10 October 2011, 18:37

Hi,

@Marier, Mansfield

I appreciate the info! I don't think no organization in the world could defeat CPAN in documentation (except government,) but I think standardizing some of the processes in Mahara and then building from there would work.

It would require building a committee to determine the best approch to documenting "process-building." In essence providing a naming and numerical convention towards "process-building." It increases the power and efficiency in the Mahara platform.

TY

Just added:

Checked out a test page created for testing the RSS feeds. I had seen the feeds are updated without making any alterations as mentioned in our previous posts. Using an invisible pixel does work in the case of activating CRON.

anonymous profile picture
Account deleted
Posts: 214

11 October 2011, 9:06

Hi EAF,

One consideration I just wanted to mention -- with using an invisible pixel trick is that it can cause your browser to appear hung. Firefox has a per-server connection limit of 12 by default, and Chrome has a limit of 6. If you have more than 6 connections in process, any additional connections will be queued. Although you're unlikely to hit it on the logout page, it still increases the chance a little.

Another one to consider is that most browsers also have a maximum number of connections to a single proxy server limit. If your users are going through a proxy, this could adversely affect them. Again, I believe the limit is set pretty low.

Andrew

anonymous profile picture
Account deleted
Posts: 29

11 October 2011, 12:37

Hi @Nicols,

If I'm understanding you correctly, your suggesting to perhaps limit access to the CRON implementation as it may be accessed by more than --say 100 users within five minutes.

TY

15 results