2007-07-12, 05:33 AM
My suggestions are mainly for admin panel functions. musicalmidget recently approved a couple of resources I submitted that I would like to see in the core code. The main one is that the db->fetch_array() function in both db_mysql.php and db_mysqli.php use the fetch_assoc() method. There are certain SQL functions such as SUM that need to return via numerical arrays. I am not sure of the overhead that using the fetch_array() method would cause for large resultsets. Perhaps adding a second argument to the db->fetch_array() function would allow devs to have access to the functionality w/o affecting any current core code and would eliminate the chance for overhead.
example from db_mysqli.php
usage:
Since I'm not privy to the admin panel for the upcoming releases and hope I am not rehashing any old suggestions here. I noticed that some plugins need to modify the admin/index.php to add items to the menu. This is not a big problem to do, but I have no way of knowing which other plugin might be using the same menu index or item index. If the menu were stored in the db as a setting and cached similar to the plugin, a plugin dev could simply register a new item to the end of a current menu. A plugin requiring its own menu would be added to the end of menu index. Once a new plugin is installed, a fresh menu cache would be generated. This may require that no plugins would be approved that require modifying admin/index.php.
Lastly, I would like to see a hook to the xmlhttp.php functions w/o having to modify the file and adding a new conditional. Maybe making the xmlhttp.php a class and a dev could simply extend it.
example from db_mysqli.php
function fetch_array($query,$fetch_row=false)
{
if(!$fetch_row)
return mysqli_fetch_assoc($query);
else
return mysqli_fetch_row($query);
}
//or with the possible overhead
function fetch_array($query)
{
return mysqli_fetch_array($query);
}
usage:
$query = $db->simple_select( ..... );
$result = $db->fetch_array($query,true);
Since I'm not privy to the admin panel for the upcoming releases and hope I am not rehashing any old suggestions here. I noticed that some plugins need to modify the admin/index.php to add items to the menu. This is not a big problem to do, but I have no way of knowing which other plugin might be using the same menu index or item index. If the menu were stored in the db as a setting and cached similar to the plugin, a plugin dev could simply register a new item to the end of a current menu. A plugin requiring its own menu would be added to the end of menu index. Once a new plugin is installed, a fresh menu cache would be generated. This may require that no plugins would be approved that require modifying admin/index.php.
Lastly, I would like to see a hook to the xmlhttp.php functions w/o having to modify the file and adding a new conditional. Maybe making the xmlhttp.php a class and a dev could simply extend it.