Adding default SVN properties svn:keywords and svn:eol-style to files added lately
authorIngmar Schlecht <ingmar.schlecht@typo3.org>
Fri, 2 Nov 2007 16:36:15 +0000 (16:36 +0000)
committerIngmar Schlecht <ingmar.schlecht@typo3.org>
Fri, 2 Nov 2007 16:36:15 +0000 (16:36 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@2652 709f56b5-9817-0410-a4d7-c38de5d9e867

t3lib/class.t3lib_transl8tools.php
typo3/alt_main_new.php
typo3/contrib/jsmin/jsmin.php
typo3/mod/user/ws/publish.php
typo3/sysext/adodb/adodb/adodb-memcache.lib.inc.php
typo3/sysext/rtehtmlarea/class.tx_rtehtmlareaapi.php

index ff5ed4d..dfa7312 100755 (executable)
@@ -27,7 +27,7 @@
 /**
  * Contains translation tools
  *
- * $Id: class.t3lib_loaddbgroup.php 1816 2006-11-26 00:43:24Z mundaun $
+ * $Id$
  *
  * @author     Kasper Skaarhoj <kasperYYYY@typo3.com>
  */
index fc3d7c7..e59b167 100644 (file)
@@ -28,7 +28,7 @@
  * Main frameset of the TYPO3 backend
  * Sending the GET var "alt_main.php?edit=[page id]" will load the page id in the editing module configured.
  *
- * $Id: alt_main.php 1421 2006-04-10 09:27:15Z mundaun $
+ * $Id$
  * Revised for TYPO3 3.6 2/2003 by Kasper Skaarhoj
  * XHTML Compliant (almost)
  *
index 050b7a4..d77d083 100644 (file)
-<?php\r
-/**\r
- * jsmin.php - PHP implementation of Douglas Crockford's JSMin.\r
- *\r
- * This is pretty much a direct port of jsmin.c to PHP with just a few\r
- * PHP-specific performance tweaks. Also, whereas jsmin.c reads from stdin and\r
- * outputs to stdout, this library accepts a string as input and returns another\r
- * string as output.\r
- *\r
- * PHP 5 or higher is required.\r
- *\r
- * Permission is hereby granted to use this version of the library under the\r
- * same terms as jsmin.c, which has the following license:\r
- *\r
- * --\r
- * Copyright (c) 2002 Douglas Crockford  (www.crockford.com)\r
- *\r
- * Permission is hereby granted, free of charge, to any person obtaining a copy of\r
- * this software and associated documentation files (the "Software"), to deal in\r
- * the Software without restriction, including without limitation the rights to\r
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\r
- * of the Software, and to permit persons to whom the Software is furnished to do\r
- * so, subject to the following conditions:\r
- *\r
- * The above copyright notice and this permission notice shall be included in all\r
- * copies or substantial portions of the Software.\r
- *\r
- * The Software shall be used for Good, not Evil.\r
- *\r
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r
- * SOFTWARE.\r
- * --\r
- *\r
- * @package JSMin\r
- * @author Ryan Grove <ryan@wonko.com>\r
- * @copyright 2002 Douglas Crockford <douglas@crockford.com> (jsmin.c)\r
- * @copyright 2007 Ryan Grove <ryan@wonko.com> (PHP port)\r
- * @license http://opensource.org/licenses/mit-license.php MIT License\r
- * @version 1.1.0 (2007-06-01)\r
- * @link http://code.google.com/p/jsmin-php/\r
- */\r
-\r
-class JSMin {\r
-  const ORD_LF    = 10;\r
-  const ORD_SPACE = 32;\r
-\r
-  protected $a           = '';\r
-  protected $b           = '';\r
-  protected $input       = '';\r
-  protected $inputIndex  = 0;\r
-  protected $inputLength = 0;\r
-  protected $lookAhead   = null;\r
-  protected $output      = array();\r
-\r
-  // -- Public Static Methods --------------------------------------------------\r
-\r
-  public static function minify($js) {\r
-    $jsmin = new JSMin($js);\r
-    return $jsmin->min();\r
-  }\r
-\r
-  // -- Public Instance Methods ------------------------------------------------\r
-\r
-  public function __construct($input) {\r
-    $this->input       = str_replace("\r\n", "\n", $input);\r
-    $this->inputLength = strlen($this->input);\r
-  }\r
-\r
-  // -- Protected Instance Methods ---------------------------------------------\r
-\r
-  protected function action($d) {\r
-    switch($d) {\r
-      case 1:\r
-        $this->output[] = $this->a;\r
-\r
-      case 2:\r
-        $this->a = $this->b;\r
-\r
-        if ($this->a === "'" || $this->a === '"') {\r
-          for (;;) {\r
-            $this->output[] = $this->a;\r
-            $this->a        = $this->get();\r
-\r
-            if ($this->a === $this->b) {\r
-              break;\r
-            }\r
-\r
-            if (ord($this->a) <= self::ORD_LF) {\r
-              throw new JSMinException('Unterminated string literal.');\r
-            }\r
-\r
-            if ($this->a === '\\') {\r
-              $this->output[] = $this->a;\r
-              $this->a        = $this->get();\r
-            }\r
-          }\r
-        }\r
-\r
-      case 3:\r
-        $this->b = $this->next();\r
-\r
-        if ($this->b === '/' && (\r
-            $this->a === '(' || $this->a === ',' || $this->a === '=' ||\r
-            $this->a === ':' || $this->a === '[' || $this->a === '!' ||\r
-            $this->a === '&' || $this->a === '|' || $this->a === '?')) {\r
-\r
-          $this->output[] = $this->a;\r
-          $this->output[] = $this->b;\r
-\r
-          for (;;) {\r
-            $this->a = $this->get();\r
-\r
-            if ($this->a === '/') {\r
-              break;\r
-            }\r
-            elseif ($this->a === '\\') {\r
-              $this->output[] = $this->a;\r
-              $this->a        = $this->get();\r
-            }\r
-            elseif (ord($this->a) <= self::ORD_LF) {\r
-              throw new JSMinException('Unterminated regular expression '.\r
-                  'literal.');\r
-            }\r
-\r
-            $this->output[] = $this->a;\r
-          }\r
-\r
-          $this->b = $this->next();\r
-        }\r
-    }\r
-  }\r
-\r
-  protected function get() {\r
-    $c = $this->lookAhead;\r
-    $this->lookAhead = null;\r
-\r
-    if ($c === null) {\r
-      if ($this->inputIndex < $this->inputLength) {\r
-        $c = $this->input[$this->inputIndex];\r
-        $this->inputIndex += 1;\r
-      }\r
-      else {\r
-        $c = null;\r
-      }\r
-    }\r
-\r
-    if ($c === "\r") {\r
-      return "\n";\r
-    }\r
-\r
-    if ($c === null || $c === "\n" || ord($c) >= self::ORD_SPACE) {\r
-      return $c;\r
-    }\r
-\r
-    return ' ';\r
-  }\r
-\r
-  protected function isAlphaNum($c) {\r
-    return ord($c) > 126 || $c === '\\' || preg_match('/^[\w\$]$/', $c) === 1;\r
-  }\r
-\r
-  protected function min() {\r
-    $this->a = "\n";\r
-    $this->action(3);\r
-\r
-    while ($this->a !== null) {\r
-      switch ($this->a) {\r
-        case ' ':\r
-          if ($this->isAlphaNum($this->b)) {\r
-            $this->action(1);\r
-          }\r
-          else {\r
-            $this->action(2);\r
-          }\r
-          break;\r
-\r
-        case "\n":\r
-          switch ($this->b) {\r
-            case '{':\r
-            case '[':\r
-            case '(':\r
-            case '+':\r
-            case '-':\r
-              $this->action(1);\r
-              break;\r
-\r
-            case ' ':\r
-              $this->action(3);\r
-              break;\r
-\r
-            default:\r
-              if ($this->isAlphaNum($this->b)) {\r
-                $this->action(1);\r
-              }\r
-              else {\r
-                $this->action(2);\r
-              }\r
-          }\r
-          break;\r
-\r
-        default:\r
-          switch ($this->b) {\r
-            case ' ':\r
-              if ($this->isAlphaNum($this->a)) {\r
-                $this->action(1);\r
-                break;\r
-              }\r
-\r
-              $this->action(3);\r
-              break;\r
-\r
-            case "\n":\r
-              switch ($this->a) {\r
-                case '}':\r
-                case ']':\r
-                case ')':\r
-                case '+':\r
-                case '-':\r
-                case '"':\r
-                case "'":\r
-                  $this->action(1);\r
-                  break;\r
-\r
-                default:\r
-                  if ($this->isAlphaNum($this->a)) {\r
-                    $this->action(1);\r
-                  }\r
-                  else {\r
-                    $this->action(3);\r
-                  }\r
-              }\r
-              break;\r
-\r
-            default:\r
-              $this->action(1);\r
-              break;\r
-          }\r
-      }\r
-    }\r
-\r
-    return implode('', $this->output);\r
-  }\r
-\r
-  protected function next() {\r
-    $c = $this->get();\r
-\r
-    if ($c === '/') {\r
-      switch($this->peek()) {\r
-        case '/':\r
-          for (;;) {\r
-            $c = $this->get();\r
-\r
-            if (ord($c) <= self::ORD_LF) {\r
-              return $c;\r
-            }\r
-          }\r
-\r
-        case '*':\r
-          $this->get();\r
-\r
-          for (;;) {\r
-            switch($this->get()) {\r
-              case '*':\r
-                if ($this->peek() === '/') {\r
-                  $this->get();\r
-                  return ' ';\r
-                }\r
-                break;\r
-\r
-              case null:\r
-                throw new JSMinException('Unterminated comment.');\r
-            }\r
-          }\r
-\r
-        default:\r
-          return $c;\r
-      }\r
-    }\r
-\r
-    return $c;\r
-  }\r
-\r
-  protected function peek() {\r
-    $this->lookAhead = $this->get();\r
-    return $this->lookAhead;\r
-  }\r
-}\r
-\r
-// -- Exceptions ---------------------------------------------------------------\r
-class JSMinException extends Exception {}\r
+<?php
+/**
+ * jsmin.php - PHP implementation of Douglas Crockford's JSMin.
+ *
+ * This is pretty much a direct port of jsmin.c to PHP with just a few
+ * PHP-specific performance tweaks. Also, whereas jsmin.c reads from stdin and
+ * outputs to stdout, this library accepts a string as input and returns another
+ * string as output.
+ *
+ * PHP 5 or higher is required.
+ *
+ * Permission is hereby granted to use this version of the library under the
+ * same terms as jsmin.c, which has the following license:
+ *
+ * --
+ * Copyright (c) 2002 Douglas Crockford  (www.crockford.com)
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+ * of the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * The Software shall be used for Good, not Evil.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ * --
+ *
+ * @package JSMin
+ * @author Ryan Grove <ryan@wonko.com>
+ * @copyright 2002 Douglas Crockford <douglas@crockford.com> (jsmin.c)
+ * @copyright 2007 Ryan Grove <ryan@wonko.com> (PHP port)
+ * @license http://opensource.org/licenses/mit-license.php MIT License
+ * @version 1.1.0 (2007-06-01)
+ * @link http://code.google.com/p/jsmin-php/
+ */
+
+class JSMin {
+  const ORD_LF    = 10;
+  const ORD_SPACE = 32;
+
+  protected $a           = '';
+  protected $b           = '';
+  protected $input       = '';
+  protected $inputIndex  = 0;
+  protected $inputLength = 0;
+  protected $lookAhead   = null;
+  protected $output      = array();
+
+  // -- Public Static Methods --------------------------------------------------
+
+  public static function minify($js) {
+    $jsmin = new JSMin($js);
+    return $jsmin->min();
+  }
+
+  // -- Public Instance Methods ------------------------------------------------
+
+  public function __construct($input) {
+    $this->input       = str_replace("\r\n", "\n", $input);
+    $this->inputLength = strlen($this->input);
+  }
+
+  // -- Protected Instance Methods ---------------------------------------------
+
+  protected function action($d) {
+    switch($d) {
+      case 1:
+        $this->output[] = $this->a;
+
+      case 2:
+        $this->a = $this->b;
+
+        if ($this->a === "'" || $this->a === '"') {
+          for (;;) {
+            $this->output[] = $this->a;
+            $this->a        = $this->get();
+
+            if ($this->a === $this->b) {
+              break;
+            }
+
+            if (ord($this->a) <= self::ORD_LF) {
+              throw new JSMinException('Unterminated string literal.');
+            }
+
+            if ($this->a === '\\') {
+              $this->output[] = $this->a;
+              $this->a        = $this->get();
+            }
+          }
+        }
+
+      case 3:
+        $this->b = $this->next();
+
+        if ($this->b === '/' && (
+            $this->a === '(' || $this->a === ',' || $this->a === '=' ||
+            $this->a === ':' || $this->a === '[' || $this->a === '!' ||
+            $this->a === '&' || $this->a === '|' || $this->a === '?')) {
+
+          $this->output[] = $this->a;
+          $this->output[] = $this->b;
+
+          for (;;) {
+            $this->a = $this->get();
+
+            if ($this->a === '/') {
+              break;
+            }
+            elseif ($this->a === '\\') {
+              $this->output[] = $this->a;
+              $this->a        = $this->get();
+            }
+            elseif (ord($this->a) <= self::ORD_LF) {
+              throw new JSMinException('Unterminated regular expression '.
+                  'literal.');
+            }
+
+            $this->output[] = $this->a;
+          }
+
+          $this->b = $this->next();
+        }
+    }
+  }
+
+  protected function get() {
+    $c = $this->lookAhead;
+    $this->lookAhead = null;
+
+    if ($c === null) {
+      if ($this->inputIndex < $this->inputLength) {
+        $c = $this->input[$this->inputIndex];
+        $this->inputIndex += 1;
+      }
+      else {
+        $c = null;
+      }
+    }
+
+    if ($c === "\r") {
+      return "\n";
+    }
+
+    if ($c === null || $c === "\n" || ord($c) >= self::ORD_SPACE) {
+      return $c;
+    }
+
+    return ' ';
+  }
+
+  protected function isAlphaNum($c) {
+    return ord($c) > 126 || $c === '\\' || preg_match('/^[\w\$]$/', $c) === 1;
+  }
+
+  protected function min() {
+    $this->a = "\n";
+    $this->action(3);
+
+    while ($this->a !== null) {
+      switch ($this->a) {
+        case ' ':
+          if ($this->isAlphaNum($this->b)) {
+            $this->action(1);
+          }
+          else {
+            $this->action(2);
+          }
+          break;
+
+        case "\n":
+          switch ($this->b) {
+            case '{':
+            case '[':
+            case '(':
+            case '+':
+            case '-':
+              $this->action(1);
+              break;
+
+            case ' ':
+              $this->action(3);
+              break;
+
+            default:
+              if ($this->isAlphaNum($this->b)) {
+                $this->action(1);
+              }
+              else {
+                $this->action(2);
+              }
+          }
+          break;
+
+        default:
+          switch ($this->b) {
+            case ' ':
+              if ($this->isAlphaNum($this->a)) {
+                $this->action(1);
+                break;
+              }
+
+              $this->action(3);
+              break;
+
+            case "\n":
+              switch ($this->a) {
+                case '}':
+                case ']':
+                case ')':
+                case '+':
+                case '-':
+                case '"':
+                case "'":
+                  $this->action(1);
+                  break;
+
+                default:
+                  if ($this->isAlphaNum($this->a)) {
+                    $this->action(1);
+                  }
+                  else {
+                    $this->action(3);
+                  }
+              }
+              break;
+
+            default:
+              $this->action(1);
+              break;
+          }
+      }
+    }
+
+    return implode('', $this->output);
+  }
+
+  protected function next() {
+    $c = $this->get();
+
+    if ($c === '/') {
+      switch($this->peek()) {
+        case '/':
+          for (;;) {
+            $c = $this->get();
+
+            if (ord($c) <= self::ORD_LF) {
+              return $c;
+            }
+          }
+
+        case '*':
+          $this->get();
+
+          for (;;) {
+            switch($this->get()) {
+              case '*':
+                if ($this->peek() === '/') {
+                  $this->get();
+                  return ' ';
+                }
+                break;
+
+              case null:
+                throw new JSMinException('Unterminated comment.');
+            }
+          }
+
+        default:
+          return $c;
+      }
+    }
+
+    return $c;
+  }
+
+  protected function peek() {
+    $this->lookAhead = $this->get();
+    return $this->lookAhead;
+  }
+}
+
+// -- Exceptions ---------------------------------------------------------------
+class JSMinException extends Exception {}
 ?>
\ No newline at end of file
index 6f5c1ad..b92323c 100644 (file)
@@ -27,7 +27,7 @@
 /**
  * Module: Workspace publisher
  *
- * $Id: index.php 1613 2006-07-10 09:42:27Z liels_bugs $
+ * $Id$
  *
  * @author     Dmitry Dulepov <typo3@accio.lv>
  */
index bc6b420..8f70935 100644 (file)
-<?php\r
-\r
-// security - hide paths\r
-if (!defined('ADODB_DIR')) die();\r
-\r
-global $ADODB_INCLUDED_MEMCACHE;\r
-$ADODB_INCLUDED_MEMCACHE = 1;\r
-\r
-/* \r
-\r
-  V4.90 8 June 2006  (c) 2000-2007 John Lim (jlim#natsoft.com.my). All rights reserved.\r
-  Released under both BSD license and Lesser GPL library license. \r
-  Whenever there is any discrepancy between the two licenses, \r
-  the BSD license will take precedence. See License.txt. \r
-  Set tabs to 4 for best viewing.\r
-  \r
-  Latest version is available at http://adodb.sourceforge.net\r
-  \r
-*/\r
-\r
-       function &getmemcache($key,&$err, $timeout=0, $host, $port)\r
-       {\r
-               $false = false;\r
-               $err = false;\r
-\r
-               if (!function_exists('memcache_pconnect')) {\r
-                       $err = 'Memcache module PECL extension not found!';\r
-                       return $false;\r
-               }\r
-\r
-               $memcache = new Memcache;\r
-               if (!@$memcache->pconnect($host, $port)) {\r
-                       $err = 'Can\'t connect to memcache server on: '.$host.':'.$port;\r
-                       return $false;\r
-               }\r
-\r
-               $rs = $memcache->get($key);\r
-               if (!$rs) {\r
-                       $err = 'Item with such key doesn\'t exists on the memcached server.';\r
-                       return $false;\r
-               }\r
-\r
-               $tdiff = intval($rs->timeCreated+$timeout - time());\r
-               if ($tdiff <= 2) {\r
-                       switch($tdiff) {\r
-                               case 2: \r
-                                       if ((rand() & 15) == 0) {\r
-                                               $err = "Timeout 2";\r
-                                               return $false;\r
-                                       }\r
-                                       break;\r
-                               case 1:\r
-                                       if ((rand() & 3) == 0) {\r
-                                               $err = "Timeout 1";\r
-                                               return $false;\r
-                                       }\r
-                                       break;\r
-                               default: \r
-                                       $err = "Timeout 0";\r
-                                       return $false;\r
-                       }\r
-               }\r
-               return $rs;\r
-       }\r
-\r
-       function putmemcache($key, $rs, $host, $port, $compress, $debug=false)\r
-       {\r
-               $false = false;\r
-               $true = true;\r
-\r
-               if (!function_exists('memcache_pconnect')) {\r
-                       if ($debug) ADOConnection::outp(" Memcache module PECL extension not found!<br>\n");\r
-                       return $false;\r
-               }\r
-\r
-               $memcache = new Memcache;\r
-               if (!@$memcache->pconnect($host, $port)) {\r
-                       if ($debug) ADOConnection::outp(" Can't connect to memcache server on: $host:$port<br>\n");\r
-                       return $false;\r
-               }\r
-\r
-               $rs->timeCreated = time();\r
-               if (!$memcache->set($key, $rs, $compress, 0)) {\r
-                       if ($debug) ADOConnection::outp(" Failed to save data at the memcached server!<br>\n");\r
-                       return $false;\r
-               }\r
-               return $true;\r
-       }\r
-\r
-       function flushmemcache($key=false, $host, $port, $debug=false)\r
-       {\r
-               if (!function_exists('memcache_pconnect')) {\r
-                       if ($debug) ADOConnection::outp(" Memcache module PECL extension not found!<br>\n");\r
-                       return;\r
-               }\r
-\r
-               $memcache = new Memcache;\r
-               if (!@$memcache->pconnect($host, $port)) {\r
-                       if ($debug) ADOConnection::outp(" Can't connect to memcache server on: $host:$port<br>\n");\r
-                       return;\r
-               }\r
-\r
-               if ($key) {\r
-                       if (!$memcache->delete($key)) {\r
-                               if ($debug) ADOConnection::outp("CacheFlush: $key entery doesn't exist on memcached server!<br>\n");\r
-                       } else {\r
-                               if ($debug) ADOConnection::outp("CacheFlush: $key entery flushed from memcached server!<br>\n");\r
-                       }\r
-               } else {\r
-                       if (!$memcache->flush()) {\r
-                               if ($debug) ADOConnection::outp("CacheFlush: Failure flushing all enteries from memcached server!<br>\n");\r
-                       } else {\r
-                               if ($debug) ADOConnection::outp("CacheFlush: All enteries flushed from memcached server!<br>\n");\r
-                       }\r
-               }\r
-               return;\r
-       }\r
-?>\r
+<?php
+
+// security - hide paths
+if (!defined('ADODB_DIR')) die();
+
+global $ADODB_INCLUDED_MEMCACHE;
+$ADODB_INCLUDED_MEMCACHE = 1;
+
+/* 
+
+  V4.90 8 June 2006  (c) 2000-2007 John Lim (jlim#natsoft.com.my). All rights reserved.
+  Released under both BSD license and Lesser GPL library license. 
+  Whenever there is any discrepancy between the two licenses, 
+  the BSD license will take precedence. See License.txt. 
+  Set tabs to 4 for best viewing.
+  
+  Latest version is available at http://adodb.sourceforge.net
+  
+*/
+
+       function &getmemcache($key,&$err, $timeout=0, $host, $port)
+       {
+               $false = false;
+               $err = false;
+
+               if (!function_exists('memcache_pconnect')) {
+                       $err = 'Memcache module PECL extension not found!';
+                       return $false;
+               }
+
+               $memcache = new Memcache;
+               if (!@$memcache->pconnect($host, $port)) {
+                       $err = 'Can\'t connect to memcache server on: '.$host.':'.$port;
+                       return $false;
+               }
+
+               $rs = $memcache->get($key);
+               if (!$rs) {
+                       $err = 'Item with such key doesn\'t exists on the memcached server.';
+                       return $false;
+               }
+
+               $tdiff = intval($rs->timeCreated+$timeout - time());
+               if ($tdiff <= 2) {
+                       switch($tdiff) {
+                               case 2: 
+                                       if ((rand() & 15) == 0) {
+                                               $err = "Timeout 2";
+                                               return $false;
+                                       }
+                                       break;
+                               case 1:
+                                       if ((rand() & 3) == 0) {
+                                               $err = "Timeout 1";
+                                               return $false;
+                                       }
+                                       break;
+                               default: 
+                                       $err = "Timeout 0";
+                                       return $false;
+                       }
+               }
+               return $rs;
+       }
+
+       function putmemcache($key, $rs, $host, $port, $compress, $debug=false)
+       {
+               $false = false;
+               $true = true;
+
+               if (!function_exists('memcache_pconnect')) {
+                       if ($debug) ADOConnection::outp(" Memcache module PECL extension not found!<br>\n");
+                       return $false;
+               }
+
+               $memcache = new Memcache;
+               if (!@$memcache->pconnect($host, $port)) {
+                       if ($debug) ADOConnection::outp(" Can't connect to memcache server on: $host:$port<br>\n");
+                       return $false;
+               }
+
+               $rs->timeCreated = time();
+               if (!$memcache->set($key, $rs, $compress, 0)) {
+                       if ($debug) ADOConnection::outp(" Failed to save data at the memcached server!<br>\n");
+                       return $false;
+               }
+               return $true;
+       }
+
+       function flushmemcache($key=false, $host, $port, $debug=false)
+       {
+               if (!function_exists('memcache_pconnect')) {
+                       if ($debug) ADOConnection::outp(" Memcache module PECL extension not found!<br>\n");
+                       return;
+               }
+
+               $memcache = new Memcache;
+               if (!@$memcache->pconnect($host, $port)) {
+                       if ($debug) ADOConnection::outp(" Can't connect to memcache server on: $host:$port<br>\n");
+                       return;
+               }
+
+               if ($key) {
+                       if (!$memcache->delete($key)) {
+                               if ($debug) ADOConnection::outp("CacheFlush: $key entery doesn't exist on memcached server!<br>\n");
+                       } else {
+                               if ($debug) ADOConnection::outp("CacheFlush: $key entery flushed from memcached server!<br>\n");
+                       }
+               } else {
+                       if (!$memcache->flush()) {
+                               if ($debug) ADOConnection::outp("CacheFlush: Failure flushing all enteries from memcached server!<br>\n");
+                       } else {
+                               if ($debug) ADOConnection::outp("CacheFlush: All enteries flushed from memcached server!<br>\n");
+                       }
+               }
+               return;
+       }
+?>
index b8cd4ca..f02ce6a 100644 (file)
@@ -26,7 +26,7 @@
  *
  * @author Stanislas Rolland <stanislas.rolland(arobas)fructifor.ca>
  *
- * TYPO3 CVS ID: $Id: class.tx_rtehtmlarea_pi1.php 2449 2007-08-15 08:12:19Z ingorenner $
+ * TYPO3 CVS ID: $Id$
  *
  */