Created
July 11, 2012 15:28
-
-
Save e2thex/3091134 to your computer and use it in GitHub Desktop.
PluginFactory::checkPluginMeta
This file contains hidden or 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
| /** | |
| * Recursive function to search the meta data | |
| * | |
| * @param $plugin_info | |
| * @param $property | |
| * this can be a string or a array of tree keys | |
| * @param $value | |
| * | |
| * @return bool | |
| */ | |
| protected function checkPluginMeta($plugin_info, $property, $value) { | |
| $tree = array(); | |
| if (is_array($property)) { | |
| $tree = $property; | |
| $property = array_shift($tree); | |
| } | |
| foreach ($plugin_info as $plugin_info_key => $plugin_info_value) { | |
| if ($plugin_info_key == $property) { | |
| if($tree) { | |
| return $this->checkPluginMeta($plugin_info[$plugin_info_key], $tree, $value); | |
| } | |
| else if ($plugin_info_value == $value) { | |
| return TRUE; | |
| } | |
| } | |
| } | |
| return FALSE; | |
| } |
jec006
commented
Jul 11, 2012
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment