⌈⌋ branch:  freshcode


Check-in [3947abfec3]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
SHA1:3947abfec3e85b803166016b24d2ee6cf4d2e7c7
Date: 2014-11-25 16:48:34
User: mario
Comment:Add allowed `,` separator to cron specifiers.
Tags And Properties
  • branch=trunk inherited from [82405bb421]
  • sym-trunk inherited from [82405bb421]
Context
2014-11-25
16:49
[d940e511cb] Five tags maximum copied per tweet (still shuffled), JSON API debug msg. (user: mario, tags: trunk)
16:48
[3947abfec3] Add allowed `,` separator to cron specifiers. (user: mario, tags: trunk)
16:48
[5d57a1e1ed] Add #flags/#incoming count to stats (for moderators). (user: mario, tags: trunk)
Changes

Changes to cron.daily/_cronjobs.php.

23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
foreach (glob(__DIR__."/*.*") as $fn) {

    // coarse plugin meta data extraction
    preg_match_all("~ ^ [#/*\h]+ (?:x-)? (cron|title|description|version|type): \h* (\V+)  ~mix", file_get_contents($fn), $m);
    $m = array_change_key_case(array_combine($m[1], $m[2] ));

    // assert existing `cron:` specifier
    if (!empty($m["cron"]) and preg_match("~^([*/\d-]+(\h+|$)){5}$|^@(daily|hourly|midnight)$~", $m["cron"] = stripcslashes($m["cron"]))) {
       $CRONTAB .= "\n"
                .  "#-- $m[title]\n#   ($m[description])\n"
                .  "$m[cron] "
                .  "nice "
                .  pathinfo($fn, PATHINFO_EXTENSION)
                .  " $fn\n";
    }
    
}

// install new crontab
fwrite(popen("crontab", "w"), $CRONTAB);







|












23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
foreach (glob(__DIR__."/*.*") as $fn) {

    // coarse plugin meta data extraction
    preg_match_all("~ ^ [#/*\h]+ (?:x-)? (cron|title|description|version|type): \h* (\V+)  ~mix", file_get_contents($fn), $m);
    $m = array_change_key_case(array_combine($m[1], $m[2] ));

    // assert existing `cron:` specifier
    if (!empty($m["cron"]) and preg_match("~^([*/\d,-]+(\h+|$)){5}$|^@(daily|hourly|midnight)$~", $m["cron"] = stripcslashes($m["cron"]))) {
       $CRONTAB .= "\n"
                .  "#-- $m[title]\n#   ($m[description])\n"
                .  "$m[cron] "
                .  "nice "
                .  pathinfo($fn, PATHINFO_EXTENSION)
                .  " $fn\n";
    }
    
}

// install new crontab
fwrite(popen("crontab", "w"), $CRONTAB);