From ced9042f6eb2c8a029d1365f6777628dd0935748 Mon Sep 17 00:00:00 2001 From: gggeek Date: Sat, 23 Mar 2019 23:26:59 +0100 Subject: [PATCH] Fix: in content stats page, request Solr data using an url which corresponds to Solr 4.10 admin interface --- classes/contentstatsgatherer.php | 13 +++++++++---- doc/changelogs/CHANGELOG-0.9.11-to-0.9.12 | 3 +++ extension.xml | 2 +- ezinfo.php | 2 +- 4 files changed, 14 insertions(+), 6 deletions(-) create mode 100644 doc/changelogs/CHANGELOG-0.9.11-to-0.9.12 diff --git a/classes/contentstatsgatherer.php b/classes/contentstatsgatherer.php index c70c2df..8d25a87 100644 --- a/classes/contentstatsgatherer.php +++ b/classes/contentstatsgatherer.php @@ -71,10 +71,15 @@ static function gather() if ( in_array( 'ezfind', eZExtension::activeExtensions() ) ) { $ini = eZINI::instance( 'solr.ini' ); - $ezfindpingurl = $ini->variable( 'SolrBase', 'SearchServerURI' )."/admin/stats.jsp"; - $data = eZHTTPTool::getDataByURL( $ezfindpingurl, false ); - //var_dump( $data ); - if ( preg_match( '#([^<]+)#', $data, $matches ) ) + // remove the last part of the url, corresponding to the core name + $ezfindSatsUrl = substr( + $ini->variable( 'SolrBase', 'SearchServerURI' ), + 0, + strrpos( rtrim( $ini->variable( 'SolrBase', 'SearchServerURI' ), '/' ), '/' ) + ) . "/admin/cores"; + $data = eZHTTPTool::getDataByURL( $ezfindSatsUrl, false ); + /// @todo add support for multi-core setups + if ( preg_match( '#([^<]+)#', $data, $matches ) ) { $contentList['Documents in SOLR'] = trim( $matches[1] ); } diff --git a/doc/changelogs/CHANGELOG-0.9.11-to-0.9.12 b/doc/changelogs/CHANGELOG-0.9.11-to-0.9.12 new file mode 100644 index 0000000..7696210 --- /dev/null +++ b/doc/changelogs/CHANGELOG-0.9.11-to-0.9.12 @@ -0,0 +1,3 @@ +Changes from 0.9.11 to 0.9.12 - unreleased + +Fix: in content stats page, request Solr data using an url which corresponds to Solr 4.10 admin interface diff --git a/extension.xml b/extension.xml index 20e9235..c54fffc 100644 --- a/extension.xml +++ b/extension.xml @@ -2,7 +2,7 @@ ggsysinfo - 0.9.11 + 0.9.12 Copyright (C) 2008-2019 Gaetano Giunta GNU General Public License v2.0 diff --git a/ezinfo.php b/ezinfo.php index 2cea4bc..bbca207 100644 --- a/ezinfo.php +++ b/ezinfo.php @@ -5,7 +5,7 @@ class ggsysinfoInfo static function info() { return array( 'Name' => "ggsysinfo", - 'Version' => "0.9.11", + 'Version' => "0.9.12", 'Copyright' => "Copyright (C) 2008-2019 Gaetano Giunta", 'License' => "GNU General Public License v2.0" );