[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Again - Perl: DB.PHP.Cache
Quick Q (read below)
On Tue, 16 Nov 1999, Jason Pincin wrote:
> On Tue, Nov 16, 1999 at 09:46:03AM -0800, Aaron Turner wrote:
> > Maybe I need another cup o' joe. To make sure we're on the same page, can
> > you maybe do a few example lines of output of the script based on the
> > actual values of the DB? Just so I can see what you want you want me to
> > take and how to output it. I think I get it, but I'd hate to find out
> > that I'm doing it all wrong. :-)
>
>
> Sure. Lets take $OBJECT_TYPES and $TYPE_PROPERTIES
>
> 1) select * from ObjectTypes;
> This returns a few records, lets take 2 of them:
>
> ObjectTypeId | ObjectTypeName | ObjectTypeDesc | ValidChildren | etc...
> | | | |
> 1 | KB Root | Root Cont ... | 3 | ...
> 2 | User Root | Root Cont ... | 4 | ...
>
> 2) Next step - create $OBJECT_TYPES which is just an array of valid Type
> ID's:
>
> $OBJECT_TYPES[0] = 1;
> $OBJECT_TYPES[1] = 2;
> ...
>
> 3) Create $TYPE_PROPERTIES which will define everything else about an
> ObjectType, and the key of the array will be equal to the ObjectTypeID:
>
> $TYPE_PROPERTIES[1]["Name"] = "KB Root";
> $TYPE_PROPERTIES[1]["Desc"] = "Root Cont...";
> $TYPE_PROPERTIES[1]["ValidChildren"] = "3";
> ... etc for all properties of a type ...
Ok, I get this whole thing. Question is what is the point of
$OBJECT_TYPES if you can just iterate $TYPE_PROPERTIES to get the
ObjectTypeId's-- seems a bit redundant to me. Maybe I'm thinking too much
Perl, but I assume that PHP can do that too.
--
Aaron Turner, Core Developer http://vodka.linuxkb.org/~aturner/
Linux Knowledge Base Organization http://linuxkb.org/
Because world domination requires quality open documentation.
aka: aturner@vicinity.com, aturner@pobox.com, ion_beam_head@ashtech.net