118 return 'path=`'.$this->getPath().
'\', format=`
'.$this->getFormat().'\
'';
144 if (getenv(
"OS")==
"Windows_NT"){
146 if (!preg_match(
'`^[a-zA-Z]:`',
$path)) {
147 phpCAS::error(
'an absolute path is needed for PGT storage to file');
154 if (
$path[0] !=
'/' ) {
155 phpCAS::error(
'an absolute path is needed for PGT storage to file');
163 $this->_path =
$path;
168 $this->_format = $format;
229 if ( $f=fopen($fname,
"w") ) {
230 if ( fputs($f,$pgt) === FALSE ) {
255 if ( !($f=fopen($fname,
"r")) ) {
258 if ( ($pgt=fgets($f)) === FALSE ) {
The PGTStorageFile class is a class for PGT file storage.
The PGTStorage class is a generic class for PGT storage.
error($msg)
This method is used by interface methods to print an error and where the function was originally call...
trace($str)
This method is used to log something in debug mode.
traceBegin()
This method is used to indicate the start of the execution of a function in debug mode.
traceEnd($res='')
This method is used to indicate the end of the execution of a function in debug mode.
init()
This method is used to initialize the storage.
write($pgt, $pgt_iou)
This method stores a PGT and its corresponding PGT Iou into a file.
getPGTIouFilename($pgt_iou)
This method returns the filename corresponding to a PGT Iou.
read($pgt_iou)
This method reads a PGT corresponding to a PGT Iou and deletes the corresponding file.
getPath()
This method returns the name of the directory where PGT's should be stored on the filesystem.
getStorageType()
This method returns an informational string giving the type of storage used by the object (used for d...
PGTStorageFile($cas_parent, $format, $path)
The class constructor, called by CASClient::SetPGTStorageFile().
getStorageInfo()
This method returns an informational string giving informations on the parameters of the storage.
$_path
a string telling where PGT's should be stored on the filesystem.
getFormat()
This method returns the format to use when storing PGT's on the filesystem.
$_format
a string telling the format to use to store PGT's (plain or xml).
isInitialized()
This method tells if the storage has already been intialized.
PGTStorage($cas_parent)
The constructor of the class, should be called only by inherited classes.
const CAS_PGT_STORAGE_FILE_DEFAULT_PATH
Default path used when storing PGT's to file.
const CAS_PGT_STORAGE_FILE_FORMAT_PLAIN
phpCAS::setPGTStorageFile()'s 2nd parameter to write plain text files
const CAS_PGT_STORAGE_FILE_FORMAT_XML
phpCAS::setPGTStorageFile()'s 2nd parameter to write xml files
const CAS_PGT_STORAGE_FILE_DEFAULT_FORMAT
Default format used when storing PGT's to file.