$priority) { $formatter = new $className(); if(in_array($extension, $formatter->supportedExtensions())) { return $formatter; } } } /** * Checks if the extractor is supported on the current environment, * for example if the correct binaries or libraries are available. * * @return boolean */ abstract function isAvailable(); /** * Return an array of content types that the extractor can handle. * @return unknown_type */ abstract function supportedExtensions(); /** * Given a file path, extract the contents as text. * * @param $path * @return unknown_type */ abstract function getContent($path); } class FileTextExtractor_Exception extends Exception {}