mirror of
https://ghproxy.net/https://github.com/elementor/wp2static.git
synced 2025-09-05 12:02:54 +08:00
v1.4 Dropbox support
This commit is contained in:
parent
ed36c88897
commit
7e67a92645
52 changed files with 5913 additions and 4 deletions
61
library/Dropbox/ValueStore.php
Normal file
61
library/Dropbox/ValueStore.php
Normal file
|
@ -0,0 +1,61 @@
|
|||
<?php
|
||||
namespace Dropbox;
|
||||
|
||||
/**
|
||||
* A contract for a class which provides simple get/set/clear access to a single string
|
||||
* value. {@link ArrayEntryStore} provides an implementation of this for storing a value
|
||||
* in a single array element.
|
||||
*
|
||||
* Example implementation for a Memcache-based backing store:
|
||||
*
|
||||
* <code>
|
||||
* class MemcacheValueStore implements ValueStore
|
||||
* {
|
||||
* private $key;
|
||||
* private $memcache;
|
||||
*
|
||||
* function __construct($memcache, $key)
|
||||
* {
|
||||
* $this->memcache = $memcache;
|
||||
* $this->key = $key;
|
||||
* }
|
||||
*
|
||||
* function get()
|
||||
* {
|
||||
* $value = $this->memcache->get($this->getKey());
|
||||
* return $value === false ? null : base64_decode($value);
|
||||
* }
|
||||
*
|
||||
* function set($value)
|
||||
* {
|
||||
* $this->memcache->set($this->key, base64_encode($value));
|
||||
* }
|
||||
*
|
||||
* function clear()
|
||||
* {
|
||||
* $this->memcache->delete($this->key);
|
||||
* }
|
||||
* }
|
||||
* </code>
|
||||
*/
|
||||
interface ValueStore
|
||||
{
|
||||
/**
|
||||
* Returns the entry's current value or <code>null</code> if nothing is set.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function get();
|
||||
|
||||
/**
|
||||
* Set the entry to the given value.
|
||||
*
|
||||
* @param string $value
|
||||
*/
|
||||
function set($value);
|
||||
|
||||
/**
|
||||
* Remove the value.
|
||||
*/
|
||||
function clear();
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue