1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
try{
/*** class create new DirectoryIterator Object ***/
$mydirIterator = new DirectoryIterator($this->directory);
foreach ( $checkExtension=new ExtensionFilter($mydirIterator,$pattern) as $file )
{
var_dump(strpos($file->getFilename(),"à"));
$element = $this->directoryXML->createElement("photo");
// ajoute l'attribut source = nom du fichier medias
$element->setAttribute('source',$file);
// ajoute le noeud
$this->node->appendChild($element);
}
$xml = $this->directoryXML->saveXML();
return $xml;
}catch(Exception $e){
return "directoryError";
} |
Partager