Re: [phplib-users] phplib and bookmarker - some progress...
Brought to you by:
nhruby,
richardarcher
From: Lindsay H. <fmo...@fm...> - 2009-12-12 06:20:28
|
On Fri, 2009-12-11 at 23:38 -0500, A. F. Cano wrote: > Mmm... So I installed PEAR and read quite a bit of the docs, but the > class names don't have a 1 to 1 relationship with the phplib classes. No, and the PEAR equivalent classes are much more sophisticated, with a lot more hooks. PHPlib wasn't a model or a guide when PEAR classes were written. Many times PEAR is overkill for a simple job, which is why I wrote the fmplib classes, which overlay the PHPlib API over the PEAR API. > As I was looking at something simpler than a rewrite, like replacing > class names with the newer ones from PEAR, this option got pushed to > the back burner. No, there's no such correspondence, for better or worse. > > have installed code which depends on PHPlib. I've been migrating some > > of this code to PEAR <http://pear.php.net/> routines and class by > > writing libraries which mimic the PHPlib API but rely on PEAR for their > > functionality. See <http://www.fmp.com/fmp/fmp_include/>. All the > > I downloaded these right away and as they were closer to what bookmarker > depended on, it was easier to replace class names, but then I got into > other problems, like functions that don't exist in the fmp_include > files, so it was back to square 1. The fmplib classes emulate a very large subset of the equivalent PHPlib classes. If there's something missing in them, I hope I've written the code clearly enough so that you, or anyone, could easily extend the functionality of these classes as needed. > > ... > > Check out Krumo at <http://sourceforge.net/projects/krumo/>. You'll > > find it a big help. I still find, though, that using print or echo > > calls sprinkled throughout a PHP script has its place :-) > > This was good. I installed it and it's been helping debug the problem, > in combination with print statements. I ended up installing the latest > version of phplib where bookmarker expects it, but I'm having the same > problem as with the old version. The login screen never lets me > through. With some print statements I've found that the global > variables in the php code $username and $password are not set. The > values are entered with some javascript code in a template form. Check your php.ini file and see if register_long_arrays = On or Off. This setting controls whether PHP recognizes the global arrays $HTTP_GET_VARS and friends or only the newer $_GET superglobal. PHPlib uses lots of long arrays, but modern PHP installations frequently have this variable set off. You can either turn it on, or convert the PHPlib scripts to use short arrays. I wrote a couple of conversion utilities which are available at <http://www.fmp.com/downloads/>. php_long_arrays.py converts long arrays to short arrays in code, and php_tags.py converts short PHP tags ("<?") to proper long tags ("<?php"). The programs are python scripts and self-doc, so they're easy to use. > Looking around I've found this: > > http://www.irt.org/script/1065.htm > > but in this case the kludgy fix does nothing. > > At the end of the javascript code there is document.login.submit() but > I haven't found this function yet. It's a javascript-driven way of submitting a form. > The commented write statements return what is expected, so the problem > is between document.login.submit() and the php global variables. > > Since this used to work in the days of php3, I wonder if something has > changed that deals with the transmission of the variables between > javascript and php at the server. The only true communication between JS and the server within the context of a page is the XMLHttpRequest object which is at the heart of AJAX technology. PHPlib doesn't use this, but simply relies on POST and GET to get values back to the server after a page submit. My guess is that your PHP installation doesn't properly recognize the long array globals mentioned above. -- Lindsay Haisley | "The difference between | PGP public key FMP Computer Services | a duck is because one | available at 512-259-1190 | leg is both the same" | http://pubkeys.fmp.com http://www.fmp.com | - Anonymous | |