mirror of
https://github.com/silverstripe/silverstripe-textextraction
synced 2024-10-22 09:06:00 +00:00
FileTextExtractor->isAvailable()
This commit is contained in:
parent
977c4e49c9
commit
f3fcf60c0f
@ -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");
|
||||||
}
|
}
|
||||||
|
@ -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");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user