Re: Preliminary Proposal for calculator for suntimes / moontimes

From: Date: Wed, 27 Aug 2003 16:29:16 +0000
Subject: Re: Preliminary Proposal for calculator for suntimes / moontimes
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-20653@lists.php.net to get a copy of this message
> I'd also prefer to see them inside Date. Adding two additional files > seems okay - but there is no need for a separate package - or even > two. Please talk to the devs of Date about an integration. Well, Pierre already talked to me on pear@efnet, he seems to be willing to make that inclusion... right, Pierre? :) > About suntime-functions in PHP5: > I believe even when PHP5 comes out (at the end of the year) there > will still be some (many?) PHP4 system out there for a long time. For > sure the php-functions will be faster. So could you maybe implement > detection of the php5-functions and if they exist make Sun / Moon be > a wrapper for the PHP5-functions? This way your packages would be > independent of PHP4/5 but could take advantage of the fast, internal > PHP5-functions (written in C). Ok, makes sense, but only for Sun.php, as there are no builtin functions for moon-calculations. > About your code: > Could you maybe do some cleanups in the _doCalculation-code? > Especially about all those variables. Variables should generally > start with a low-case-character afaik - and more meaningful names > might also be a good idea :-) This would make it easier to search for > errors (if any might arrise) or study the function of your class. > Maybe use some more constants as well to clear of all those integer- > / double-values in your calculations. Bluntly spoken, no: :) These are special algorithms (I don't even understand everything they're doing), and as I stated in the header, not based on my work. That was why I commented them thorougly to be comparable with the original codebase. As far as I know, this is a non-professional code, which is widely used in astronomical circles (it is referenced by the US. Navy Observatory) and though as I see, that it is in a special way not conforming to pear, I want to keep it that way, to point to its source. > Generally: > I like what you propose - and I know that they might even be useful > for other people. But I'm willing to delay my vote until the code has > been cleared up and you hopefully have arranged integration into > Date. Well, as I see it, integration into Date shouldn't be that hard, right? At least I don't need to extend to classes or things like that. The only thing, that would make sense in my eyes, would be usage of the date- and timezone-objects in the constructor, but this can be easily arranged. Regards, Alexander -- | Alexander Wirtz | eMail: mailto:alex[at]pc4p[dot]net | | PDF Class for PHP | www: http://www.pc4p.net/ | |----------------------------------------------------------------------| | Did I help you? Please consider a gift: http://www.pc4p.net/Wishlist |

« previous php.pear.dev (#20653) next »