Re: small static OO wrapper for include path

From: Date: Fri, 27 Nov 2009 23:17:11 +0000
Subject: Re: small static OO wrapper for include path
References: 1  Groups: php.pecl.dev 
Request: Send a blank email to pecl-dev+get-6857@lists.php.net to get a copy of this message
> Od: Alexey Zakhlestin <indeyets@gmail.com> > Předmět: Re: [PECL-DEV] small static OO wrapper for include path > Datum: 27.11.2009 21:27:20 > ---------------------------------------- > On 27.11.2009, at 19:21, koubel wrote: > > > Hello, > > I have made small wrapper for include path manipulation. > > Extension has currently these static methods: > > > > IncPath::add($path); > > IncPath::remove($path); > > IncPath::setByArray(array $paths); > > IncPath::getPathArray(); > > > > I'll add to set() get() as aliases (if PHP_METHOD can be alias) for > set_include_path(), get_include_path(). > > mercurial repository: http://hg.mirin.cz/phpincpath/ > > > > I'm beginner in the PHP extension writing and also i C programming. I had > little bit troubles with zval_dtors and other > > memory management function when I was write this one, so can you make some > revisions and suggestions for improvements? > > Can I use pecl repository for maintain this one? > > well, sure you can > > the only question I have: why do you implement it in C? seems like a trivial > task for php-implementation Yes, definitely, making this wrapper in php is trivial. I made this in C because I think that handling include path this way (add, remove in particular) is what is missing in php core. See user comments in set_include_path page. I saw it also in many cases in userspace code. PECL can be good starting point for adoption this from core developers lately :). I like OOP wrappers with exception handling.

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