mirror of
https://github.com/silverstripe/silverstripe-fulltextsearch
synced 2024-10-22 14:05:29 +02:00
Added php 7.2 support
This commit is contained in:
parent
a408c9f7b5
commit
0553ce5729
@ -4,6 +4,7 @@
|
||||
[![Build Status](https://secure.travis-ci.org/silverstripe/silverstripe-fulltextsearch.png?branch=master)](http://travis-ci.org/silverstripe/silverstripe-fulltextsearch)
|
||||
|
||||
Adds support for fulltext search engines like Sphinx and Solr to SilverStripe CMS.
|
||||
Compatible with PHP 7.2
|
||||
|
||||
## Maintainer Contact
|
||||
|
||||
|
@ -1,5 +1,9 @@
|
||||
<?php
|
||||
|
||||
// Ensure compatibility with PHP 7.2 ("object" is a reserved word),
|
||||
// with SilverStripe 3.6 (using Object) and SilverStripe 3.7 (using SS_Object)
|
||||
if (!class_exists('SS_Object')) class_alias('Object', 'SS_Object');
|
||||
|
||||
global $databaseConfig;
|
||||
if (isset($databaseConfig['type'])) SearchUpdater::bind_manipulation_capture();
|
||||
|
||||
|
@ -342,7 +342,7 @@ abstract class SearchIndex extends ViewableData
|
||||
if (preg_match('/^(\w+)\(/', $type, $match)) {
|
||||
$type = $match[1];
|
||||
}
|
||||
list($type, $args) = Object::parse_class_spec($type);
|
||||
list($type, $args) = SS_Object::parse_class_spec($type);
|
||||
if (is_subclass_of($type, 'StringField')) {
|
||||
$this->addFulltextField($field);
|
||||
}
|
||||
|
@ -12,7 +12,7 @@
|
||||
*
|
||||
* TODO: The way we bind in is awful hacky.
|
||||
*/
|
||||
class SearchUpdater extends Object
|
||||
class SearchUpdater extends SS_Object
|
||||
{
|
||||
/**
|
||||
* Replace the database object with a subclass that captures all manipulations and passes them to us
|
||||
|
@ -117,7 +117,7 @@ class Solr
|
||||
$options = self::solr_options();
|
||||
|
||||
if (!self::$service_singleton) {
|
||||
self::$service_singleton = Object::create(
|
||||
self::$service_singleton = SS_Object::create(
|
||||
$options['service'], $options['host'], $options['port'], $options['path']
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user