Created
July 2, 2013 16:05
-
-
Save betweenbrain/5910633 to your computer and use it in GitHub Desktop.
Manually parse Joomla! 1.5 plugin database field [name=value\n]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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