Re: Directory layout of package
| From: | Tias | Date: | Mon, 14 May 2007 20:34:29 +0000 |
| Subject: | Re: Directory layout of package | ||
| References: | 1 2 | Groups: | php.pear.qa |
| Request: | Send a blank email to pear-qa+get-4309@lists.php.net to get a copy of this message | ||
I am familiar with the guidelines as written in the manual
(http://pear.php.net/manual/en/group.php#group.directory_structure, the
same content as in the link you gave).
The 2 questions I had for QA, in the last paragraph of my original email:
1) First and far mostly: Is it OK to do file renames
-> I presume the answer is 'YES, the standard is more important then
easely reviewable version information'; which is (in this case) OK for me.
2) Is Frontend_Web.php in this case a good name, or is it better to take
something like Frontend_Web_Handler.php to avoid confusion on what file
does what.
-> I'll try to explain in detail how this is 'different' then normal.
Let's take the example of Cache_Lite as suggested in the manual.
First off, the manual is not complete, in that every package has a file
'Name.php' too:
The_Package_Name
|-- Name.php
|-- Name (contains subclasses)
|...
PEAR_Frontend_Web is a webfrontend for PEAR, the default frontend is
CLI, which looks like this:
PEAR/Frontend/CLI.php (implements PEAR/Frontend.php)
Logically, my package should have (by the standard:
PEAR/Frontend/Web.php (implements PEAR/Frontend.php)
PEAR/Frontend/Web/ (contains subclasses)
PEAR/Frontend/Web/data (contains data).
So far, so good. Only, my package does not recieve its input from PEAR
itself, but throught the browser, so it needs a file that translates
_GET and _POST requests into pear requests.
The file that handles user input for CLI is:
pearcmd.php (in the PEAR installation dir)
The file that handles user input for my package is (by legacy):
PEAR/WebInstaller.php
Which is a horrible name that creates confusion about its use and existence.
By explaining this in so much detail, I have come to the conclusion that
the answer is simple:
rename it to pearweb.php (in the PEAR installation dir)
I guess I found the answer to my 2 questions : ) Mark, thanks for the
email, altough I found it rather... obvious, it did result in what I was
looking for ; )
Tias
Mark Wiesemann wrote:
> Hi Tias,
>
> Tias wrote:
>> Hi QA peepz,
>>
>> A question about 'PEAR Standard' directory layouts for extreme cases:
>> Currently, the structure of PEAR_Frontend_Web, when installed, is the following:
>>
>> PEAR/WebInstaller.php
>> PEAR/Frontend/Web.php
>> PEAR/Frontend/Web/<all data files>
>>
>> The 'WebInstaller.php' file handles the _GET and _POST requests and
>> translates this into PEAR_Command actions, which call the frontend
>> implementation (Frontend/Web.php)
>>
>> Problems I have now:
>> * WebInstaller.php is a very unclear and non-standard name
>> * all data files are in Frontend/Web/, I whish to create a new PHP file, but I
>> don't want to put it between all the data.
>>
>> I was thinking of the following as a replacement layout:
>> /PEAR/Frontend_Web.php
>> /PEAR/Frontend/Web.php
>> /PEAR/Frontend/Web/Docviewer.php (the new php file)
>> /PEAR/Frontend/Web/data/<all data files>
>
> I'm not familiar with your package, but the directory structure for PEAR
> packages is explained here:
> http://pear.php.net/group/docs/20031114-pds.php
>
> Regards,
> Mark
>
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc