[pmwiki-users] ZIP Engine

Ben Stallings Ben at InterdependentWeb.com
Tue Oct 10 10:36:46 CDT 2006


Caveman wrote,
> It's not fully tested yet, but I uploaded it to offer others a chance
> to give suggestions for improving it before I release it as a regular
> recipe.

Thanks for the opportunity!  I should try that myself sometime...

My first reaction is that the quality and quantity of documentation in 
the script are much improved.  I feel like I have a good handle on how 
the recipe works now.  Thank you!

There are still a few points I'm unclear on, such as the other valid 
value of $ZIPlock -- I'm assuming "LOCKED", but it's not stated.  If I 
set it to "locked" by mistake, would the program think it was locked or 
unlocked?  Configuration variables like this are often set to either 0 
or 1 for this reason.

Similarly, the description of the counter says "(use = to not increase 
the count)" but I'm not clear where I should use =.  I'm guessing in the 
markup, but then why is it mentioned in the code?  My two cents say that 
code documentation should explain how the code works, and instructions 
on how to use the program should be in the user documentation (i.e. the 
recipe page).  But that's just me.

Since you're using the standard PageExists(), ReadPage(), and 
UpdatePage() functions, I think this may just work with my upcoming 
DataQuery recipe without *any* additional hooks!  My only concern is 
whether there's a provision for displaying error messages that come from 
UpdatePage(), since DataQuery won't be able to update a record if the 
input form doesn't match the database table.  Looks like there's not. 
But if for example the ZIPsetpage() function said,
  return UpdatePage($d, $oldpage, $newpage);
instead of just return; then any errors returned by UpdatePage() would 
be passed along... then in the main function you'd need to say
  $m = ZIPsetpage();
or some such in order to display the error.  Similarly with 
ZIPcreatepage() and any other functions that call UpdatePage().  (Of 
course this is assuming that UpdatePage() passes along any errors it 
receives from the PageStore->write() method, but that's not your problem!)

A number of the functions are missing their global declarations.  You 
probably just haven't gotten to that yet, but here's a reminder -- I 
know I would need one if I'd just done a major overhaul like this!

On the whole, it looks great!  Mazeltov!  --Ben S.




More information about the pmwiki-users mailing list