4
* @file CAS/PGTStorage/pgt-main.php
5
* Basic class for PGT storage
10
* The PGTStorage class is a generic class for PGT storage. This class should
11
* not be instanciated itself but inherited by specific PGT storage classes.
13
* @author Pascal Aubry <pascal.aubry at univ-rennes1.fr>
15
* @ingroup internalPGTStorage
21
* @addtogroup internalPGTStorage
25
// ########################################################################
27
// ########################################################################
30
* The constructor of the class, should be called only by inherited classes.
32
* @param $cas_parent the CASclient instance that creates the current object.
36
function PGTStorage($cas_parent)
39
if ( !$cas_parent->isProxy() ) {
40
phpCAS::error('defining PGT storage makes no sense when not using a CAS proxy');
45
// ########################################################################
47
// ########################################################################
50
* This virtual method returns an informational string giving the type of storage
51
* used by the object (used for debugging purposes).
55
function getStorageType()
57
phpCAS::error(__CLASS__.'::'.__FUNCTION__.'() should never be called');
61
* This virtual method returns an informational string giving informations on the
62
* parameters of the storage.(used for debugging purposes).
66
function getStorageInfo()
68
phpCAS::error(__CLASS__.'::'.__FUNCTION__.'() should never be called');
71
// ########################################################################
73
// ########################################################################
76
* string used to store an error message. Written by PGTStorage::setErrorMessage(),
77
* read by PGTStorage::getErrorMessage().
81
* @deprecated not used.
83
var $_error_message=FALSE;
86
* This method sets en error message, which can be read later by
87
* PGTStorage::getErrorMessage().
89
* @param $error_message an error message
92
* @deprecated not used.
94
function setErrorMessage($error_message)
96
$this->_error_message = $error_message;
100
* This method returns an error message set by PGTStorage::setErrorMessage().
102
* @return an error message when set by PGTStorage::setErrorMessage(), FALSE
106
* @deprecated not used.
108
function getErrorMessage()
110
return $this->_error_message;
113
// ########################################################################
115
// ########################################################################
118
* a boolean telling if the storage has already been initialized. Written by
119
* PGTStorage::init(), read by PGTStorage::isInitialized().
124
var $_initialized = FALSE;
127
* This method tells if the storage has already been intialized.
133
function isInitialized()
135
return $this->_initialized;
139
* This virtual method initializes the object.
145
$this->_initialized = TRUE;
148
// ########################################################################
150
// ########################################################################
153
* This virtual method stores a PGT and its corresponding PGT Iuo.
154
* @note Should never be called.
156
* @param $pgt the PGT
157
* @param $pgt_iou the PGT iou
161
function write($pgt,$pgt_iou)
163
phpCAS::error(__CLASS__.'::'.__FUNCTION__.'() should never be called');
167
* This virtual method reads a PGT corresponding to a PGT Iou and deletes
168
* the corresponding storage entry.
169
* @note Should never be called.
171
* @param $pgt_iou the PGT iou
175
function read($pgt_iou)
177
phpCAS::error(__CLASS__.'::'.__FUNCTION__.'() should never be called');
184
// include specific PGT storage classes
185
include_once(dirname(__FILE__).'/pgt-file.php');
186
include_once(dirname(__FILE__).'/pgt-db.php');
b'\\ No newline at end of file'