Re: Proposal: File_Apache

From: Date: Sat, 13 Sep 2003 03:33:53 +0000
Subject: Re: Proposal: File_Apache
References: 1 2  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-21460@lists.php.net to get a copy of this message
I'd expect File_Apache_* to modify httpd.conf... File_Passwd (see other comments) File_HtGroup (see other comments) The HtAccess is interesting.. (looks like mikes class could be updated to include all of this) A few thoughts on it.. php_opts array .. = loading this on demand from an ini file seems more sensible... (mixing data/config with code seems a bit much here..) it would also benefit from being a static or global.. so print_r($htaccess); would produce something logical.. this is a good example of where getters are generally absurd, but setters, are quite essential.... I'd suggest making them all public.. - it would make the class considerably simpler to use... - remember.. - 90% of users use 10% of the features.. so you dont want to make them learn 100% of the methods before they can use it... a quick parse/print_r() is what I suspect alot of users would use it for... - more advanced users could then workout that there are setters for everything.. the bit switch/case case 'AUTHTYPE' :
                        $this->setAuthType($args);
                        break;
                    case 'AUTHNAME' :
                        $this->setAuthName($args);
                        break;
                    case 'AUTHUSERFILE' :
                        $this->setAuthUserFile($args);
                        break;
                    case 'AUTHGROUPFILE' :
                        $this->setAuthGroupFile($args);
                        break;
would work alot better with variable methods.. - you effectively have about 3 cases... case 'AUTHTYPE' :
                    case 'AUTHNAME' :
                    case 'AUTHUSERFILE' :
                    case 'AUTHGROUPFILE' :
                        $this->{'set'.$comm}($args);
                        break;
Regards Alan Marshall Roch wrote:
Mika Tuupola wrote:
The problem with File_HtAccess right now is that the base class handles authentication, which is not .htaccess's sole purpose. File_HtAccess, I think, should handle parsing (and validating?) the file, and writing new/modified directives to it.
    Huh? File_HtAccess does not do any authentication. It parses
    and writes .htaccess files and offer methods to add/modify
    directives to it.
What I meant was that the base class has methods to handle authentication-related directives. These methods should be in a class like File_HtAccess_Auth, especially if mod_rewrite directives will be in File_HtAccess_Rewite. As this package is extended to support more directives, it will become confusing to have authentication in the base class and all of the others separate.
-- Can you help out? Need Consulting Services or Know of a Job? http://www.akbkhome.com

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