From 51082627706d361ca1ea3512b5943a70bcc3f1f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20S=CC=8Ctekl?= Date: Thu, 5 Mar 2015 23:11:26 +0100 Subject: [PATCH] Fixed period possible value specification [fixes #38] --- Cronner/Tasks/Parser.php | 2 +- README.md | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Cronner/Tasks/Parser.php b/Cronner/Tasks/Parser.php index 1f145fa..8c9ea51 100644 --- a/Cronner/Tasks/Parser.php +++ b/Cronner/Tasks/Parser.php @@ -47,7 +47,7 @@ public static function parsePeriod($annotation) $annotation = Strings::trim($annotation); if (Strings::length($annotation)) { if (strtotime('+ ' . $annotation) === FALSE) { - throw new InvalidParameterException("Given period parameter '" . $annotation . "' must be valid for strtotime()."); + throw new InvalidParameterException("Given period parameter '" . $annotation . "' must be valid for strtotime() with '+' sign as its prefix (added by Cronner automatically)."); } $period = $annotation; } diff --git a/README.md b/README.md index 782e5ac..98aaa9c 100644 --- a/README.md +++ b/README.md @@ -121,7 +121,9 @@ every time when Cronner runs. Not required but recommended annotation which specifies period of task execution. The period is minimal time between two executions of the task. It's value can be -anything what is acceptable for `strtotime()` function. +anything what is acceptable for `strtotime()` function. The only restriction is usability +with "+" sign before which is added by Cronner automatically. So `first day of this month` +ia not acceptable however `1 month` is acceptable. **Attention!** The value of this annotation must not contain any sign (+ or -).