PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Structures » Structures_DataGrid » Bug #6582

malfunction sort

Details

Submitted2006-01-25 17:18 UTC
Fromfrenky dot pv at atlas dot cz
Assignedwiesemann
StatusClosed
PackageStructures_DataGrid
PHP Version5.1.2
OSWinXP
Roadmaps(Not assigned)

Comments

[2006-01-25 17:18 UTC] frenky dot pv at atlas dot cz

Description:
------------
Structures_DataGrid 0.6.3 beta
file: Structures\DataGrid\DataSource\Array.php

bad code:
function sort($sortField, $sortDir, $ar = array())

good code:
function sort($sortField, $sortDir, &$ar = array())

[2006-01-25 20:00 UTC] at php dot net

This bug has been fixed in CVS.

If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET).

If this was a problem with the pear.php.net website, the change should be live shortly.

Otherwise, the fix will appear in the package's next release.

Thank you for the report and for helping us make PEAR better.

---
Please choose the right package next time, 'Documentation' is the wrong one.

[2006-02-01 22:39 UTC] olivierg at php dot net

I think this DataSource_Array::staticFetch() method is not a good idea.

Actually, only the DB driver used this, where the CSV, RSS and XML drivers extend the DataSource_Array to achieve the same result. That's not coherent.

For now, I think, that the DB driver should simply work like the CSV, RSS and XML drivers, by subclassing DataSource_Array.

This way, the staticFetch() method and this third $ar parameter to DataSource_Array::sort() can be removed. I don't think that this will cause BC breaks, because these were some sort of internal DataGrid optimization, and not part of the official datasource driver interface.

The basic optimization idea was not to subclass DataSource_Array, which already subclasses DataSource_Common, because the class tree is getting big.

But I believe that this optimization is not really necessary, and anyway that's not a good way to achieve it. If we really want to do such optimization, then we can move the DataSource_Array routines into DataSource_Common.