diff --git a/includes/registry.inc b/includes/registry.inc
index 3fb14fb..6e4203d 100644
--- a/includes/registry.inc
+++ b/includes/registry.inc
@@ -165,11 +165,15 @@ function _registry_parse_files($files) {
  *   (optional) Weight of the module.
  */
 function _registry_parse_file($filename, $contents, $module = '', $weight = 0) {
+  $namespace = '';
+  if (preg_match_all('/^\s*(?:namespace)\s+([a-zA-Z0-9_\\\\]+)/m', $contents, $matches)) {
+    $namespace = reset($matches[1]) . '\\';
+  }
   if (preg_match_all('/^\s*(?:abstract|final)?\s*(class|interface)\s+([a-zA-Z0-9_]+)/m', $contents, $matches)) {
     $query = db_insert('registry')->fields(array('name', 'type', 'filename', 'module', 'weight'));
     foreach ($matches[2] as $key => $name) {
       $query->values(array(
-        'name' => $name,
+        'name' => $namespace . $name,
         'type' => $matches[1][$key],
         'filename' => $filename,
         'module' => $module,
