Comments for "File_DNS"

» Submit Your Comment
Comments are only accepted during the "Proposal" phase. This proposal is currently in the "Finished" phase.
» Comments
  • Arnaud Limbourg  [2004-06-12 22:53 UTC]

    CS police:

    require_once('

    class {

    :)
  • Cipriano Groenendal  [2004-06-12 23:09 UTC]

    Another visit of the CS police! Both fixed now Arnaud :)
    Thanks for having a look :)
  • Cipriano Groenendal  [2004-06-12 23:10 UTC]

    Another visit of the CS police! Both fixed now Arnaud :)
    Thanks for having a look :)
  • Martin Jansen  [2004-06-13 09:41 UTC]

    Would it be (theoretically) possible, to extend the package to parse other formats of zone files?
  • Cipriano Groenendal  [2004-06-13 10:39 UTC]

    > Would it be (theoreticly) possible,
    > to extend the package to parse
    > other formats of zones
    Hi Martin.

    I did think about this at first, but decided to stick with the RFC1033
    style for now, figuring it's both the standard and one of the most
    widely used formats.
    In the current design also, It's not that easily possible to change to
    other formats either.
    It should, however, be possible to split the package into a
    parent-class <-> driver-based architecture such as say DB uses, and
    write a `subpackage' to handle other fileformats besides RFC1033. If
    there turns out to be demand for it, I'll surely add it aswell :)

    Thanks for having a look.
  • Michael Wallner  [2004-06-15 11:56 UTC]

    Looks great.

    Just a side note because I recently stumbled across the same in HTTP - the switch statement in parseToSeconds() could be simplified to something similar to the following:

    [code]
    $times = 1;
    switch (strtoupper($what))
    {
    case 'W':
    $times *= 7; //Week
    case 'D':
    $times *= 24; //Day
    case 'H':
    $times *= 60; //Hour
    case 'M':
    $times *= 60; //Minute
    case 'S':
    $times *= $num; //Seconds
    break;
    default:
    return PEAR::raiseError("Unable to parse time. $time",
    FILE_DNS_PARSE_TIME_FAILED,
    NULL, NULL, $time);
    break;
    }
    return $times;
    [/code]
  • Cipriano Groenendal  [2004-06-20 20:58 UTC]

    > Just a side note because I recently stumbled across
    > the same in HTTP - the switch statement in
    > parseToSeconds() could be simplified to something
    > similar to the following:
    > <snip code>
    Hi Martin.

    Verry nice code, I must say. I tried it last night, and it worked fine, and I figured I'd leave it in there.
    Yet when I woke up this morning and saw the code, I couldn't remember where the code came from, let alone figure out how it worked. Took me two coffee's the notice the missing break;'s and seeing how it'd cascade down to seconds afterall.
    As such, I figured I'd best stick with the original code. Sure, it might be a few more lines, but it makes things a lot more readable :)

    Thanks for having a look, and your code :)

    Cipri