[ewiki] EWIKI_DB_F_POST

Hey,

for any regex being slow I understand the problem, but I think you
could easily do quick string checks to get around the separation
problem here (and use regexs only as fallback).

The problem with the {flags} I actually see is, that you cannot easily
do a SEARCH on this, because it can only search for one value but not
for bit representations. (multiple other page flags could be combined
with your new EWIKI_DB_F_POST flag -> multiple possible values).

A nice trick I could however recommend is to SEARCH against something
in the serialized {meta} field. For example there is a $meta["class"]
with values of "image" and "binary" (and also "calendar"??) currently.
To separate such things out of the database one would start a search
this way:

$serstr = serialize( array("class"=>"thread_post") ); #-- or "hardcoded"
$result = ewiki_database("SEARCH", array("meta"=>$serstr));

If you now wish to separate out posts for just one page, you could
invent another {meta} field to SEARCH for afterwards (the "class"
entry was the wrong place to combine $id with "_THREAD" or "_POST").

> The flag would be a fine permanent solution to my mind.  The regex seems
> like too much of a workaround to be left permanently. 

And there is always the option to use both methods ;)

#

>       Good example.  Lets imagine an auth plugin written naïvely to delete
> this kind of meta data from $data when the action is "info."  This same
> plugin is accompanied by an administrative plugin in view_append that
> ...
> kind of unexpected effect I suggest that we either decide not to allow data
> mangling in the ewiki_auth() plugins or not pass $data by reference to
> ewiki_control_links().  Probably it would be better to leave the mangling to
> a handler function since they are better positioned in the call scheme of
> things.  What do you think?

I think this is just a design decision. There are various plugin hooks
to use for auth and $data handling, and everyone should be free to
choose one of them or to hook a plugin into all at once. From my point
of view the ["auth_perm"] is not very different from ["handler"], and
most other plugin hooks look alike.
The $data["meta"] mangling was just an idea and not a recommendation;
and finallly one can write unclean plugins for any of the hooks, that
has nothing to do with ewiki_auth() IMO.


G,
mario


Other related posts: