Re: Presentation and question.

From: Date: Fri, 24 Jan 2003 10:07:13 +0000
Subject: Re: Presentation and question.
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-12694@lists.php.net to get a copy of this message
<luca@llucax.hn.org> wrote : > My classes are: > MP3 ID3 Tag: Sets and gets ID3 TAGs from MP3 files. > I thought it would be nice to put it on "File Formats" and > in file File/MP3/ID3.php. > > http://www.phpclasses.org/goto/browse.html/package/171.html I think we could create a MP3 directory at root for this one. I have looked at your code, this is not a class. I would recommend you rewrite it as an object with getter, setter and a parser method. While doing that, you could use PEAR coding standards. > Getopt Util: This is a utility to automatic show help messages and other > stuff to expand Console_Getopt capabilities. > I think "Console" category and Console/Getopt/Util.php woul > be great. > > http://www.phpclasses.org/goto/browse.html/package/252.html This one is under GNU GPL and requires Console/Getopt.php which is under PHP license AFAIK. It would be nice if you could change the license, but it's up to you :) Apart from that, I have seen it's all Spanish, you'll have to write it in English (error messages, documentation). I didn't look any further as I don't have the means to test it now. > Simple DB: A class to make simple ABM, searching and Listing of a DB. > I thought I can put it on "Database" and DB/Simple.php and > DB/Simple/* (now it uses DB and I'm thinking about making > it in make it a subclass of DB). > This is not public available yet. I am not sure it belongs to DB, but I will need to see what it does to tell you more. > Permissions: This is a class to set permissions based on phplib (with > bit operations). > I don't know where it can be, maybe in "Authentication"? > and in Auth/Perm.php? I don't know if it's right. > This is not public available yet. This is cool, I like bit bashing very much, I use it all the time, it makes my code unreadable :) There is a Perm directory already, this package could fit there IMO. Just show the code and how it integrates with some other packages, if it does. > Hooks: Well this is hard to explain. This is like a "magic include > file" and really is a collection of static functions. The > only way to explain it is with an example: > Hook::hook( 'myhook', 'arg1', 'arg2' ); will search in > the > include_path for a file called <pagename>-myhook.php, if > it's not founded looks for default-myhook.php, if isn't > founded looks for default-hooks/<pagename>-myhook.php and > finally for default-hooks/default-myhook.php. If any of > this files are founded it include it (and stop looking), in > the included file I have available an array called $args > with the name of the hook in $args[0] ('myhook' in the > example) and the hook arguments ('arg1' and 'arg2' in the > example), very similar to $argv. If no files are founded if > shows nothing (no error messages). There are other types of > hooks (for objects, hooks that include all the files it > found, etc). Well, as you see this is a very general and > powerfull class with many uses, so I don't know where to > put it. We use this functions to make at least 3 websites > (mostly LUGs websites: www.lugmen.org.ar, www.lugfi.org.ar > and www.mendoza-wireless.net.ar), so there are a lot of > other functions and classes using this lib (funtions to > make photo albums, event calendar, users profile and stuff > usefull for LUGs), so this is like an independent lib but > I'd like to make it PEAR friendly, so I don't know if may > it must be in a new category "Hook" or something. > There's not much documentation at the moment (at least not > in english) but here you can find the proyect sourcecode: > http://svn.llucax.hn.org:81/svn/hooks/tronco/ > You can see to one implementation in the LUGFi's website > sourcecode too: > http://svn.llucax.hn.org:81/svn/lugfi/tronco/ Just an idea, but I wonder if this could be directly integrated into PEAR.php so it would be able to solve the "require_once/library path" problem some users seem to have with their hosts ? A sort of class loader. > But this is not all (maybe I had to write this in separated messages? :) > I have a big doubt: Is there any relation between categories and > directories where classes are? I am no specialist but I don't think there is a relation between directories and categories. > Or between Directories and class > inheritance? I mean, if a file is in Dir1/Dir2/File.php means that the > class File derivates from class Dir2 wich derivates from Dir1? I'm sorry > but I don't the relation between this 3 things (maybe beacause is no > relation? :). AFAIK, this is not the case neither. But I think this will be used in the name of your class. So if your class is in Dir1/Dir2/File.php, it will be names Dir1_Dir2_File, now whether it extends something or not is up to you. > And finally, I'm behind a firewall (and not very friendly) in my work, > so I can't download packages using pear commandline tool. Is there any > way to use a proxy server to download? Or... Is there a way to make a > PEAR packages mirror using a proxy? I mean, there's a "plain" site to > download the packages like an ftp or something? Yep, both exists. Regards, Bertrand Mansion Mamasam

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