mirror of
https://github.com/Yetangitu/ampache
synced 2025-10-06 03:49:56 +02:00
1) bug fix: in createDIDL sometimes comes single item, not array. But array is expected. And method crashes.
Fix: detect if single item is come and convert it to array 2) fix bug with "<?xml..." parse error when php option - short tags - is set 3) upnp broadcast sending page added button for automatically periodical page refresh for sending broadcast packets without cron, for development purposes 4) Plugins class optimization, method get_plugins make static cache for optimization when multiple call
This commit is contained in:
parent
fd1d06d055
commit
e75a38a007
4 changed files with 43 additions and 17 deletions
|
@ -73,7 +73,12 @@ class Plugin
|
|||
*/
|
||||
public static function get_plugins($type='')
|
||||
{
|
||||
$results = array();
|
||||
// make static cache for optimization when multiple call
|
||||
static $plugins_list;
|
||||
if (!is_null($plugins_list))
|
||||
return $plugins_list;
|
||||
|
||||
$plugins_list = array();
|
||||
|
||||
// Open up the plugin dir
|
||||
$handle = opendir(AmpConfig::get('prefix') . '/modules/plugins');
|
||||
|
@ -104,13 +109,13 @@ class Plugin
|
|||
}
|
||||
}
|
||||
// It's a plugin record it
|
||||
$results[$plugin_name] = $plugin_name;
|
||||
$plugins_list[$plugin_name] = $plugin_name;
|
||||
} // end while
|
||||
|
||||
// Little stupid but hey
|
||||
ksort($results);
|
||||
ksort($plugins_list);
|
||||
|
||||
return $results;
|
||||
return $plugins_list;
|
||||
|
||||
} // get_plugins
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue