From b86483abc43d09d018c764fb996d12edbe51ace1 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Tue, 7 May 2013 18:47:56 +0200 Subject: [PATCH] 3.1 compat --- README.md | 2 +- code/extractors/FileTextExtractor.php | 5 +++-- code/extractors/HTMLTextExtractor.php | 2 +- code/extractors/SolrCellTextExtractor.php | 8 ++++++-- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 674d59a..0d07526 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ Note: Previously part of the [sphinx module](https://github.com/silverstripe/sil ## Requirements - * SilverStripe 3.0 + * SilverStripe 3.1 * (optional) [XPDF](http://www.foolabs.com/xpdf/) (`pdftotext` utility) * (optional) [Apache Solr with ExtracingRequestHandler](http://wiki.apache.org/solr/ExtractingRequestHandler) diff --git a/code/extractors/FileTextExtractor.php b/code/extractors/FileTextExtractor.php index b721a04..a43427f 100644 --- a/code/extractors/FileTextExtractor.php +++ b/code/extractors/FileTextExtractor.php @@ -10,9 +10,10 @@ abstract class FileTextExtractor extends Object { * Set priority from 0-100. * The highest priority extractor for a given content type will be selected. * + * @config * @var int */ - public static $priority = 50; + private static $priority = 50; protected static $sorted_extractor_classes = null; @@ -28,7 +29,7 @@ abstract class FileTextExtractor extends Object { $classes = ClassInfo::subclassesFor("FileTextExtractor"); array_shift($classes); $sortedClasses = array(); - foreach($classes as $class) $sortedClasses[$class] = Object::get_static($class, 'priority'); + foreach($classes as $class) $sortedClasses[$class] = Config::inst()->get($class, 'priority'); arsort($sortedClasses); self::$sorted_extractor_classes = $sortedClasses; diff --git a/code/extractors/HTMLTextExtractor.php b/code/extractors/HTMLTextExtractor.php index 76a9918..803d99e 100644 --- a/code/extractors/HTMLTextExtractor.php +++ b/code/extractors/HTMLTextExtractor.php @@ -18,7 +18,7 @@ class HTMLTextExtractor extends FileTextExtractor { /** * Lower priority because its not the most clever HTML extraction. If there is something better, use it */ - public static $priority = 10; + private static $priority = 10; /** * Extracts content from regex, by using strip_tags() diff --git a/code/extractors/SolrCellTextExtractor.php b/code/extractors/SolrCellTextExtractor.php index 57c6b3a..103bfe8 100644 --- a/code/extractors/SolrCellTextExtractor.php +++ b/code/extractors/SolrCellTextExtractor.php @@ -12,9 +12,13 @@ use Guzzle\Http\Client; */ class SolrCellTextExtractor extends FileTextExtractor { - public static $base_url; + /** + * @config + * @var [type] + */ + private static $base_url; - public static $priority = 75; + private static $priority = 75; protected $httpClient;