Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 2.5.1

Request #12267 some changes/correction
Submitted: 2007-10-17 20:13 UTC
From: cwiedmann Assigned: quipo
Status: Closed Package: Pager (version 2.4.4)
PHP Version: Irrelevant OS: Irrelevant
Roadmaps: (Not assigned)    
Subscription  


 [2007-10-17 20:13 UTC] cwiedmann (Carsten Wiedmann)
Description: ------------ Hallo, I've made same changes and corrections for this package (which I need...): - make urls with only a filename possible (don't prepend _fileName with a "/", if _path is empty) - correct detection of HTTPS (on IIS) - remove <u>/</u> from curPageSpanPre/Post in Pager_Sliding. (not valid xhtml strict) - add now member linktagsraw (an array for an better use with e.g. HTML_Page2::addHeadLink) which is also returned with getLinks - don't set a default _pearErrorMode if none is set in the constructor/setOptions - changes to the error handling (new member error). e.g.: | $pager = Pager::factory($pagerOpt); | if (PEAR::isError($pager->error)) {}; or | $pager = Pager::factory($pagerOpt); | if (PEAR::isError($result = $pager->build())) {} is now possible - renaming constants (PEAR coding standard) - edit some docblocks Maybe you can use something from my changes for your package. Regards, Carsten

Comments

 [2007-10-17 20:32 UTC] cwiedmann (Carsten Wiedmann)
Hello, sorry, can't upload the path in one file (more then 20k). So I have splitted it into the files: Pager.diff Common.php.1.diff Common.php.2.diff Common.php.3.diff Common.php.4.diff Jumping.php.diff Sliding.php.diff HtmlWidgets.php.diff Regards, Carsten
 [2007-10-22 21:23 UTC] quipo (Lorenzo Alberton)
Hi Carsten, first of all many thanks for your patches. Next time, please open different bug reports for different problems, so I can track them in an easier way. I've committed a lot of CS fixes already, please fetch the CVS version and tell me if I forgot any of them. I've also committed the HTTPS fix for IIS, thanks. I fail to see the purpose of "linktagsraw", though... Regarding the renaming of constants, I can change only the internal ones (done), changing the others would mean breaking BC (and that's not allowed for stable packages). The same goes for the error reporting changes. Can you open another bug report for this issue, please (ideally with a testcase or a short script describing your issue)? - "make urls with only a filename possible (don't prepend _fileName with a "/", if _path is empty)" Thanks a lot!
 [2007-10-23 00:17 UTC] cwiedmann (Carsten Wiedmann)
Hi Lorenzo, > Next time, please open different bug reports for different > problems, so I can track them in an easier way. Sorry, but you are right. I was on the way solving my main problem ("linktagsraw" ...), then I saw this and that... > I fail to see the purpose of "linktagsraw", though... Ok, you know the package HTML_Page2? Most times I use this package, but I can't add ready HTML code to the HEAD with this package. For the link tags the funktion is defined with: @see http://pear.php.net/package/HTML_Page2/docs/latest/HTML_Page2/HTML_Page2.html#methodaddHeadLink I must have the link href and title attribute in separate strings. And that's not possible at the moment with Pager. An example code (with my patched Pager): | $page = new HTML_Page2($foo); | $pager = Pager::factory($bar); | foreach ($pager->linkTagsRaw as $key => $value) { | if (!empty($value)) { | $page->addHeadLink( | $value['url'], | $key, | 'rel', | array('title' => $value['title']) | ); | } | } > The same goes for the error reporting changes. Maybe a good idea to release a new version ;-) Especially the thing with not setting a default ErrorMode. At the moment I don't know any package (which I use) which makes this. The reason is just this code which I often use during writing and debugging scripts: | require_once 'PEAR.php'; | require_once 'PEAR/Exception.php'; | function PEAR_ErrorToPEAR_Exception ($error) { | try { | eval( | 'throw new PEAR_Exception($error->getDebugInfo(), $error);' | ); | } catch (PEAR_Exception $error) { | die($error); | } | } | PEAR::setErrorHandling( | PEAR_ERROR_CALLBACK, | 'PEAR_ErrorToPEAR_Exception' | ); (and I don't want think about, if I must set the ErrorMode in a class option for special classes. ;-) ) > Can you open another bug report for this issue > (don't prepend _fileName with a "/", if _path is empty) Ok, I will do this with a testcase shortly. Regards, Carsten
 [2007-12-01 18:20 UTC] quipo (Lorenzo Alberton)
Hi Carsten, I believe I have addressed all the issues that didn't break BC. I committed $linkTagsRaw to CVS :-)