Skip to content

Instantly share code, notes, and snippets.

@betweenbrain
Created July 2, 2013 16:05
Show Gist options
  • Save betweenbrain/5910633 to your computer and use it in GitHub Desktop.
Save betweenbrain/5910633 to your computer and use it in GitHub Desktop.
Manually parse Joomla! 1.5 plugin database field [name=value\n]
$plugins = new stdClass();
$pluginsData = explode("\n", $item->plugins);
foreach ($pluginsData as $pluginData) {
$parts = explode("=", $pluginData);
if ($parts[0]) {
$name = $parts[0];
$value = $parts[1];
$plugins->$name = $value;
}
}
$item->plugins = $plugins;
# Prefered method #
$plugins = (object) parse_ini_string($item->plugins, FALSE, INI_SCANNER_RAW);
$item->plugins = $plugins;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment