Author: voxus
Date: 2006-08-23 19:40:00 +0400 (Wed, 23 Aug 2006)
New Revision: 1979
Modified:
branches/0.2/core/Cache/PeclMemcached.class.php
branches/0.2/doc/ChangeLog
branches/0.4/core/Cache/PeclMemcached.class.php
branches/0.4/doc/ChangeLog
trunk/core/Cache/PeclMemcached.class.php
trunk/doc/ChangeLog
Log:
* several stfu's introduced, sanity++
Modified: branches/0.2/core/Cache/PeclMemcached.class.php
===================================================================
--- branches/0.2/core/Cache/PeclMemcached.class.php 2006-08-22 12:31:40 UTC (rev 1978)
+++ branches/0.2/core/Cache/PeclMemcached.class.php 2006-08-23 15:40:00 UTC (rev 1979)
@@ -14,6 +14,7 @@
* Connector for PECL's Memcache extension by Antony Dovgal.
*
* @see http://tony2001.phpclub.net/
+ * @see http://pecl.php.net/package/memcache
*
* @ingroup Cache
**/
@@ -48,19 +49,28 @@
$this->alive = true;
} catch (BaseException $e) {
- return null;
+ // bad luck.
}
}
public function __destruct()
{
- if ($this->instance)
- $this->instance->close();
+ if ($this->alive) {
+ try {
+ $this->instance->close();
+ } catch (BaseException $e) {
+ // shhhh.
+ }
+ }
}
public function clean()
{
- $this->instance->flush();
+ try {
+ $this->instance->flush();
+ } catch (BaseException $e) {
+ $this->alive = false;
+ }
return $this;
}
@@ -80,22 +90,34 @@
public function delete($index)
{
- return $this->instance->delete($index);
+ try {
+ return $this->instance->delete($index);
+ } catch (BaseException $e) {
+ return $this->alive = false;
+ }
+
+ /* NOTREACHED */
}
protected function store(
$action, $key, &$value, $expires = Cache::EXPIRES_MEDIUM
)
{
- return
- $this->instance->$action(
- $key,
- $value,
- $this->compress
- ? MEMCACHE_COMPRESSED
- : false,
- $expires
- );
+ try {
+ return
+ $this->instance->$action(
+ $key,
+ $value,
+ $this->compress
+ ? MEMCACHE_COMPRESSED
+ : false,
+ $expires
+ );
+ } catch (BaseException $e) {
+ return $this->alive = false;
+ }
+
+ /* NOTREACHED */
}
}
?>
\ No newline at end of file
Modified: branches/0.2/doc/ChangeLog
===================================================================
--- branches/0.2/doc/ChangeLog 2006-08-22 12:31:40 UTC (rev 1978)
+++ branches/0.2/doc/ChangeLog 2006-08-23 15:40:00 UTC (rev 1979)
@@ -1,5 +1,9 @@
# $Id$
+2006-08-23 Konstantin V. Arkhipov <voxusAT@ATshadanakar.org>
+
+ * core/Cache/PeclMemcached.class.php: several stfu's from trunk.
+
2006-08-18 Konstantin V. Arkhipov <voxusAT@ATshadanakar.org>
* main/Containers/StorableContainer.class.php: backported
Modified: branches/0.4/core/Cache/PeclMemcached.class.php
===================================================================
--- branches/0.4/core/Cache/PeclMemcached.class.php 2006-08-22 12:31:40 UTC (rev 1978)
+++ branches/0.4/core/Cache/PeclMemcached.class.php 2006-08-23 15:40:00 UTC (rev 1979)
@@ -14,6 +14,7 @@
* Connector for PECL's Memcache extension by Antony Dovgal.
*
* @see http://tony2001.phpclub.net/
+ * @see http://pecl.php.net/package/memcache
*
* @ingroup Cache
**/
@@ -48,19 +49,28 @@
$this->alive = true;
} catch (BaseException $e) {
- return null;
+ // bad luck.
}
}
public function __destruct()
{
- if ($this->instance)
- $this->instance->close();
+ if ($this->alive) {
+ try {
+ $this->instance->close();
+ } catch (BaseException $e) {
+ // shhhh.
+ }
+ }
}
public function clean()
{
- $this->instance->flush();
+ try {
+ $this->instance->flush();
+ } catch (BaseException $e) {
+ $this->alive = false;
+ }
return $this;
}
@@ -80,22 +90,34 @@
public function delete($index)
{
- return $this->instance->delete($index);
+ try {
+ return $this->instance->delete($index);
+ } catch (BaseException $e) {
+ return $this->alive = false;
+ }
+
+ /* NOTREACHED */
}
protected function store(
$action, $key, &$value, $expires = Cache::EXPIRES_MEDIUM
)
{
- return
- $this->instance->$action(
- $key,
- $value,
- $this->compress
- ? MEMCACHE_COMPRESSED
- : false,
- $expires
- );
+ try {
+ return
+ $this->instance->$action(
+ $key,
+ $value,
+ $this->compress
+ ? MEMCACHE_COMPRESSED
+ : false,
+ $expires
+ );
+ } catch (BaseException $e) {
+ return $this->alive = false;
+ }
+
+ /* NOTREACHED */
}
}
?>
\ No newline at end of file
Modified: branches/0.4/doc/ChangeLog
===================================================================
--- branches/0.4/doc/ChangeLog 2006-08-22 12:31:40 UTC (rev 1978)
+++ branches/0.4/doc/ChangeLog 2006-08-23 15:40:00 UTC (rev 1979)
@@ -1,5 +1,9 @@
# $Id$
+2006-08-23 Konstantin V. Arkhipov
+
+ * * core/Cache/PeclMemcached.class.php: several stfu's from trunk.
+
2006-08-18 Konstantin V. Arkhipov
* main/Containers/StorableContainer.class.php: backported
Modified: trunk/core/Cache/PeclMemcached.class.php
===================================================================
--- trunk/core/Cache/PeclMemcached.class.php 2006-08-22 12:31:40 UTC (rev 1978)
+++ trunk/core/Cache/PeclMemcached.class.php 2006-08-23 15:40:00 UTC (rev 1979)
@@ -14,6 +14,7 @@
* Connector for PECL's Memcache extension by Antony Dovgal.
*
* @see http://tony2001.phpclub.net/
+ * @see http://pecl.php.net/package/memcache
*
* @ingroup Cache
**/
@@ -48,19 +49,28 @@
$this->alive = true;
} catch (BaseException $e) {
- return null;
+ // bad luck.
}
}
public function __destruct()
{
- if ($this->instance)
- $this->instance->close();
+ if ($this->alive) {
+ try {
+ $this->instance->close();
+ } catch (BaseException $e) {
+ // shhhh.
+ }
+ }
}
public function clean()
{
- $this->instance->flush();
+ try {
+ $this->instance->flush();
+ } catch (BaseException $e) {
+ $this->alive = false;
+ }
return $this;
}
@@ -80,22 +90,34 @@
public function delete($index)
{
- return $this->instance->delete($index);
+ try {
+ return $this->instance->delete($index);
+ } catch (BaseException $e) {
+ return $this->alive = false;
+ }
+
+ /* NOTREACHED */
}
protected function store(
$action, $key, &$value, $expires = Cache::EXPIRES_MEDIUM
)
{
- return
- $this->instance->$action(
- $key,
- $value,
- $this->compress
- ? MEMCACHE_COMPRESSED
- : false,
- $expires
- );
+ try {
+ return
+ $this->instance->$action(
+ $key,
+ $value,
+ $this->compress
+ ? MEMCACHE_COMPRESSED
+ : false,
+ $expires
+ );
+ } catch (BaseException $e) {
+ return $this->alive = false;
+ }
+
+ /* NOTREACHED */
}
}
?>
\ No newline at end of file
Modified: trunk/doc/ChangeLog
===================================================================
--- trunk/doc/ChangeLog 2006-08-22 12:31:40 UTC (rev 1978)
+++ trunk/doc/ChangeLog 2006-08-23 15:40:00 UTC (rev 1979)
@@ -1,16 +1,22 @@
# $Id$
+2006-08-23 Konstantin V. Arkhipov
+
+ * core/Cache/PeclMemcached.class.php: corrected behaviour in cases
+ when memcached's gone.
+
2006-08-22 Dmitry E. Demidov
-
- * main/Utils/HttpStatus.class.php: added enumeration of
- http status codes
-
- * main/Utils/HeaderUtils.class.php: changed method sendHttpStatus
+ * main/Utils/HttpStatus.class.php: added enumeration of http status
+ codes.
+
+ * main/Utils/HeaderUtils.class.php: changed method sendHttpStatus to
+ use introduced enumeration..
+
2006-08-21 Dmitry E. Demidov
-
- * main/Utils/HeaderUtils.class.php: added method sendHttpStatus
-
+
+ * main/Utils/HeaderUtils.class.php: added method sendHttpStatus.
+
2006-08-18 Konstantin V. Arkhipov
* main/Containers/Storable/StorableContainer.class.php: fixed issue
Received on Wed Aug 23 2006 - 19:40:01 MSD
This archive was generated by hypermail 2.2.0 : Sat Oct 27 2007 - 20:27:06 MSD