[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
I've been busy
For those not aware of what's been going on exaclt, I've been very busy. I'm going to
summarize what I've done the past few days:
1) Major re-write of core object code to resolve problems inherent in my former design.
Problems surfaced that could not be easily resolved or circumvented several days ago. The
first factor that led me to realize this was the fact that we could not test flags on children
of objects. "BIG" problem. There were other issues as well, and no easy way to solve any of
them as they all related to the fact that there was no easy way to return a group of objects
from the DB... and thus children were stored as arrays within objects. This did not provide
all the functionality we needed.
So - all object initialization code (the stuff that built an object from values in the DB) was
REMOVED from the actual object class itself. Thus making objects no longer responsible for
initializing themselves. There init is now done by external functions, like fetch_object().
After that, I re-wrote the init code so that all init-related functions accepted either one
object ID, or an array of object ID's. If passed a single ID, they return a single object.
If passed an array of ID's, they return an array of objects. This was the largest undertaking
of the re-write. I then re-wrote the child init functions to aquire an object's children
through the standard fetch_object() function. Now, children are stored as objects within the
parent object itself. To complete this, I then had to re-write all child-manipulation and
navigation functions. functions such as $object->nect("author") and
$object->last("article")... so that they all now deal with the objects instead of Arrays.
AND, each child also now has all the member functions that the parent (original object) has...
because they are objects themselves.
So now.. flag tests on children are done like:
$article->first("author");
if ($article->author->flag_isset("disabled")) {
don't show it;
}
This works the same for all children now (I fixed some flag bugs in the process too).
Similarly, if you want the name of that first author under the article you get it by:
$article->first("author");
echo $article->author->name;
next one would be:
$article->next("author");
echo $article->author->name;
until you reached $article->list_count("author");
This is also the same for things like $kbcontainer->subcontainer... etc.
****************************** IMPORTANT **************************
One of the biggest, hardest to detects changes in this release of functions.php3 - even though
minor it can screw you - is this fact:
$object->commit();
That line used to update all the values for $object and store them in the DB. No longer the
case. It will still store all new values to the DB, but current values will remain the same.
This has the biggest impact when creating new objects, because you most likely rely on
$object->objectid and other properties to be updated upon a commit(). There is an easy
alternative. commit() now RETURNS the updated object. So ALL OF YOUR exisiting code will
still work if you change the above example to:
$object = $object->commit();
$object will then take on all the new properties. Make sure NOT TO MISS THIS. I can't stress
enough.
All the various pages I have written have already been updated.
2) Site re-design.
Yes, we finally got a face-lift. The old design that I had pioneered was created year(s?)
ago... and wasn't quite built for our evolved underlying design. I made some modifications.
It's a lot to explain here... so PLEASE GO LOOK at dev.linuxkb.org:81 and see for yourself...
come back with suggestions/comments/questions.
********************************* Developers Note ************************************
I also updated the DB in some pretty major ways. SO... to get up to the latest on
everything... be SURE to do your cvs updates, AND update your DB... from the newer stuff on
the server...
As usual - send questions, comments, and whatever else you have regarding any of this... or
the universe... my way :) I'll be over-joyed to discuss. Thanks!
--
Jason Pincin
Linux Knowledge Base Project Leader (http://www.linuxkb.org)
http://vodka.linuxkb.org/~chardros