spiral
[ class tree: spiral ] [ index: spiral ] [ all elements ]

Class: SpiralCache

Source Location: /base/SpiralCache.php

Class Overview


キャッシュクラス


Methods



Class Details

[line 16]
キャッシュクラス

キャッシュサーバーに対する操作をラップするクラスで、KeyValue形式のインタフェースを提供します。

インスタンスを作成する時は SpiralクラスのgetCache() をご利用ください。

  • 生成したキーは、操作せずに900秒経過すると、自動的に削除されます。




[ Top ]


Class Methods


method decr [line 231]

boolean decr( [string $_key = null], [ $_value = 1])

指定されたキーに登録されている値をデクリメントします。

[ サンプル ]

  1.  <?php
  2.      $cache   $SPIRAL->getCache();
  3.      $boolean $cache->decr($key);
  4.  ?>




Tags:

access:  public


Parameters:

string   $_key   キー
   $_value  

[ Top ]

method delete [line 73]

mixed delete( [string $_key = null])

指定されたキーを削除します。

[ サンプル ]

  1.  <?php
  2.      $cache   $SPIRAL->getCache();
  3.      $old_value $cache->delete($key);
  4.  ?>




Tags:

return:  削除前の値
access:  public


Parameters:

string   $_key   キー

[ Top ]

method exists [line 181]

boolean exists( [string $_key = null])

指定されたキーがキャッシュに登録されていれば true を返します。

[ サンプル ]

  1.  <?php
  2.      $cache   $SPIRAL->getCache();
  3.      $boolean $cache->exists($key);
  4.  ?>




Tags:

access:  public


Parameters:

string   $_key   キー

[ Top ]

method get [line 156]

mixed get( [string $_key = null])

指定されたキーに登録されている値を取得します。

[ サンプル ]

  1.  <?php
  2.      $cache $SPIRAL->getCache();
  3.      $value $cache->get($key);
  4.  ?>




Tags:

return:  
access:  public


Parameters:

string   $_key   キー

[ Top ]

method incr [line 206]

boolean incr( [string $_key = null], [ $_value = 1])

指定されたキーに登録されている値をインクリメントします。

[ サンプル ]

  1.  <?php
  2.      $cache   $SPIRAL->getCache();
  3.      $boolean $cache->incr($key);
  4.  ?>




Tags:

access:  public


Parameters:

string   $_key   キー
   $_value  

[ Top ]

method set [line 129]

mixed set( [string $_key = null], [mixed $_val = null])

指定されたキーで指定された値を登録します。

[仕様]
・すでにキーが登録されている場合、変更前の値を返します。

[ サンプル ]

  1.  <?php
  2.      $cache     $SPIRAL->getCache();
  3.      $old_value $cache->set($key$value);
  4.  ?>




Tags:

return:  上書き前の値
access:  public


Parameters:

string   $_key   キー
mixed   $_val  

[ Top ]

method setTimeout [line 98]

void setTimeout( [int $_timeout = 900])

キャッシュの有効期限を設定します。

[ サンプル ]

  1.  <?php
  2.      $cache $SPIRAL->getCache();
  3.      $value $cache->setTimeout(10);
  4.  ?>




Tags:

access:  public


Parameters:

int   $_timeout   有効期限(秒)で1〜900を指定可能です。初期値は900となります。

[ Top ]


Documentation generated on Tue, 19 Mar 2024 17:34:57 +0900 by phpDocumentor 1.4.4