Browse Source

Update get methods function to skip unknown classes
If a class is removed from the project and the auto_loader has not removed the cached classes and functions, the ReflectionClass will trigger a fatal error. This update will now skip the class.

Tim Fry 6 months ago
parent
commit
436bb97f80
1 changed files with 8 additions and 1 deletions
  1. 8 1
      resources/get_php_methods.php

+ 8 - 1
resources/get_php_methods.php

@@ -16,8 +16,15 @@ foreach ($classes_to_scan as $class => $path) {
 		continue;
 	}
 
-	// Skip internal classes
+	// Guard against removed classes
+	if (!class_exists($class)) {
+		continue;
+	}
+
+	// Create the RefectionClass for inspecting class
 	$ref = new ReflectionClass($class);
+
+	// Skip internal classes
 	if ($ref->isInternal()) {
 		continue;
 	}