MINOR added better handling of pages that result in no URLSegment

MINOR added QuarterHourly scheduled tasks, tidied documentation a little bit

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@84569 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Tom Rix 2009-08-17 22:30:27 +00:00
parent a79452e23a
commit e7e0e9424d
3 changed files with 20 additions and 2 deletions

View File

@ -1290,7 +1290,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
$t = str_replace('&','-and-',$t);
$t = ereg_replace('[^A-Za-z0-9]+','-',$t);
$t = ereg_replace('-+','-',$t);
if(!$t) {
if(!$t || $t == '-' || $t == '-1') {
$t = "page-$this->ID";
}
return $t;

View File

@ -0,0 +1,15 @@
<?php
/**
* Classes that must be run quarter hourly extend this class
*
* Please note: Subclasses of this task aren't extecuted automatically,
* they need to be triggered by an external automation tool like unix cron.
* See {@link ScheduledTask} for details.
*
* @package sapphire
* @subpackage cron
*/
class QuarterHourlyTask extends ScheduledTask {
}
?>

View File

@ -7,8 +7,11 @@
*
* Example Cron:
* <code>
* # Quarter-hourly task (every hour at 25 minutes past) (remove space between first * and /15)
* * /15 * * * * www-data /my/webroot/sapphire/cli-script.php /QuarterlyHourlyTask > /var/log/silverstripe_quarterhourlytask.log
*
* # HourlyTask (every hour at 25 minutes past)
* 25 * * * * www-data /my/webroot/sapphire/cli-script.php /DailyTask > /var/log/silverstripe_dailytask.log
* 25 * * * * www-data /my/webroot/sapphire/cli-script.php /HourlyTask > /var/log/silverstripe_hourlytask.log
*
* # DailyTask (every day at 6:25am)
* 25 6 * * * www-data /my/webroot/sapphire/cli-script.php /DailyTask > /var/log/silverstripe_dailytask.log