Interface Inx_Api_Plugin_PluginStore

Description

The Inx_Api_Plugin_PluginStore is used by plug-ins for storing small amounts of data on the Inxmail Professional system.

The Inx_Api_Plugin_PluginStore is used by plug-ins for storing small amounts of data on the Inxmail Professional system. Each plug-in may only use its isolated storage, identified by the plug-in secret. The data is allocated using unique keys. <strong>Note:</strong> It is <strong>strongly recommended</strong> to upload a maximum of 1 MB of data. Uploading too much data may significantly reduce the performance of the server.

The following snippet shows how to upload an image to the plug-in store of a plug-in with the secret id "plug-in secret":

 $oPluginStore = $oSession->getPluginStore();
 $handle = fopen("test.png","r");
 $oPluginStore->put("plug-in secret","test-image",$handle);

The following snippet shows how to download the previously uploaded image for saving and displaying:

 $oPluginStore = $oSession->getPluginStore();
 $oInputStream = $oPluginStore->get("plug-in secret", "test-image");

 $validate = fopen("validate.png",'w') or die("can't open file");

 while(($chunk = $oInputStream->read()) != -1)
 {
	fwrite($validate,$chunk);
 }

 fclose($validate);

 echo '<img src="validate.png">';

  • version: $Revision: 2934 $ $Date: 2005-07-04 17:00:09 +0200 (Mo, 04 Jul 2005) $ $Author: bgn $
  • since: API 1.7.0

Located in /Api/Plugin/PluginStore.php (line 48)


	
			
Method Summary
Inx_Api_InputStream get (string $secretId, string $key)
array getKeys (string $secretId)
bool put (string $secretId, string $key, Inx_Api_InputStream $is)
void remove (string $secretId, string $key)
void removeAll (string $secretId)
Methods
get (line 72)

Returns an Inx_Api_InputStream to download the data for the given key.

Returns an Inx_Api_InputStream to download the data for the given key.

  • return: an Inx_Api_InputStream to download the data.
  • throws: Inx_Api_DataException if the there is no data for that key (i.e. the key does not exist).
  • access: public
Inx_Api_InputStream get (string $secretId, string $key)
  • string $secretId: the secret id of the plug-in.
  • string $key: the key of the data to download.
getKeys (line 81)

Returns all keys which are stored for the given plug-in secret id.

Returns all keys which are stored for the given plug-in secret id.

  • return: an array of string keys.
  • access: public
array getKeys (string $secretId)
  • string $secretId: the secret id of the plug-in.
put (line 61)

Uploads data from a plug-in which needs to be stored in Inxmail Professional.

Uploads data from a plug-in which needs to be stored in Inxmail Professional. The data should be no bigger than 1 MB. Uploading more data is <strong>strongly discouraged</strong> as it may significantly reduce the performance of the server.

  • return: true if the upload was successful, false otherwise.
  • access: public
bool put (string $secretId, string $key, Inx_Api_InputStream $is)
  • string $secretId: the secret id of the plug-in.
  • string $key: the key for the uploaded data.
  • Inx_Api_InputStream $is: the input stream to read the data from.
remove (line 90)

Removes the given key and its value from the plug-in store.

Removes the given key and its value from the plug-in store. Removing an unknown key will have no effect.

  • access: public
void remove (string $secretId, string $key)
  • string $secretId: the secret id of the plug-in.
  • string $key: the key of the data which should be deleted.
removeAll (line 98)

Removes all keys from the plug-in store for the given plug-in secret id.

Removes all keys from the plug-in store for the given plug-in secret id.

  • access: public
void removeAll (string $secretId)
  • string $secretId: the secret id of the plug-in.

Documentation generated on Thu, 17 Sep 2015 14:27:28 +0200 by phpDocumentor 1.3.2