FileTextExtractor->isAvailable()

This commit is contained in:
Ingo Schommer 2012-08-22 18:25:55 +02:00
parent 977c4e49c9
commit f3fcf60c0f
2 changed files with 11 additions and 0 deletions

View File

@ -6,6 +6,11 @@
* *
*/ */
class HTMLTextExtractor extends FileTextExtractor { class HTMLTextExtractor extends FileTextExtractor {
function isAvailable() {
return true;
}
function supportedExtensions() { function supportedExtensions() {
return array("html", "htm", "xhtml"); return array("html", "htm", "xhtml");
} }

View File

@ -6,6 +6,12 @@
* *
*/ */
class PDFTextExtractor extends FileTextExtractor { class PDFTextExtractor extends FileTextExtractor {
function isAvailable() {
$bin = $this->bin('pdftotext');
return (file_exists($bin) && is_executable($bin));
}
function supportedExtensions() { function supportedExtensions() {
return array("pdf"); return array("pdf");
} }