From dd787500442ce7f2bcb6ec00f84715ffa0cbed7b Mon Sep 17 00:00:00 2001 From: Mark Crane Date: Sun, 1 Dec 2013 06:56:55 +0000 Subject: [PATCH] Fix the scripts to copy missing freeswitch scripts again. --- resources/classes/install.php | 43 +++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/resources/classes/install.php b/resources/classes/install.php index 465a71757b..a086365aed 100644 --- a/resources/classes/install.php +++ b/resources/classes/install.php @@ -55,32 +55,35 @@ include "root.php"; } } else { - //show debug info - //echo "copy(".$src."/".$file.", ".$dst."/".$file.");
\n"; + //copy only missing files + if (!file_exists($dst.'/'.$file)) { + copy($src.'/'.$file, $dst.'/'.$file); + //echo "copy(".$src."/".$file.", ".$dst."/".$file.");
\n"; + } //check the file type by ext - if (substr($file, -3) == "lua") { + //if (substr($file, -3) == "lua") { //set the exception default - $exception = false; + //$exception = false; //set the exceptions - if ($file == "database_handle.lua") { $exception = true; } + //if ($file == "database_handle.lua") { $exception = true; } //check for exceptions - if ($exception) { - //file does not exist, save a copy in the destination directory - if (!file_exists($dst.'/'.$file)) { - copy($src.'/'.$file, $dst.'/'.$file); - } - } - else { + //if ($exception) { + // //file does not exist, save a copy in the destination directory + // if (!file_exists($dst.'/'.$file)) { + // copy($src.'/'.$file, $dst.'/'.$file); + // } + //} + //else { //write over the file - copy($src.'/'.$file, $dst.'/'.$file); - } - } - else { + // copy($src.'/'.$file, $dst.'/'.$file); + //} + //} + //else { //file does not exist, save a copy in the destination directory - if (!file_exists($dst.'/'.$file)) { - copy($src.'/'.$file, $dst.'/'.$file); - } - } + //if (!file_exists($dst.'/'.$file)) { + // copy($src.'/'.$file, $dst.'/'.$file); + //} + //} } } }