SimpleSAML_Logger::warning('Serialize metadata handler: Unable to open directory: '.var_export($this->directory,TRUE));
* @return array An array with the available sets.
return$ret;
*/
}
publicfunctiongetMetadataSets()
{
while(($entry=readdir($dh))!==FALSE){
$ret=array();
if($entry[0]==='.'){
$dh=@opendir($this->directory);
/* Skip '..', '.' and hidden files. */
if($dh===false){
continue;
SimpleSAML_Logger::warning(
}
'Serialize metadata handler: Unable to open directory: '.var_export($this->directory,true)
);
$path=$this->directory.'/'.$entry;
return$ret;
}
if(!is_dir($path)){
SimpleSAML_Logger::warning('Serialize metadata handler: Metadata directory contained a file where only directories should exist: '.var_export($path,TRUE));
while(($entry=readdir($dh))!==false){
continue;
}
if($entry[0]==='.'){
// skip '..', '.' and hidden files
$ret[]=rawurldecode($entry);
continue;
}
}
closedir($dh);
$path=$this->directory.'/'.$entry;
return$ret;
if(!is_dir($path)){
}
SimpleSAML_Logger::warning(
'Serialize metadata handler: Metadata directory contained a file where only directories should '.
'exist: '.var_export($path,true)
/**
);
* Retrieve a list of all available metadata for a given set.
continue;
*
}
* @param string $set The set we are looking for metadata in.
* @return array An associative array with all the metadata for the given set.
$ret[]=rawurldecode($entry);
*/
}
publicfunctiongetMetadataSet($set){
assert('is_string($set)');
closedir($dh);
$ret=array();
return$ret;
}
$dir=$this->directory.'/'.rawurlencode($set);
if(!is_dir($dir)){
/* Probably some code asked for a metadata set which wasn't available. */
/**
return$ret;
* Retrieve a list of all available metadata for a given set.
}
*
* @param string $set The set we are looking for metadata in.
$dh=@opendir($dir);
*
if($dh===FALSE){
* @return array An associative array with all the metadata for the given set.
SimpleSAML_Logger::warning('Serialize metadata handler: Unable to open directory: '.var_export($dir,TRUE));
*/
return$ret;
publicfunctiongetMetadataSet($set)
}
{
assert('is_string($set)');
$extLen=strlen(self::EXTENSION);
$ret=array();
while(($file=readdir($dh))!==FALSE){
if(strlen($file)<=$extLen){
$dir=$this->directory.'/'.rawurlencode($set);
continue;
if(!is_dir($dir)){
}
// probably some code asked for a metadata set which wasn't available
return$ret;
if(substr($file,-$extLen)!==self::EXTENSION){
}
continue;
}
$dh=@opendir($dir);
if($dh===false){
$entityId=substr($file,0,-$extLen);
SimpleSAML_Logger::warning('Serialize metadata handler: Unable to open directory: '.var_export($dir,true));
$entityId=rawurldecode($entityId);
return$ret;
}
$md=$this->getMetaData($entityId,$set);
if($md!==NULL){
$extLen=strlen(self::EXTENSION);
$ret[$entityId]=$md;
}
while(($file=readdir($dh))!==false){
}
if(strlen($file)<=$extLen){
continue;
closedir($dh);
}
return$ret;
if(substr($file,-$extLen)!==self::EXTENSION){
}
continue;
}
/**
$entityId=substr($file,0,-$extLen);
* Retrieve a metadata entry.
$entityId=rawurldecode($entityId);
*
* @param string $entityId The entityId we are looking up.
$md=$this->getMetaData($entityId,$set);
* @param string $set The set we are looking for metadata in.
if($md!==null){
* @return array An associative array with metadata for the given entity, or NULL if we are unable to
$ret[$entityId]=$md;
* locate the entity.
}
*/
}
publicfunctiongetMetaData($entityId,$set){
assert('is_string($entityId)');
closedir($dh);
assert('is_string($set)');
return$ret;
$filePath=$this->getMetadataPath($entityId,$set);
}
if(!file_exists($filePath)){
returnNULL;
/**
}
* Retrieve a metadata entry.
*
$data=@file_get_contents($filePath);
* @param string $entityId The entityId we are looking up.
if($data===FALSE){
* @param string $set The set we are looking for metadata in.