From: Alexandre P. <al...@pa...> - 2006-01-13 20:13:19
|
Hi all, While parsing an RDF file, the RdfParser die() if it cannot open the file. (see syntax/RdfParser.php, line 2262) So, when using RDF-API to parse a set of files, it makes my app stops if one file cannot be found, while I'd just like it to go one step further. In this case, maybe it would be better to throw an exception instead of die() ? Then, the piece of code using RD-FAPI will use a try / catch when loading the model, so that it doesn't stop if a file is not available. Parser: $input =3D @fopen($base,'r'); if(!$input) throw new Exception("RDF Parser: Could not open File: $base. Stopped parsing."); then, in app: try { $model->load($uri); } catch (Exception e) { echo $e; } BTW, there's also a strange encoding bug with PHP5. Accentuated chars are not clearly recognized when parsing a file, even when specified the encoding. But it works fine if I don't use str2unicode_nfc() function anymore. I saw that in PHP5, the encoding is automatically detected, maybe that could be a cause. (see http://php.net/xml_parser_create_ns) Regards, Alex. |