Просмотр исходного кода

Add $y = 0; and a try catch block to the menu.

Mark Crane 10 лет назад
Родитель
Сommit
b2f5f1e082
1 измененных файлов с 14 добавлено и 6 удалено
  1. 14 6
      resources/classes/menu.php

+ 14 - 6
resources/classes/menu.php

@@ -51,9 +51,10 @@
 					$db = $this->db;
 
 				//get the $apps array from the installed apps from the core and mod directories
-					$config_list = glob($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH . "/*/*/app_menu.php");
-					$x=0;
+					$config_list = glob($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH . "/*/*/app_{config|menu}.php");
+					$x = 0;
 					foreach ($config_list as &$config_path) {
+						$y = 0;
 						try {
 							include($config_path);
 							$x++;
@@ -210,11 +211,18 @@
 					$db->beginTransaction();
 
 				//get the $apps array from the installed apps from the core and mod directories
-					$config_list = glob($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH . "/*/*/app_menu.php");
-					$x=0;
+					$config_list = glob($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH . "/*/*/app_{config|menu}.php");
+					$x = 0;
 					foreach ($config_list as &$config_path) {
-						include($config_path);
-						$x++;
+						$y = 0;
+						try {
+							include($config_path);
+							$x++;
+						}
+						catch (Exception $e) {
+							echo 'exception caught: ' . $e->getMessage() . "\n";
+							exit;
+						}
 					}
 
 				//use the app array to restore the default menu