ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
pgt-main.php
Go to the documentation of this file.
1 <?php
2 
18 class PGTStorage
19 {
25  // ########################################################################
26  // CONSTRUCTOR
27  // ########################################################################
28 
36  function PGTStorage($cas_parent)
37  {
39  if ( !$cas_parent->isProxy() ) {
40  phpCAS::error('defining PGT storage makes no sense when not using a CAS proxy');
41  }
43  }
44 
45  // ########################################################################
46  // DEBUGGING
47  // ########################################################################
48 
55  function getStorageType()
56  {
57  phpCAS::error(__CLASS__.'::'.__FUNCTION__.'() should never be called');
58  }
59 
66  function getStorageInfo()
67  {
68  phpCAS::error(__CLASS__.'::'.__FUNCTION__.'() should never be called');
69  }
70 
71  // ########################################################################
72  // ERROR HANDLING
73  // ########################################################################
74 
83  var $_error_message=FALSE;
84 
94  function setErrorMessage($error_message)
95  {
96  $this->_error_message = $error_message;
97  }
98 
108  function getErrorMessage()
109  {
110  return $this->_error_message;
111  }
112 
113  // ########################################################################
114  // INITIALIZATION
115  // ########################################################################
116 
124  var $_initialized = FALSE;
125 
133  function isInitialized()
134  {
135  return $this->_initialized;
136  }
137 
143  function init()
144  {
145  $this->_initialized = TRUE;
146  }
147 
148  // ########################################################################
149  // PGT I/O
150  // ########################################################################
151 
161  function write($pgt,$pgt_iou)
162  {
163  phpCAS::error(__CLASS__.'::'.__FUNCTION__.'() should never be called');
164  }
165 
175  function read($pgt_iou)
176  {
177  phpCAS::error(__CLASS__.'::'.__FUNCTION__.'() should never be called');
178  }
179 
182 }
183 
184 // include specific PGT storage classes
185 include_once(dirname(__FILE__).'/pgt-file.php');
186 include_once(dirname(__FILE__).'/pgt-db.php');
187 
188 ?>
getStorageInfo()
This virtual method returns an informational string giving informations on the parameters of the stor...
Definition: pgt-main.php:66
traceEnd($res='')
This method is used to indicate the end of the execution of a function in debug mode.
Definition: CAS.php:604
$_initialized
a boolean telling if the storage has already been initialized.
Definition: pgt-main.php:151
getStorageType()
This virtual method returns an informational string giving the type of storage used by the object (us...
Definition: pgt-main.php:55
traceBegin()
This method is used to indicate the start of the execution of a function in debug mode...
Definition: CAS.php:577
$_error_message
string used to store an error message.
Definition: pgt-main.php:110
error($msg)
This method is used by interface methods to print an error and where the function was originally call...
Definition: CAS.php:544
init()
This virtual method initializes the object.
Definition: pgt-main.php:143
isInitialized()
This method tells if the storage has already been intialized.
Definition: pgt-main.php:133
write($pgt, $pgt_iou)
This virtual method stores a PGT and its corresponding PGT Iuo.
Definition: pgt-main.php:161
setErrorMessage($error_message)
This method sets en error message, which can be read later by PGTStorage::getErrorMessage().
Definition: pgt-main.php:94
read($pgt_iou)
This virtual method reads a PGT corresponding to a PGT Iou and deletes the corresponding storage entr...
Definition: pgt-main.php:175
PGTStorage($cas_parent)
The constructor of the class, should be called only by inherited classes.
Definition: pgt-main.php:36
getErrorMessage()
This method returns an error message set by PGTStorage::setErrorMessage().
Definition: pgt-main.php:108
The PGTStorage class is a generic class for PGT storage.
Definition: pgt-main.php:45