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