فهرست منبع

Only perform these actions if the directory exists during the install.

Mark Crane 11 سال پیش
والد
کامیت
a487b8b055
1فایلهای تغییر یافته به همراه22 افزوده شده و 14 حذف شده
  1. 22 14
      resources/install.php

+ 22 - 14
resources/install.php

@@ -1261,27 +1261,35 @@ if ($_POST["install_step"] == "3" && count($_POST) > 0 && strlen($_POST["persist
 				clearstatcache();
 
 			//copy resources/templates/conf to the freeswitch/conf dir
-				$src_dir = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/resources/templates/conf";
-				$dst_dir = $switch_conf_dir;
-				if (is_readable($dst_dir)) {
-					$install->recursive_copy($src_dir, $dst_dir);
+				if (file_exists($switch_conf_dir)) {
+					$src_dir = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/resources/templates/conf";
+					$dst_dir = $switch_conf_dir;
+					if (is_readable($dst_dir)) {
+						$install->recursive_copy($src_dir, $dst_dir);
+					}
+					//print_r($install->result);
 				}
-				//print_r($install->result);
 
 			//create the dialplan/default.xml for single tenant or dialplan/domain.xml
-				require_once "app/dialplan/resources/classes/dialplan.php";
-				$dialplan = new dialplan;
-				$dialplan->domain_uuid = $_SESSION["domain_uuid"];
-				$dialplan->domain = $domain_name;
-				$dialplan->switch_dialplan_dir = $switch_dialplan_dir;
-				$dialplan->restore_advanced_xml();
-				//print_r($dialplan->result);
+				if (file_exists($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/app/dialplan")) {
+					require_once "app/dialplan/resources/classes/dialplan.php";
+					$dialplan = new dialplan;
+					$dialplan->domain_uuid = $_SESSION["domain_uuid"];
+					$dialplan->domain = $domain_name;
+					$dialplan->switch_dialplan_dir = $switch_dialplan_dir;
+					$dialplan->restore_advanced_xml();
+					//print_r($dialplan->result);
+				}
 
 			//write the xml_cdr.conf.xml file
-				xml_cdr_conf_xml();
+				if (file_exists($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/app/xml_cdr")) {
+					xml_cdr_conf_xml();
+				}
 
 			//write the switch.conf.xml file
-				switch_conf_xml();
+				if (file_exists($switch_conf_dir)) {
+					switch_conf_xml();
+				}
 		}
 
 	//login the user account