Completed
Push — 1.10.x ( ba0bf0...97c0d2 )
by Angel Fernando Quiroz
44:06
created
main/inc/lib/phpdocx/lib/log4php/appenders/LoggerAppenderPDO.php 1 patch
Indentation   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 
49 49
     /** Create the log table if it does not exists (optional).
50 50
      * @var string */
51
-	private $createTable = true;
51
+    private $createTable = true;
52 52
     
53 53
     /** Database user name.
54 54
      * @var string */
@@ -101,9 +101,9 @@  discard block
 block discarded – undo
101 101
         $this->requiresLayout = false;
102 102
     }
103 103
     
104
-	public function __destruct() {
105
-       $this->close();
106
-   	}
104
+    public function __destruct() {
105
+        $this->close();
106
+        }
107 107
    	
108 108
     /**
109 109
      * Setup db connection.
@@ -114,14 +114,14 @@  discard block
 block discarded – undo
114 114
      */
115 115
     public function activateOptions() {
116 116
         try {
117
-        	if($this->user === null) {
118
-	           	$this->db = new PDO($this->dsn);
119
-    	   } else if($this->password === null) {
120
-    	       $this->db = new PDO($this->dsn, $this->user);
121
-    	   } else {
122
-    	       $this->db = new PDO($this->dsn,$this->user,$this->password);
123
-    	   }
124
-    	   $this->db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
117
+            if($this->user === null) {
118
+                    $this->db = new PDO($this->dsn);
119
+            } else if($this->password === null) {
120
+                $this->db = new PDO($this->dsn, $this->user);
121
+            } else {
122
+                $this->db = new PDO($this->dsn,$this->user,$this->password);
123
+            }
124
+            $this->db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
125 125
     	
126 126
             // test if log table exists
127 127
             try {
@@ -136,12 +136,12 @@  discard block
 block discarded – undo
136 136
                 // The syntax should at least be compatible with MySQL, PostgreSQL, SQLite and Oracle.
137 137
                 $query = "CREATE TABLE {$this->table} (".
138 138
                             "timestamp varchar(32)," .
139
-            				"logger varchar(64)," .
140
-            										"level varchar(32)," .
141
-            				"message varchar(9999)," .
142
-            										"thread varchar(32)," .
143
-            				"file varchar(255)," .
144
-            				"line varchar(6))";
139
+                            "logger varchar(64)," .
140
+                                                    "level varchar(32)," .
141
+                            "message varchar(9999)," .
142
+                                                    "thread varchar(32)," .
143
+                            "file varchar(255)," .
144
+                            "line varchar(6))";
145 145
                 $result = $this->db->query($query);
146 146
             }
147 147
         } catch (PDOException $e) {
@@ -197,12 +197,12 @@  discard block
 block discarded – undo
197 197
      * Closes the connection to the logging database
198 198
      */
199 199
     public function close() {
200
-    	if($this->closed != true) {
201
-        	if ($this->db !== null) {
202
-            	$db = null;
203
-        	}
204
-        	$this->closed = true;
205
-    	}
200
+        if($this->closed != true) {
201
+            if ($this->db !== null) {
202
+                $db = null;
203
+            }
204
+            $this->closed = true;
205
+        }
206 206
     }
207 207
     
208 208
     /**
@@ -229,19 +229,19 @@  discard block
 block discarded – undo
229 229
         $this->createTable = LoggerOptionConverter::toBoolean($flag, true);
230 230
     }
231 231
    
232
-   	/**
233
-     * Sets the SQL string into which the event should be transformed.
234
-     * Defaults to:
235
-     * 
236
-     * INSERT INTO $this->table 
237
-     * ( timestamp, logger, level, message, thread, file, line) 
238
-     * VALUES 
239
-     * ('%d','%c','%p','%m','%t','%F','%L')
240
-     * 
241
-     * It's not necessary to change this except you have customized logging'
242
-     *
243
-     * @deprecated See {@link setInsertSql} and {@link setInsertPattern}.
244
-     */
232
+        /**
233
+         * Sets the SQL string into which the event should be transformed.
234
+         * Defaults to:
235
+         * 
236
+         * INSERT INTO $this->table 
237
+         * ( timestamp, logger, level, message, thread, file, line) 
238
+         * VALUES 
239
+         * ('%d','%c','%p','%m','%t','%F','%L')
240
+         * 
241
+         * It's not necessary to change this except you have customized logging'
242
+         *
243
+         * @deprecated See {@link setInsertSql} and {@link setInsertPattern}.
244
+         */
245 245
     public function setSql($sql) {
246 246
         $this->sql = $sql;    
247 247
     }
Please login to merge, or discard this patch.
main/inc/lib/phpdocx/lib/log4php/appenders/LoggerAppenderNull.php 1 patch
Indentation   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -35,26 +35,26 @@
 block discarded – undo
35 35
  */
36 36
 class LoggerAppenderNull extends LoggerAppender {
37 37
 
38
-	protected $requiresLayout = false;
38
+    protected $requiresLayout = false;
39 39
 	
40
-	public function __destruct() {
41
-       $this->close();
42
-   	}
40
+    public function __destruct() {
41
+        $this->close();
42
+        }
43 43
    	
44
-	public function activateOptions() {
45
-		$this->closed = false;
46
-	}
44
+    public function activateOptions() {
45
+        $this->closed = false;
46
+    }
47 47
 	
48
-	public function close() {
49
-		$this->closed = true;
50
-	}
48
+    public function close() {
49
+        $this->closed = true;
50
+    }
51 51
 	
52
-	/**
53
-	 * Do nothing. 
54
-	 * 
55
-	 * @param LoggerLoggingEvent $event
56
-	 */
57
-	public function append(LoggerLoggingEvent $event) {
58
-	}
52
+    /**
53
+     * Do nothing. 
54
+     * 
55
+     * @param LoggerLoggingEvent $event
56
+     */
57
+    public function append(LoggerLoggingEvent $event) {
58
+    }
59 59
 }
60 60
 
Please login to merge, or discard this patch.
main/inc/lib/phpdocx/lib/log4php/appenders/LoggerAppenderSocket.php 1 patch
Indentation   +181 added lines, -181 removed lines patch added patch discarded remove patch
@@ -46,215 +46,215 @@
 block discarded – undo
46 46
  */ 
47 47
 class LoggerAppenderSocket extends LoggerAppender {
48 48
 
49
-	/**
50
-	 * @var mixed socket connection resource
51
-	 * @access private
52
-	 */
53
-	private $sp = false;
49
+    /**
50
+     * @var mixed socket connection resource
51
+     * @access private
52
+     */
53
+    private $sp = false;
54 54
 	
55
-	/**
56
-	 * Target host. On how to define remote hostaname see 
57
-	 * {@link PHP_MANUAL#fsockopen}
58
-	 * @var string 
59
-	 */
60
-	private $remoteHost = '';
55
+    /**
56
+     * Target host. On how to define remote hostaname see 
57
+     * {@link PHP_MANUAL#fsockopen}
58
+     * @var string 
59
+     */
60
+    private $remoteHost = '';
61 61
 	
62
-	/**
63
-	 * @var integer the network port.
64
-	 */
65
-	private $port = 4446;
62
+    /**
63
+     * @var integer the network port.
64
+     */
65
+    private $port = 4446;
66 66
 	
67
-	/**
68
-	 * @var boolean get event's location info.
69
-	 */
70
-	private $locationInfo = false;
67
+    /**
68
+     * @var boolean get event's location info.
69
+     */
70
+    private $locationInfo = false;
71 71
 	
72
-	/**
73
-	 * @var integer connection timeout
74
-	 */
75
-	private $timeout = 30;
72
+    /**
73
+     * @var integer connection timeout
74
+     */
75
+    private $timeout = 30;
76 76
 	
77
-	/**
78
-	 * @var boolean output events via {@link LoggerXmlLayout}
79
-	 */
80
-	private $useXml = false;
77
+    /**
78
+     * @var boolean output events via {@link LoggerXmlLayout}
79
+     */
80
+    private $useXml = false;
81 81
 	
82
-	/**
83
-	 * @var boolean forward this option to {@link LoggerXmlLayout}. 
84
-	 *				Ignored if {@link $useXml} is <i>false</i>.
85
-	 */
86
-	private $log4jNamespace = false;
82
+    /**
83
+     * @var boolean forward this option to {@link LoggerXmlLayout}. 
84
+     *				Ignored if {@link $useXml} is <i>false</i>.
85
+     */
86
+    private $log4jNamespace = false;
87 87
 
88
-	/**
89
-	 * @var LoggerXmlLayout
90
-	 * @access private
91
-	 */
92
-	private $xmlLayout = null;
88
+    /**
89
+     * @var LoggerXmlLayout
90
+     * @access private
91
+     */
92
+    private $xmlLayout = null;
93 93
 	
94
-	/** @var indiciates if this appender should run in dry mode */
95
-	private $dry = false;
94
+    /** @var indiciates if this appender should run in dry mode */
95
+    private $dry = false;
96 96
 	
97
-	public function __destruct() {
98
-       $this->close();
99
-   	}
97
+    public function __destruct() {
98
+        $this->close();
99
+        }
100 100
    	
101
-	/**
102
-	 * Create a socket connection using defined parameters
103
-	 */
104
-	public function activateOptions() {
105
-		if(!$this->dry) {
106
-			$this->sp = @fsockopen($this->getRemoteHost(), $this->getPort(), $errno, $errstr, $this->getTimeout());
107
-			if ($this->sp === false) {
108
-			    throw new LoggerException("Could not open socket to ".$this->getRemoteHost().":".$this->getPort().": $errstr ($errno)");
109
-			}
110
-		}
111
-		if($this->getUseXml()) {
112
-			$this->xmlLayout = LoggerReflectionUtils::createObject('LoggerLayoutXml');
113
-			if($this->xmlLayout === null) {
114
-				$this->setUseXml(false);
115
-			} else {
116
-				$this->xmlLayout->setLocationInfo($this->getLocationInfo());
117
-				$this->xmlLayout->setLog4jNamespace($this->getLog4jNamespace());
118
-				$this->xmlLayout->activateOptions();
119
-			}			 
120
-		}
101
+    /**
102
+     * Create a socket connection using defined parameters
103
+     */
104
+    public function activateOptions() {
105
+        if(!$this->dry) {
106
+            $this->sp = @fsockopen($this->getRemoteHost(), $this->getPort(), $errno, $errstr, $this->getTimeout());
107
+            if ($this->sp === false) {
108
+                throw new LoggerException("Could not open socket to ".$this->getRemoteHost().":".$this->getPort().": $errstr ($errno)");
109
+            }
110
+        }
111
+        if($this->getUseXml()) {
112
+            $this->xmlLayout = LoggerReflectionUtils::createObject('LoggerLayoutXml');
113
+            if($this->xmlLayout === null) {
114
+                $this->setUseXml(false);
115
+            } else {
116
+                $this->xmlLayout->setLocationInfo($this->getLocationInfo());
117
+                $this->xmlLayout->setLog4jNamespace($this->getLog4jNamespace());
118
+                $this->xmlLayout->activateOptions();
119
+            }			 
120
+        }
121 121
         $this->closed = false;
122
-	}
122
+    }
123 123
 	
124
-	public function close() {
125
-		if($this->closed != true) {
126
-			if(!$this->dry and $this->sp !== false) {
127
-				fclose($this->sp);
128
-			}
129
-			$this->closed = true;
130
-		}
131
-	}
124
+    public function close() {
125
+        if($this->closed != true) {
126
+            if(!$this->dry and $this->sp !== false) {
127
+                fclose($this->sp);
128
+            }
129
+            $this->closed = true;
130
+        }
131
+    }
132 132
 
133
-	public function setDry($dry) {
134
-		$this->dry = $dry;
135
-	}
133
+    public function setDry($dry) {
134
+        $this->dry = $dry;
135
+    }
136 136
 	
137
-	/**
138
-	 * @return string
139
-	 */
140
-	public function getHostname() {
141
-		return $this->getRemoteHost();
142
-	}
137
+    /**
138
+     * @return string
139
+     */
140
+    public function getHostname() {
141
+        return $this->getRemoteHost();
142
+    }
143 143
 	
144
-	/**
145
-	 * @return boolean
146
-	 */
147
-	public function getLocationInfo() {
148
-		return $this->locationInfo;
149
-	} 
144
+    /**
145
+     * @return boolean
146
+     */
147
+    public function getLocationInfo() {
148
+        return $this->locationInfo;
149
+    } 
150 150
 	 
151
-	/**
152
-	 * @return boolean
153
-	 */
154
-	public function getLog4jNamespace() {
155
-		return $this->log4jNamespace;
156
-	}
151
+    /**
152
+     * @return boolean
153
+     */
154
+    public function getLog4jNamespace() {
155
+        return $this->log4jNamespace;
156
+    }
157 157
 
158
-	/**
159
-	 * @return integer
160
-	 */
161
-	public function getPort() {
162
-		return $this->port;
163
-	}
158
+    /**
159
+     * @return integer
160
+     */
161
+    public function getPort() {
162
+        return $this->port;
163
+    }
164 164
 	
165
-	public function getRemoteHost() {
166
-		return $this->remoteHost;
167
-	}
165
+    public function getRemoteHost() {
166
+        return $this->remoteHost;
167
+    }
168 168
 	
169
-	/**
170
-	 * @return integer
171
-	 */
172
-	public function getTimeout() {
173
-		return $this->timeout;
174
-	}
169
+    /**
170
+     * @return integer
171
+     */
172
+    public function getTimeout() {
173
+        return $this->timeout;
174
+    }
175 175
 	
176
-	/**
177
-	 * @var boolean
178
-	 */
179
-	public function getUseXml() {
180
-		return $this->useXml;
181
-	} 
176
+    /**
177
+     * @var boolean
178
+     */
179
+    public function getUseXml() {
180
+        return $this->useXml;
181
+    } 
182 182
 	 
183
-	public function reset() {
184
-		$this->close();
185
-		parent::reset();
186
-	}
183
+    public function reset() {
184
+        $this->close();
185
+        parent::reset();
186
+    }
187 187
 
188
-	/**
189
-	 * @param mixed
190
-	 */
191
-	public function setLocationInfo($flag) {
192
-		$this->locationInfo = LoggerOptionConverter::toBoolean($flag, $this->getLocationInfo());
193
-	} 
188
+    /**
189
+     * @param mixed
190
+     */
191
+    public function setLocationInfo($flag) {
192
+        $this->locationInfo = LoggerOptionConverter::toBoolean($flag, $this->getLocationInfo());
193
+    } 
194 194
 
195
-	/**
196
-	 * @param mixed
197
-	 */
198
-	public function setLog4jNamespace($flag) {
199
-		$this->log4jNamespace = LoggerOptionConverter::toBoolean($flag, $this->getLog4jNamespace());
200
-	} 
195
+    /**
196
+     * @param mixed
197
+     */
198
+    public function setLog4jNamespace($flag) {
199
+        $this->log4jNamespace = LoggerOptionConverter::toBoolean($flag, $this->getLog4jNamespace());
200
+    } 
201 201
 			
202
-	/**
203
-	 * @param integer
204
-	 */
205
-	public function setPort($port) {
206
-		$port = LoggerOptionConverter::toInt($port, 0);
207
-		if($port > 0 and $port < 65535) {
208
-			$this->port = $port;	
209
-		}
210
-	}
202
+    /**
203
+     * @param integer
204
+     */
205
+    public function setPort($port) {
206
+        $port = LoggerOptionConverter::toInt($port, 0);
207
+        if($port > 0 and $port < 65535) {
208
+            $this->port = $port;	
209
+        }
210
+    }
211 211
 	
212
-	/**
213
-	 * @param string
214
-	 */
215
-	public function setRemoteHost($hostname) {
216
-		$this->remoteHost = $hostname;
217
-	}
212
+    /**
213
+     * @param string
214
+     */
215
+    public function setRemoteHost($hostname) {
216
+        $this->remoteHost = $hostname;
217
+    }
218 218
 	
219
-	/**
220
-	 * @param integer
221
-	 */
222
-	public function setTimeout($timeout) {
223
-		$this->timeout = LoggerOptionConverter::toInt($timeout, $this->getTimeout());
224
-	}
219
+    /**
220
+     * @param integer
221
+     */
222
+    public function setTimeout($timeout) {
223
+        $this->timeout = LoggerOptionConverter::toInt($timeout, $this->getTimeout());
224
+    }
225 225
 	
226
-	/**
227
-	 * @param mixed
228
-	 */
229
-	public function setUseXml($flag) {
230
-		$this->useXml = LoggerOptionConverter::toBoolean($flag, $this->getUseXml());
231
-	} 
226
+    /**
227
+     * @param mixed
228
+     */
229
+    public function setUseXml($flag) {
230
+        $this->useXml = LoggerOptionConverter::toBoolean($flag, $this->getUseXml());
231
+    } 
232 232
  
233
-	public function append(LoggerLoggingEvent $event) {
234
-		if($this->sp || $this->dry) {
235
-			if($this->getLocationInfo()) {
236
-				$event->getLocationInformation();
237
-			}
233
+    public function append(LoggerLoggingEvent $event) {
234
+        if($this->sp || $this->dry) {
235
+            if($this->getLocationInfo()) {
236
+                $event->getLocationInformation();
237
+            }
238 238
 		
239
-			if(!$this->getUseXml()) {
240
-				$sEvent = serialize($event);
241
-				if(!$this->dry) {
242
-					fwrite($this->sp, $sEvent, strlen($sEvent));
243
-				} else {
244
-				    echo "DRY MODE OF SOCKET APPENDER: ".$sEvent;
245
-				}
246
-			} else {
247
-				if(!$this->dry) {
248
-					fwrite($this->sp, $this->xmlLayout->format($event));
249
-				} else {
250
-				    echo "DRY MODE OF SOCKET APPENDER: ".$this->xmlLayout->format($event);
251
-				}
252
-			}			 
239
+            if(!$this->getUseXml()) {
240
+                $sEvent = serialize($event);
241
+                if(!$this->dry) {
242
+                    fwrite($this->sp, $sEvent, strlen($sEvent));
243
+                } else {
244
+                    echo "DRY MODE OF SOCKET APPENDER: ".$sEvent;
245
+                }
246
+            } else {
247
+                if(!$this->dry) {
248
+                    fwrite($this->sp, $this->xmlLayout->format($event));
249
+                } else {
250
+                    echo "DRY MODE OF SOCKET APPENDER: ".$this->xmlLayout->format($event);
251
+                }
252
+            }			 
253 253
 
254
-			// not sure about it...
255
-			if(!$this->dry) {
256
-				fflush($this->sp);
257
-			}
258
-		} 
259
-	}
254
+            // not sure about it...
255
+            if(!$this->dry) {
256
+                fflush($this->sp);
257
+            }
258
+        } 
259
+    }
260 260
 }
Please login to merge, or discard this patch.
main/inc/lib/phpdocx/lib/log4php/LoggerAppenderPool.php 1 patch
Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -25,31 +25,31 @@
 block discarded – undo
25 25
  * @package log4php
26 26
  */
27 27
 class LoggerAppenderPool {
28
-	/* Appender Pool */
29
-	public static $appenderPool =  null;
28
+    /* Appender Pool */
29
+    public static $appenderPool =  null;
30 30
 	
31
-	/**
32
-	 * 
33
-	 *
34
-	 * @param string $name 
35
-	 * @param string $class 
36
-	 * @return LoggerAppender
37
-	 */
38
-	public static function getAppenderFromPool($name, $class = '') {
39
-		if(isset(self::$appenderPool[$name])) {
40
-			return self::$appenderPool[$name];
41
-		}
31
+    /**
32
+     * 
33
+     *
34
+     * @param string $name 
35
+     * @param string $class 
36
+     * @return LoggerAppender
37
+     */
38
+    public static function getAppenderFromPool($name, $class = '') {
39
+        if(isset(self::$appenderPool[$name])) {
40
+            return self::$appenderPool[$name];
41
+        }
42 42
 		
43
-		if(empty($class)) {
44
-			return null;
45
-		}
43
+        if(empty($class)) {
44
+            return null;
45
+        }
46 46
 		
47
-		$appender = LoggerReflectionUtils::createObject($class);
48
-		$appender->setName($name);
49
-		if($appender !== null) { 
50
-			self::$appenderPool[$name] = $appender;
51
-			return self::$appenderPool[$name];
52
-		}
53
-		return null;		
54
-	}
47
+        $appender = LoggerReflectionUtils::createObject($class);
48
+        $appender->setName($name);
49
+        if($appender !== null) { 
50
+            self::$appenderPool[$name] = $appender;
51
+            return self::$appenderPool[$name];
52
+        }
53
+        return null;		
54
+    }
55 55
 }
Please login to merge, or discard this patch.
main/inc/lib/phpdocx/lib/log4php/LoggerNDC.php 1 patch
Indentation   +110 added lines, -110 removed lines patch added patch discarded remove patch
@@ -100,122 +100,122 @@
 block discarded – undo
100 100
  * @since 0.3
101 101
  */
102 102
 class LoggerNDC {
103
-	const HT_SIZE = 7;
104
-	/**
105
-	 * Clear any nested diagnostic information if any. This method is
106
-	 * useful in cases where the same thread can be potentially used
107
-	 * over and over in different unrelated contexts.
108
-	 *
109
-	 * <p>This method is equivalent to calling the {@link setMaxDepth()}
110
-	 * method with a zero <var>maxDepth</var> argument.
111
-	 *
112
-	 * @static	
113
-	 */
114
-	public static function clear() {
115
-		$GLOBALS['log4php.LoggerNDC.ht'] = array();
116
-	}
103
+    const HT_SIZE = 7;
104
+    /**
105
+     * Clear any nested diagnostic information if any. This method is
106
+     * useful in cases where the same thread can be potentially used
107
+     * over and over in different unrelated contexts.
108
+     *
109
+     * <p>This method is equivalent to calling the {@link setMaxDepth()}
110
+     * method with a zero <var>maxDepth</var> argument.
111
+     *
112
+     * @static	
113
+     */
114
+    public static function clear() {
115
+        $GLOBALS['log4php.LoggerNDC.ht'] = array();
116
+    }
117 117
 
118
-	/**
119
-	 * Never use this method directly, use the {@link LoggerLoggingEvent::getNDC()} method instead.
120
-	 * @static
121
-	 * @return array
122
-	 */
123
-	public static function get() {
124
-		if(!array_key_exists('log4php.LoggerNDC.ht', $GLOBALS)) {
125
-			LoggerNDC::clear();
126
-		}
127
-		return $GLOBALS['log4php.LoggerNDC.ht'];
128
-	}
118
+    /**
119
+     * Never use this method directly, use the {@link LoggerLoggingEvent::getNDC()} method instead.
120
+     * @static
121
+     * @return array
122
+     */
123
+    public static function get() {
124
+        if(!array_key_exists('log4php.LoggerNDC.ht', $GLOBALS)) {
125
+            LoggerNDC::clear();
126
+        }
127
+        return $GLOBALS['log4php.LoggerNDC.ht'];
128
+    }
129 129
   
130
-	/**
131
-	 * Get the current nesting depth of this diagnostic context.
132
-	 *
133
-	 * @see setMaxDepth()
134
-	 * @return integer
135
-	 * @static
136
-	 */
137
-	public static function getDepth() {
138
-		return count($GLOBALS['log4php.LoggerNDC.ht']);	  
139
-	}
130
+    /**
131
+     * Get the current nesting depth of this diagnostic context.
132
+     *
133
+     * @see setMaxDepth()
134
+     * @return integer
135
+     * @static
136
+     */
137
+    public static function getDepth() {
138
+        return count($GLOBALS['log4php.LoggerNDC.ht']);	  
139
+    }
140 140
 
141
-	/**
142
-	 * Clients should call this method before leaving a diagnostic
143
-	 * context.
144
-	 *
145
-	 * <p>The returned value is the value that was pushed last. If no
146
-	 * context is available, then the empty string "" is returned.</p>
147
-	 *
148
-	 * @return string The innermost diagnostic context.
149
-	 * @static
150
-	 */
151
-	public static function pop() {
152
-		if(count($GLOBALS['log4php.LoggerNDC.ht']) > 0) {
153
-			return array_pop($GLOBALS['log4php.LoggerNDC.ht']);
154
-		} else {
155
-			return '';
156
-		}
157
-	}
141
+    /**
142
+     * Clients should call this method before leaving a diagnostic
143
+     * context.
144
+     *
145
+     * <p>The returned value is the value that was pushed last. If no
146
+     * context is available, then the empty string "" is returned.</p>
147
+     *
148
+     * @return string The innermost diagnostic context.
149
+     * @static
150
+     */
151
+    public static function pop() {
152
+        if(count($GLOBALS['log4php.LoggerNDC.ht']) > 0) {
153
+            return array_pop($GLOBALS['log4php.LoggerNDC.ht']);
154
+        } else {
155
+            return '';
156
+        }
157
+    }
158 158
 
159
-	/**
160
-	 * Looks at the last diagnostic context at the top of this NDC
161
-	 * without removing it.
162
-	 *
163
-	 * <p>The returned value is the value that was pushed last. If no
164
-	 * context is available, then the empty string "" is returned.</p>
165
-	 * @return string The innermost diagnostic context.
166
-	 * @static
167
-	 */
168
-	public static function peek(){
169
-		if(count($GLOBALS['log4php.LoggerNDC.ht']) > 0) {
170
-			return end($GLOBALS['log4php.LoggerNDC.ht']);
171
-		} else {
172
-			return '';
173
-		}
174
-	}
159
+    /**
160
+     * Looks at the last diagnostic context at the top of this NDC
161
+     * without removing it.
162
+     *
163
+     * <p>The returned value is the value that was pushed last. If no
164
+     * context is available, then the empty string "" is returned.</p>
165
+     * @return string The innermost diagnostic context.
166
+     * @static
167
+     */
168
+    public static function peek(){
169
+        if(count($GLOBALS['log4php.LoggerNDC.ht']) > 0) {
170
+            return end($GLOBALS['log4php.LoggerNDC.ht']);
171
+        } else {
172
+            return '';
173
+        }
174
+    }
175 175
   
176
-	/**
177
-	 * Push new diagnostic context information for the current thread.
178
-	 *
179
-	 * <p>The contents of the <var>message</var> parameter is
180
-	 * determined solely by the client.
181
-	 *	
182
-	 * @param string $message The new diagnostic context information.
183
-	 * @static	
184
-	 */
185
-	public static function push($message) {
186
-		array_push($GLOBALS['log4php.LoggerNDC.ht'], (string)$message);
187
-	}
176
+    /**
177
+     * Push new diagnostic context information for the current thread.
178
+     *
179
+     * <p>The contents of the <var>message</var> parameter is
180
+     * determined solely by the client.
181
+     *	
182
+     * @param string $message The new diagnostic context information.
183
+     * @static	
184
+     */
185
+    public static function push($message) {
186
+        array_push($GLOBALS['log4php.LoggerNDC.ht'], (string)$message);
187
+    }
188 188
 
189
-	/**
190
-	 * Remove the diagnostic context for this thread.
191
-	 * @static
192
-	 */
193
-	public static function remove() {
194
-		LoggerNDC::clear();
195
-	}
189
+    /**
190
+     * Remove the diagnostic context for this thread.
191
+     * @static
192
+     */
193
+    public static function remove() {
194
+        LoggerNDC::clear();
195
+    }
196 196
 
197
-	/**
198
-	 * Set maximum depth of this diagnostic context. If the current
199
-	 * depth is smaller or equal to <var>maxDepth</var>, then no
200
-	 * action is taken.
201
-	 *
202
-	 * <p>This method is a convenient alternative to multiple 
203
-	 * {@link pop()} calls. Moreover, it is often the case that at 
204
-	 * the end of complex call sequences, the depth of the NDC is
205
-	 * unpredictable. The {@link setMaxDepth()} method circumvents
206
-	 * this problem.
207
-	 *
208
-	 * @param integer $maxDepth
209
-	 * @see getDepth()
210
-	 * @static
211
-	 */
212
-	public static function setMaxDepth($maxDepth) {
213
-		$maxDepth = (int)$maxDepth;
214
-		if($maxDepth <= self::HT_SIZE) {
215
-			if(LoggerNDC::getDepth() > $maxDepth) {
216
-				$GLOBALS['log4php.LoggerNDC.ht'] = array_slice($GLOBALS['log4php.LoggerNDC.ht'], $maxDepth);
217
-			}
218
-		}
219
-	}
197
+    /**
198
+     * Set maximum depth of this diagnostic context. If the current
199
+     * depth is smaller or equal to <var>maxDepth</var>, then no
200
+     * action is taken.
201
+     *
202
+     * <p>This method is a convenient alternative to multiple 
203
+     * {@link pop()} calls. Moreover, it is often the case that at 
204
+     * the end of complex call sequences, the depth of the NDC is
205
+     * unpredictable. The {@link setMaxDepth()} method circumvents
206
+     * this problem.
207
+     *
208
+     * @param integer $maxDepth
209
+     * @see getDepth()
210
+     * @static
211
+     */
212
+    public static function setMaxDepth($maxDepth) {
213
+        $maxDepth = (int)$maxDepth;
214
+        if($maxDepth <= self::HT_SIZE) {
215
+            if(LoggerNDC::getDepth() > $maxDepth) {
216
+                $GLOBALS['log4php.LoggerNDC.ht'] = array_slice($GLOBALS['log4php.LoggerNDC.ht'], $maxDepth);
217
+            }
218
+        }
219
+    }
220 220
 
221 221
 }
Please login to merge, or discard this patch.
main/inc/lib/phpdocx/lib/log4php/LoggerRoot.php 1 patch
Indentation   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -26,45 +26,45 @@
 block discarded – undo
26 26
  * @see Logger
27 27
  */
28 28
 class LoggerRoot extends Logger {
29
-	/**
30
-	 * Constructor
31
-	 *
32
-	 * @param integer $level initial log level
33
-	 */
34
-	public function __construct($level = null) {
35
-		parent::__construct('root');
29
+    /**
30
+     * Constructor
31
+     *
32
+     * @param integer $level initial log level
33
+     */
34
+    public function __construct($level = null) {
35
+        parent::__construct('root');
36 36
 
37
-		if($level == null) {
38
-			$level = LoggerLevel::getLevelAll();
39
-		}
40
-		$this->setLevel($level);
41
-	} 
37
+        if($level == null) {
38
+            $level = LoggerLevel::getLevelAll();
39
+        }
40
+        $this->setLevel($level);
41
+    } 
42 42
 	
43
-	/**
44
-	 * @return LoggerLevel the level
45
-	 */
46
-	public function getChainedLevel() {
47
-		return parent::getLevel();
48
-	} 
43
+    /**
44
+     * @return LoggerLevel the level
45
+     */
46
+    public function getChainedLevel() {
47
+        return parent::getLevel();
48
+    } 
49 49
 	
50
-	/**
51
-	 * Setting a null value to the level of the root category may have catastrophic results.
52
-	 * @param LoggerLevel $level
53
-	 */
54
-	public function setLevel($level) {
55
-		if($level != null) {
56
-			parent::setLevel($level);
57
-		}	 
58
-	}
50
+    /**
51
+     * Setting a null value to the level of the root category may have catastrophic results.
52
+     * @param LoggerLevel $level
53
+     */
54
+    public function setLevel($level) {
55
+        if($level != null) {
56
+            parent::setLevel($level);
57
+        }	 
58
+    }
59 59
 	
60
-	/**
61
-	 * Always returns false.
62
-	 * Because LoggerRoot has no parents, it returns false.
63
-	 * @param Logger $parent
64
-	 * @return boolean
65
-	 */
66
-	public function setParent(Logger $parent) {
67
-		return false;
68
-	}
60
+    /**
61
+     * Always returns false.
62
+     * Because LoggerRoot has no parents, it returns false.
63
+     * @param Logger $parent
64
+     * @return boolean
65
+     */
66
+    public function setParent(Logger $parent) {
67
+        return false;
68
+    }
69 69
 
70 70
 }
Please login to merge, or discard this patch.
main/inc/lib/phpdocx/lib/log4php/layouts/LoggerLayoutXml.php 1 patch
Indentation   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -49,17 +49,17 @@  discard block
 block discarded – undo
49 49
  * @subpackage layouts
50 50
  */
51 51
 class LoggerLayoutXml extends LoggerLayout {
52
-	const LOG4J_NS_PREFIX ='log4j';
53
-	const LOG4J_NS = 'http://jakarta.apache.org/log4j/';
52
+    const LOG4J_NS_PREFIX ='log4j';
53
+    const LOG4J_NS = 'http://jakarta.apache.org/log4j/';
54 54
 	
55
-	const LOG4PHP_NS_PREFIX = 'log4php';
56
-	const LOG4PHP_NS = 'http://logging.apache.org/log4php/';
55
+    const LOG4PHP_NS_PREFIX = 'log4php';
56
+    const LOG4PHP_NS = 'http://logging.apache.org/log4php/';
57 57
 	
58
-	const CDATA_START = '<![CDATA[';
59
-	const CDATA_END = ']]>';
60
-	const CDATA_PSEUDO_END = ']]&gt;';
58
+    const CDATA_START = '<![CDATA[';
59
+    const CDATA_END = ']]>';
60
+    const CDATA_PSEUDO_END = ']]&gt;';
61 61
 
62
-	const CDATA_EMBEDDED_END = ']]>]]&gt;<![CDATA[';
62
+    const CDATA_EMBEDDED_END = ']]>]]&gt;<![CDATA[';
63 63
 
64 64
     /**
65 65
      * If set to true then the file name and line number of the origin of the
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
                     "xmlns:{$this->_namespacePrefix}=\"{$this->_namespace}\" ".
109 109
                     "version=\"0.3\" ".
110 110
                     "includesLocationInfo=\"".($this->getLocationInfo() ? "true" : "false")."\"".
111
-               ">\r\n";
111
+                ">\r\n";
112 112
     }
113 113
 
114 114
     /**
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
      * @return string
119 119
      */
120 120
     public function format(LoggerLoggingEvent $event) {
121
-    	$loggerName = $event->getLoggerName();
121
+        $loggerName = $event->getLoggerName();
122 122
         $timeStamp  = number_format((float)($event->getTimeStamp() * 1000), 0, '', '');
123 123
         $thread     = $event->getThreadName();
124 124
         $level      = $event->getLevel();
@@ -180,12 +180,12 @@  discard block
 block discarded – undo
180 180
         $this->locationInfo = LoggerOptionConverter::toBoolean($flag, true);
181 181
     }
182 182
   
183
-	/**
184
-	 * @return boolean
185
-	 */
186
-	 public function getLog4jNamespace() {
187
-	 	return $this->log4jNamespace;
188
-	 }
183
+    /**
184
+     * @return boolean
185
+     */
186
+        public function getLog4jNamespace() {
187
+            return $this->log4jNamespace;
188
+        }
189 189
 
190 190
     /**
191 191
      * @param boolean
@@ -195,28 +195,28 @@  discard block
 block discarded – undo
195 195
     }
196 196
     
197 197
     /**
198
-	 * Ensures that embeded CDEnd strings (]]&gt;) are handled properly
199
-	 * within message, NDC and throwable tag text.
200
-	 *
201
-	 * @param string $buf	String holding the XML data to this point.	The
202
-	 *						initial CDStart (<![CDATA[) and final CDEnd (]]>) 
203
-	 *						of the CDATA section are the responsibility of 
204
-	 *						the calling method.
205
-	 * @param string str	The String that is inserted into an existing 
206
-	 *						CDATA Section within buf.
207
-	 * @static  
208
-	 */
209
-	private function appendEscapingCDATA(&$buf, $str) {
210
-		if(empty($str)) {
211
-			return;
212
-		}
198
+     * Ensures that embeded CDEnd strings (]]&gt;) are handled properly
199
+     * within message, NDC and throwable tag text.
200
+     *
201
+     * @param string $buf	String holding the XML data to this point.	The
202
+     *						initial CDStart (<![CDATA[) and final CDEnd (]]>) 
203
+     *						of the CDATA section are the responsibility of 
204
+     *						the calling method.
205
+     * @param string str	The String that is inserted into an existing 
206
+     *						CDATA Section within buf.
207
+     * @static  
208
+     */
209
+    private function appendEscapingCDATA(&$buf, $str) {
210
+        if(empty($str)) {
211
+            return;
212
+        }
213 213
 	
214
-		$rStr = str_replace(
215
-			self::CDATA_END,
216
-			self::CDATA_EMBEDDED_END,
217
-			$str
218
-		);
219
-		$buf .= $rStr;
220
-	}
214
+        $rStr = str_replace(
215
+            self::CDATA_END,
216
+            self::CDATA_EMBEDDED_END,
217
+            $str
218
+        );
219
+        $buf .= $rStr;
220
+    }
221 221
 }
222 222
 
Please login to merge, or discard this patch.
main/inc/lib/phpdocx/lib/log4php/layouts/LoggerLayoutHtml.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -145,15 +145,15 @@
 block discarded – undo
145 145
         $level = $event->getLevel();
146 146
         
147 147
         if ($level->equals(LoggerLevel::getLevelDebug())) {
148
-          $sbuf .= "<font color=\"#339933\">";
149
-          $sbuf .= $level->toString();
150
-          $sbuf .= "</font>";
148
+            $sbuf .= "<font color=\"#339933\">";
149
+            $sbuf .= $level->toString();
150
+            $sbuf .= "</font>";
151 151
         } else if ($level->equals(LoggerLevel::getLevelWarn())) {
152
-          $sbuf .= "<font color=\"#993300\"><strong>";
153
-          $sbuf .= $level->toString();
154
-          $sbuf .= "</strong></font>";
152
+            $sbuf .= "<font color=\"#993300\"><strong>";
153
+            $sbuf .= $level->toString();
154
+            $sbuf .= "</strong></font>";
155 155
         } else {
156
-          $sbuf .= $level->toString();
156
+            $sbuf .= $level->toString();
157 157
         }
158 158
         $sbuf .= "</td>" . PHP_EOL;
159 159
     
Please login to merge, or discard this patch.
main/inc/lib/security.lib.php 1 patch
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -304,9 +304,9 @@  discard block
 block discarded – undo
304 304
      */
305 305
     public static function remove_XSS($var, $user_status = null, $filter_terms = false)
306 306
     {
307
-    	if ($filter_terms) {
308
-    		$var = self::filter_terms($var);
309
-    	}
307
+        if ($filter_terms) {
308
+            $var = self::filter_terms($var);
309
+        }
310 310
 
311 311
         if (empty($user_status)) {
312 312
             if (api_is_anonymous()) {
@@ -401,7 +401,7 @@  discard block
 block discarded – undo
401 401
      */
402 402
     static function filter_terms($text)
403 403
     {
404
-    	static $bad_terms = array();
404
+        static $bad_terms = array();
405 405
 
406 406
         if (empty($bad_terms)) {
407 407
             $list = api_get_setting('filter_terms');
@@ -420,14 +420,14 @@  discard block
 block discarded – undo
420 420
             }
421 421
         }
422 422
 
423
-    	$replace = '***';
423
+        $replace = '***';
424 424
 
425
-    	if (!empty($bad_terms)) {
426
-    		//Fast way
427
-    		$new_text = str_ireplace($bad_terms, $replace, $text, $count);
425
+        if (!empty($bad_terms)) {
426
+            //Fast way
427
+            $new_text = str_ireplace($bad_terms, $replace, $text, $count);
428 428
 
429
-    		//We need statistics
430
-    		/*
429
+            //We need statistics
430
+            /*
431 431
     		if (strlen($new_text) != strlen($text)) {
432 432
     			$table = Database::get_main_table(TABLE_STATISTIC_TRACK_FILTERED_TERMS);
433 433
     			$attributes = array();
@@ -442,10 +442,10 @@  discard block
 block discarded – undo
442 442
     			$sql = Database::insert($table, $attributes);
443 443
     		}
444 444
     		*/
445
-    		$text = $new_text;
445
+            $text = $new_text;
446 446
 
447
-    	}
448
-		return $text;
447
+        }
448
+        return $text;
449 449
     }
450 450
 
451 451
 
Please login to merge, or discard this patch.