Completed
Push — v3.0 ( e28df5...5be1a9 )
by Samir
13:00
created
freeswitch/fs/lib/astpp.db.php 1 patch
Braces   +10 added lines, -8 removed lines patch added patch discarded remove patch
@@ -52,10 +52,11 @@  discard block
 block discarded – undo
52 52
      */
53 53
     public function cleanup($bind) {
54 54
         if ( ! is_array($bind)) {
55
-            if ( ! empty($bind))
56
-                $bind = array($bind);
57
-            else
58
-                $bind = array();
55
+            if ( ! empty($bind)) {
56
+                            $bind = array($bind);
57
+            } else {
58
+                            $bind = array();
59
+            }
59 60
         }
60 61
         return $bind;
61 62
     }
@@ -68,10 +69,11 @@  discard block
 block discarded – undo
68 69
         try {
69 70
             $pdostmt = $this->prepare($this->sql);
70 71
             if ($pdostmt->execute($this->bind) !== false) {
71
-                if (preg_match("/^(".implode("|", array("select", "describe", "pragma")).") /i", $this->sql))
72
-                    return $pdostmt->fetchAll(PDO::FETCH_ASSOC);
73
-                elseif (preg_match("/^(".implode("|", array("delete", "insert", "update")).") /i", $this->sql))
74
-                    return $pdostmt->rowCount();
72
+                if (preg_match("/^(".implode("|", array("select", "describe", "pragma")).") /i", $this->sql)) {
73
+                                    return $pdostmt->fetchAll(PDO::FETCH_ASSOC);
74
+                } elseif (preg_match("/^(".implode("|", array("delete", "insert", "update")).") /i", $this->sql)) {
75
+                                    return $pdostmt->rowCount();
76
+                }
75 77
             }
76 78
         } catch (PDOException $e) {
77 79
             $this->error = $e->getMessage();
Please login to merge, or discard this patch.
freeswitch/fs/lib/astpp.xml.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -154,8 +154,9 @@
 block discarded – undo
154 154
 
155 155
 		$sp_gw_settings  = json_decode($sp_gw_value['gateway_data'], true);
156 156
 			foreach ($sp_gw_settings as $sp_gw_settings_key => $sp_gw_settings_value) {
157
-				if ($sp_gw_settings_value != "")
158
-					$xml .= "           <param name=\"" . $sp_gw_settings_key . "\" value=\"" . $sp_gw_settings_value . "\"/>\n";
157
+				if ($sp_gw_settings_value != "") {
158
+									$xml .= "           <param name=\"" . $sp_gw_settings_key . "\" value=\"" . $sp_gw_settings_value . "\"/>\n";
159
+				}
159 160
 			}
160 161
 			$xml .= "       </gateway>\n";
161 162
 		}
Please login to merge, or discard this patch.
freeswitch/fs/lib/astpp.logger.php 1 patch
Braces   +11 added lines, -8 removed lines patch added patch discarded remove patch
@@ -29,22 +29,25 @@
 block discarded – undo
29 29
 	function logger($lib) {
30 30
 		$this->config = $lib->config;
31 31
 		$this->config['log_path'] = "/var/log/astpp/";
32
-		if ($this->config['debug'] == '0')
33
-			$this->fp = fopen($this->config['log_path'] . 'astpp_' . date('Y-m-d') . '.txt', 'a');
32
+		if ($this->config['debug'] == '0') {
33
+					$this->fp = fopen($this->config['log_path'] . 'astpp_' . date('Y-m-d') . '.txt', 'a');
34
+		}
34 35
 	}
35 36
 
36 37
 	function log($log) {
37 38
 		if ($this->config['debug'] == '0') {
38
-			if (is_array($log))
39
-				fwrite($this->fp, "[" . date('Y-m-d H:i:s') . "] " . print_r($log, TRUE));
40
-			else
41
-				fwrite($this->fp, "[" . date('Y-m-d H:i:s') . "] " . $log . "\n");
39
+			if (is_array($log)) {
40
+							fwrite($this->fp, "[" . date('Y-m-d H:i:s') . "] " . print_r($log, TRUE));
41
+			} else {
42
+							fwrite($this->fp, "[" . date('Y-m-d H:i:s') . "] " . $log . "\n");
43
+			}
42 44
 		}
43 45
 	}
44 46
 
45 47
 	function close() {
46
-		if ($this->config['debug'] == '0')
47
-			fclose($this->fp);
48
+		if ($this->config['debug'] == '0') {
49
+					fclose($this->fp);
50
+		}
48 51
 	}
49 52
 
50 53
 }
Please login to merge, or discard this patch.
freeswitch/fs/scripts/astpp.directory.php 1 patch
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -28,10 +28,11 @@
 block discarded – undo
28 28
 
29 29
 if (isset($_REQUEST['user']) && isset($_REQUEST['domain'])) {
30 30
 	$xml = load_directory($logger, $db);
31
-	if ($xml == "")
32
-		xml_not_found();
31
+	if ($xml == "") {
32
+			xml_not_found();
33
+	}
33 34
 	echo $xml;
34
-}else {
35
+} else {
35 36
 	xml_not_found();
36 37
 }
37 38
 $logger->log("*************************** Directory Ends **********************************");
Please login to merge, or discard this patch.