Re: system_checks PECL extension proposal

From: Date: Sun, 06 Jun 2004 21:11:51 +0000
Subject: Re: system_checks PECL extension proposal
References: 1  Groups: php.pecl.dev 
Request: Send a blank email to pecl-dev+get-737@lists.php.net to get a copy of this message
Wez, Funny you should mention this. After heading to bed this morning, I thought of almost the exact same thing (only difference was I was thinking sysident and not sysinfo). I actually also came up with about 5-10 more functions I think would be good to implement. Following along the lines of your sysinfo idea, I can probably come up with even more. I personally would love a cross platform way to do things like system load checking, available memory checking, etc. without resorting to expensive calls. Let me know what you think about this latter part, and I will revise my proposal. I personally would prefer to implement all of this in the extension instead of depending on an external third-party library of any sort, because I have found that requiring a certain library usually causes more trouble to maintain and get people to adopt. Hopefully you all agree that is the best approach. Jeremy On Sunday 06 June 2004 10:45 am, Wez Furlong wrote: > Hi Jeremy, > > An interesting extension; I take it you are planning to use it for run-time > licensing checks of some kind? > > I think a better name for the extension would be something like sysinfo, > and have the functions named sysinfo_check_mac(), sysinfo_get_mac(), > sysinfo_get_ip(), sysinfo_get_hd_serial() and so on. The sysinfo_get_xxx() > functions could return arrays with one element per interface. > > This gives you (and the user) more scope for other similar systemsy things > in the future. > > You might want to check out the netools extension and library too, as I > think there is some overlap with some of these things, and it is also > portable to other platforms than Linux. I would like to see a PHP native > extension with these functions and not dependent on a weird external > library ;-) > > --Wez. > > > -----Original Message----- > > From: Jeremy Johnstone [mailto:jsjohnst@altdns.net] > > Sent: 06 June 2004 12:27 > > To: pecl-dev@lists.php.net > > Subject: [PECL-DEV] system_checks PECL extension proposal > > > > Hello Everyone, > > > > I have written a new extension which I would like to submit > > to PECL. If memory > > serves I already have a PECL account, so I don't know what > > the procedure is > > from here. The extension is still a work in progress, but I > > feel it could use > > a little peer review to make sure I am not going out in left > > field on how I > > am implementing things. > > > > Extension Name: system_checks > > Function names: > > system_check_mac() (already implemented) > > system_check_ip() (coming soon) > > system_check_http_hostname) (coming soon) > > system_check_hd_serial (coming soon) > > URL to download: > > > > > > http://www.jeremyjohnstone.com/ext/php_system_checks_extension > > -0.33.tar.bz2 > > > > > > In case it isn't obvious from the above, the extension > > provides facilities to > > positively identify (at least as close as possible) the > > machine which the > > script is running on. > > > > The system_check_mac() is already implemented and accepts a > > MAC address in the > > format of "00:00:00:00:00:00" as it's only parameter. It then > > returns back a > > boolean to indicate whether that MAC address belongs to any > > interface on the > > local machine. > > > > The system_check_ip() and system_check_http_hostname() > > functions accept no > > parameters and return back the IP and hostname of the > > currently running > > script. They are to be used in place of $_SERVER["SERVER_ADDR"] and > > $_SERVER["HTTP_HOST"] respectively, since both variables are > > not reliable for > > system identification because they can be changed from userland code. > > > > The system_check_hd_serial() will take one parameter and > > search the serial > > numbers of all the HD's in the system. If a match is found, > > it will return > > return back a boolean TRUE, and FALSE otherwise as would be expected. > > > > Right now this extension will only work on *nix systems > > (tested on multiple > > versions of Linux so far), but I hope to add Windows support > > with a little > > help. I have written code which will work for Windows, just > > need help with > > integrating it with PHP. > > > > I apologize for the long email, but I like to be as thorough > > as possible. > > > > Looking forward to feedback, > > > > Jeremy Johnstone > > > > -- > > PECL development discussion Mailing List (http://pecl.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.pecl.dev (#737) next »