Incorrect link are build from cron

1 view
Skip to first unread message

Alexander Obuhovich

unread,
May 17, 2012, 6:00:05 AM5/17/12
to In-Portal Bugs
By default cron (/tools/cron.php script) does it's job silently without sending any e-mail to anybody.

However if add a Scheduled Task that would, for example, send out latest added links on a website, then you'll notice soon enough that there are several problems in these links:

This all is happening because of ADMIN constant being defined in cron.php script. Maybe it's defined to skip most of front-end specific code, which also includes mod-rewrite link building.

I'm proposing to remove this constant now and in code, that really isn't needed when cron is executed from PHP CLI place if with check for CRON constant it defined all the time.



Ready for testing.

--
Best Regards,

http://www.in-portal.com
http://www.alex-time.com
wrong_links_build_from_cron.patch

Phil

unread,
May 17, 2012, 8:04:07 AM5/17/12
to in-port...@googlegroups.com
Will users (like me), who launch cron via wget, would need to change something in order to make it working?


Envoyé avec Sparrow

--
You received this message because you are subscribed to the Google Groups "In-Portal Bugs Team" group.
To post to this group, send email to in-port...@googlegroups.com.
To unsubscribe from this group, send email to in-portal-bug...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/in-portal-bugs?hl=en.

Pièces jointes :
- wrong_links_build_from_cron.patch

Alexander Obuhovich

unread,
May 17, 2012, 9:11:55 AM5/17/12
to in-port...@googlegroups.com
Nope. But I strongly recommend to switch to PHP CLI execution mode since of 5.2.0 (or if project don't have any links generated from cron, then switch anyway) because PHP CLI don't:
  1. use webserver (e.g. apache)
  2. user network traffic, since it sends requests from machine back to it
  3. suddenly die because of webserver (e.g. apache) timeout happened

Phil

unread,
May 17, 2012, 9:23:41 AM5/17/12
to in-port...@googlegroups.com
ok, thanks for advice.


Envoyé avec Sparrow

Reply all
Reply to author
Forward
0 new messages