From: Alexandre Emsenhuber Date: Sat, 1 Sep 2012 19:56:38 +0000 (+0200) Subject: Added missing GPLv2 headers in new files. X-Git-Tag: 1.31.0-rc.0~22493^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/?a=commitdiff_plain;h=d3e0168c674fa5100f92c82f49159ef6b4832035;p=lhc%2Fweb%2Fwiklou.git Added missing GPLv2 headers in new files. Also improved file documentation. Change-Id: Ia5a383110769cf51603305dc639616d904ebbab2 --- diff --git a/includes/Timestamp.php b/includes/Timestamp.php index b5ea775b47..41665bcf89 100644 --- a/includes/Timestamp.php +++ b/includes/Timestamp.php @@ -1,10 +1,31 @@ servers = $params['servers']; - $this->connectTimeout = isset( $params['connectTimeout'] ) + $this->connectTimeout = isset( $params['connectTimeout'] ) ? $params['connectTimeout'] : 1; $this->persistent = !empty( $params['persistent'] ); if ( isset( $params['password'] ) ) { @@ -106,7 +127,7 @@ class RedisBagOStuff extends BagOStuff { $result = false; $this->handleException( $server, $e ); } - + $this->logRequest( 'set', $key, $server, $result ); wfProfileOut( __METHOD__ ); return $result; @@ -196,7 +217,7 @@ class RedisBagOStuff extends BagOStuff { } /** - * Non-atomic implementation of replace(). Could perhaps be done atomically + * Non-atomic implementation of replace(). Could perhaps be done atomically * with WATCH or scripting, but this function is rarely used. */ public function replace( $key, $value, $expiry = 0 ) { @@ -222,19 +243,19 @@ class RedisBagOStuff extends BagOStuff { $result = false; $this->handleException( $server, $e ); } - + $this->logRequest( 'replace', $key, $server, $result ); wfProfileOut( __METHOD__ ); return $result; } /** - * Non-atomic implementation of incr(). + * Non-atomic implementation of incr(). * - * Probably all callers actually want incr() to atomically initialise - * values to zero if they don't exist, as provided by the Redis INCR - * command. But we are constrained by the memcached-like interface to - * return null in that case. Once the key exists, further increments are + * Probably all callers actually want incr() to atomically initialise + * values to zero if they don't exist, as provided by the Redis INCR + * command. But we are constrained by the memcached-like interface to + * return null in that case. Once the key exists, further increments are * atomic. */ public function incr( $key, $value = 1 ) { @@ -254,7 +275,7 @@ class RedisBagOStuff extends BagOStuff { $result = false; $this->handleException( $server, $e ); } - + $this->logRequest( 'incr', $key, $server, $result ); wfProfileOut( __METHOD__ ); return $result; @@ -317,7 +338,7 @@ class RedisBagOStuff extends BagOStuff { if ( substr( $server, 0, 1 ) === '/' ) { // UNIX domain socket - // These are required by the redis extension to start with a slash, but + // These are required by the redis extension to start with a slash, but // we still need to set the port to a special value to make it work. $host = $server; $port = 0; @@ -372,8 +393,8 @@ class RedisBagOStuff extends BagOStuff { /** * The redis extension throws an exception in response to various read, write - * and protocol errors. Sometimes it also closes the connection, sometimes - * not. The safest response for us is to explicitly destroy the connection + * and protocol errors. Sometimes it also closes the connection, sometimes + * not. The safest response for us is to explicitly destroy the connection * object and let it be reopened during the next request. */ protected function handleException( $server, $e ) { @@ -385,7 +406,7 @@ class RedisBagOStuff extends BagOStuff { * Send information about a single request to the debug log */ public function logRequest( $method, $key, $server, $result ) { - $this->debug( "$method $key on $server: " . + $this->debug( "$method $key on $server: " . ( $result === false ? "failure" : "success" ) ); } } diff --git a/includes/parser/CacheTime.php b/includes/parser/CacheTime.php index e42c464ce9..881dded7b6 100644 --- a/includes/parser/CacheTime.php +++ b/includes/parser/CacheTime.php @@ -1,7 +1,6 @@ mVersion, Parser::VERSION, "lt" ); } -} \ No newline at end of file +}