/** * Loads a xml file directly from package or subpackage * Without concern about WHERE it is * * PhpBURN::loadXMLMapping('phpburn.super.model.Users'); * Will look for phpburn directory / super / model / mapping / Users.xml * * @return String * @return Boolean */ public static function loadXMLMapping() { $args = func_get_args(); foreach ($args as $configname) { $lines = explode('.', $configname); $config = PhpBURN_Configuration::getConfig($lines[0]); $basedir = $config->class_path; $length = count($lines); $newpath = ""; foreach ($lines as $key => $value) { if ($key == $length - 1) { $newpath .= "_mapping" . DIRECTORY_SEPARATOR . $value . ".xml"; } else { $newpath .= $value . DIRECTORY_SEPARATOR; } } $filepath = $basedir . $newpath; if (file_exists($filepath)) { return PhpBURN::loadFile($filepath); } else { return "error"; } } }