Zachary Kotlarek 12 лет назад
Родитель
Сommit
3cbd263338
1 измененных файлов с 6 добавлено и 2 удалено
  1. 6 2
      backup/scanLocal.php

+ 6 - 2
backup/scanLocal.php

@@ -129,7 +129,9 @@ foreach ($FILES as $FILE) {
 		if ($TYPE == 'other') {
 		if ($TYPE == 'other') {
 			die('Unknown file type: ' . $PATH . ': ' . $NAME . '^' . $EXT . "\n");
 			die('Unknown file type: ' . $PATH . ': ' . $NAME . '^' . $EXT . "\n");
 		}
 		}
-		echo 'Adding: ' . $PATH . ': ' . $TYPE . "\n";
+		if ($DEBUG) {
+			echo 'Adding: ' . $PATH . ': ' . $TYPE . "\n";
+		}
 		$insert->execute(array(':base' => $BASE_LOCAL, ':path' => $FILE, ':type' => $TYPE));
 		$insert->execute(array(':base' => $BASE_LOCAL, ':path' => $FILE, ':type' => $TYPE));
 		if ($insert->rowCount() != 1) {
 		if ($insert->rowCount() != 1) {
 			print_r($insert->errorInfo());
 			print_r($insert->errorInfo());
@@ -159,7 +161,9 @@ foreach ($FILES as $FILE) {
 		$hash_time_check->execute(array(':base' => $BASE_LOCAL, ':path' => $FILE, ':mtime' => $MTIME));
 		$hash_time_check->execute(array(':base' => $BASE_LOCAL, ':path' => $FILE, ':mtime' => $MTIME));
 		$result = $hash_time_check->fetch(PDO::FETCH_ASSOC);
 		$result = $hash_time_check->fetch(PDO::FETCH_ASSOC);
 		if ($result) {
 		if ($result) {
-			echo 'Adding hash: ' . $PATH . "\n";
+			if ($DEBUG) {
+				echo 'Adding hash: ' . $PATH . "\n";
+			}
 			$HASH = trim(shell_exec('md5sum ' . escapeshellarg($PATH) . ' | cut -d " " -f 1'));
 			$HASH = trim(shell_exec('md5sum ' . escapeshellarg($PATH) . ' | cut -d " " -f 1'));
 			if (strlen($HASH) == 32) {
 			if (strlen($HASH) == 32) {
 				$set_hash->execute(array(':base' => $BASE_LOCAL, ':path' => $FILE, ':hash' => $HASH));
 				$set_hash->execute(array(':base' => $BASE_LOCAL, ':path' => $FILE, ':hash' => $HASH));