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 ) {
const CAS_PGT_STORAGE_FILE_DEFAULT_FORMAT
Default format used when storing PGT's to file.
write($pgt, $pgt_iou)
This method stores a PGT and its corresponding PGT Iou into a file.
const CAS_PGT_STORAGE_FILE_DEFAULT_PATH
Default path used when storing PGT's to file.
getPath()
This method returns the name of the directory where PGT's should be stored on the filesystem...
$_path
a string telling where PGT's should be stored on the filesystem.
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.
getFormat()
This method returns the format to use when storing PGT's on the filesystem.
The PGTStorageFile class is a class for PGT file storage.
const CAS_PGT_STORAGE_FILE_FORMAT_XML
phpCAS::setPGTStorageFile()'s 2nd parameter to write xml files
PGTStorage($cas_parent)
The constructor of the class, should be called only by inherited classes.
getPGTIouFilename($pgt_iou)
This method returns the filename corresponding to a PGT Iou.
traceBegin()
This method is used to indicate the start of the execution of a function in debug mode...
read($pgt_iou)
This method reads a PGT corresponding to a PGT Iou and deletes the corresponding file.
error($msg)
This method is used by interface methods to print an error and where the function was originally call...
getStorageType()
This method returns an informational string giving the type of storage used by the object (used for d...
trace($str)
This method is used to log something in debug mode.
const CAS_PGT_STORAGE_FILE_FORMAT_PLAIN
phpCAS::setPGTStorageFile()'s 2nd parameter to write plain text files
getStorageInfo()
This method returns an informational string giving informations on the parameters of the storage...
isInitialized()
This method tells if the storage has already been intialized.
The PGTStorage class is a generic class for PGT storage.
$_format
a string telling the format to use to store PGT's (plain or xml).
PGTStorageFile($cas_parent, $format, $path)
The class constructor, called by CASClient::SetPGTStorageFile().