List Info

Thread: Comment on HTTP::HTTP_FloodControl




Comment on HTTP::HTTP_FloodControl
user name
2007-03-05 12:14:54
>> I think you should make it a PHP5 package and use
class constants
instead of defines and exceptions instead of pear errors. Or
make your
defines more standard, using a longer prefix to avoid
collisions.

Sure, among other things it will allow to use different
object-oriented
features (e.g. abstract classes for storage drivers). The
only reason
because of which I have written a PHP4 compatible code is
that many shared
hosting servers do not support PHP5 till now. I'm a novice
to PEAR
development and would like to know what version of PHP is
prefered to use
for new packages?

Also I would like to know is there any recommendations on
how to construct
name prefixes of defined constants?

>> I am also afraid $_SERVER['REMOTE_ADDR'] is not
reliable, especially if
users are behind a router/proxy (they will share the same IP
and they
might be quickly locked out on big traffic or big corporate
sites where
users all connect at the same hour in the morning...).

I agree with you on that issue, that's why I decided to
allow the users to
define a control criterion they will prefer as the second
parameter of
check() method. It may be a real IP address detected by one
of the
methods, an address of a subnet, a session identifier, a
fingerprint
calculated custom way, etc. What do you think , is it
necessary to impose
an IP detection method on the user?

-- 
PEAR Development Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php


Re: Comment on HTTP::HTTP_FloodControl
user name
2007-03-05 13:13:52
Hi,

vaghtozalakyan.com wrote:
>>> I think you should make it a PHP5 package and
use class constants
> instead of defines and exceptions instead of pear
errors. Or make your
> defines more standard, using a longer prefix to avoid
collisions.
> 
> Sure, among other things it will allow to use different
object-oriented
> features (e.g. abstract classes for storage drivers).
The only reason
> because of which I have written a PHP4 compatible code
is that many shared
> hosting servers do not support PHP5 till now. I'm a
novice to PEAR
> development and would like to know what version of PHP
is prefered to use
> for new packages?

In fact all proposed code should be E_STRICT-compatible,
effectively meaning 
PHP5 only:

http://pear.php.net/manual/en/standards.e_strict.php

You may propose a PHP4-compatible version if you wish, but
after the PHP5 
version is accepted.

-- 
PEAR Development Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php


[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )