mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
docs: Remove search.php and all references
libvirt.org/search.php drops into some kind of screen which I guess is supposed to show a search bar with options, but presently for me renders as nothing but the following text: Search the documentation on Libvirt.org The search service indexes the libvirt APIs and documentation as well as the libvir-list@redhat.com mailing-list archives. To use it simply provide a set of keywords: The main page search bar now redirects to google, this page is broken, I say we just remove it and move on. Reviewed-by: Daniel P. Berrange <berrange@redhat.com> Signed-off-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
parent
ca1943de52
commit
fb0d6049cc
1
.gitignore
vendored
1
.gitignore
vendored
@ -66,7 +66,6 @@
|
||||
/docs/libvirt-qemu-*.xml
|
||||
/docs/libvirt-refs.xml
|
||||
/docs/news.html.in
|
||||
/docs/search.php
|
||||
/docs/todo.html.in
|
||||
/examples/admin/client_close
|
||||
/examples/admin/client_info
|
||||
|
@ -128,10 +128,6 @@ dot_html_in = \
|
||||
$(notdir $(wildcard $(srcdir)/*.html.in))
|
||||
dot_html = $(dot_html_in:%.html.in=%.html)
|
||||
|
||||
dot_php_in = $(notdir $(wildcard $(srcdir)/*.php.in))
|
||||
dot_php_code_in = $(dot_php_in:%.php.in=%.php.code.in)
|
||||
dot_php = $(dot_php_in:%.php.in=%.php)
|
||||
|
||||
xml = \
|
||||
libvirt-api.xml \
|
||||
libvirt-refs.xml
|
||||
@ -175,7 +171,7 @@ EXTRA_DIST= \
|
||||
$(dot_html) $(dot_html_in) $(gif) $(apihtml) $(apipng) \
|
||||
$(devhelphtml) $(devhelppng) $(devhelpcss) $(devhelpxsl) \
|
||||
$(xml) $(qemu_xml) $(lxc_xml) $(admin_xml) $(fig) $(png) $(css) \
|
||||
$(logofiles) $(dot_php_in) $(dot_php_code_in) $(dot_php)\
|
||||
$(logofiles) \
|
||||
$(internals_html_in) $(internals_html) $(fonts) \
|
||||
aclperms.htmlinc \
|
||||
hvsupport.pl \
|
||||
@ -192,7 +188,6 @@ MAINTAINERCLEANFILES = \
|
||||
$(addprefix $(srcdir)/,$(apihtml)) \
|
||||
$(addprefix $(srcdir)/,$(devhelphtml)) \
|
||||
$(addprefix $(srcdir)/,$(internals_html)) \
|
||||
$(addprefix $(srcdir)/,$(dot_php)) \
|
||||
$(srcdir)/hvsupport.html.in $(srcdir)/aclperms.htmlinc
|
||||
|
||||
timestamp="$(shell if test -n "$$SOURCE_DATE_EPOCH"; \
|
||||
@ -209,8 +204,7 @@ qemu_api: $(srcdir)/libvirt-qemu-api.xml $(srcdir)/libvirt-qemu-refs.xml
|
||||
lxc_api: $(srcdir)/libvirt-lxc-api.xml $(srcdir)/libvirt-lxc-refs.xml
|
||||
admin_api: $(srcdir)/libvirt-admin-api.xml $(srcdir)/libvirt-admin-refs.xml
|
||||
|
||||
web: $(dot_html) $(internals_html) html/index.html devhelp/index.html \
|
||||
$(dot_php)
|
||||
web: $(dot_html) $(internals_html) html/index.html devhelp/index.html
|
||||
|
||||
hvsupport.html: $(srcdir)/hvsupport.html.in
|
||||
|
||||
@ -265,18 +259,6 @@ MAINTAINERCLEANFILES += \
|
||||
$(AM_V_GEN)$(XMLLINT) --nonet --format $< > $(srcdir)/$@ \
|
||||
|| { rm $(srcdir)/$@ && exit 1; }
|
||||
|
||||
%.php.tmp: %.php.in site.xsl page.xsl
|
||||
$(AM_V_GEN)$(XSLTPROC) --stringparam pagename $(@:.tmp=) \
|
||||
--stringparam timestamp $(timestamp) --nonet \
|
||||
$(top_srcdir)/docs/site.xsl $< > $@ \
|
||||
|| { rm $@ && exit 1; }
|
||||
|
||||
%.php: %.php.tmp %.php.code.in
|
||||
$(AM_V_GEN)sed \
|
||||
-e '/<span id="php_placeholder"><\/span>/r '"$(srcdir)/$@.code.in" \
|
||||
-e /php_placeholder/d < $@.tmp > $(srcdir)/$@ \
|
||||
|| { rm $(srcdir)/$@ && exit 1; }
|
||||
|
||||
$(apihtml_generated): html/index.html
|
||||
|
||||
html/index.html: libvirt-api.xml newapi.xsl page.xsl $(APIBUILD_STAMP)
|
||||
|
@ -565,10 +565,6 @@ by a Linux instance. The library aim at providing long term stable C API
|
||||
initially for the <a href="http://www.cl.cam.ac.uk/Research/SRG/netos/xen/index.html">Xen
|
||||
paravirtualization</a> but should be able to integrate other virtualization
|
||||
mechanisms if needed.</p>
|
||||
<p> If you get lost searching for some specific API use, try
|
||||
<a href="https://libvirt.org/search.php">the online search
|
||||
engine</a> hosted on <a href="https://libvirt.org/">libvirt.org</a>
|
||||
it indexes the project page, the APIs as well as the mailing-list archives. </p>
|
||||
</body>
|
||||
</html>
|
||||
</xsl:document>
|
||||
|
@ -1,225 +0,0 @@
|
||||
<?php
|
||||
$query = $_GET['query'];
|
||||
// We handle only the first argument so far
|
||||
$query = ltrim ($query);
|
||||
|
||||
$scope = $_GET['scope'];
|
||||
if ($scope == NULL)
|
||||
$scope = "any";
|
||||
$scope = ltrim ($scope);
|
||||
if ($scope == "")
|
||||
$scope = "any";
|
||||
$querystr = htmlspecialchars($query, ENT_QUOTES, 'UTF-8');
|
||||
?>
|
||||
|
||||
<form action="<?php echo htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8'), "?query=", rawurlencode($query) ?>"
|
||||
enctype="application/x-www-form-urlencoded" method="get">
|
||||
<input name="query" type="text" size="50" value="<?php echo $querystr ?>"/>
|
||||
<select name="scope">
|
||||
<option value="any">Search All</option>
|
||||
<option value="API" <?php if ($scope == 'API') print "selected='selected'"?>>Only the APIs</option>
|
||||
<option value="DOCS" <?php if ($scope == 'DOCS') print "selected='selected'"?>>Only the Documentation</option>
|
||||
<option value="LISTS" <?php if ($scope == 'LISTS') print "selected='selected'"?>>Only the lists archives</option>
|
||||
</select>
|
||||
<input name="submit" type="submit" value="Search ..."/>
|
||||
</form>
|
||||
|
||||
<?php
|
||||
function logQueryWord($word) {
|
||||
$result = mysql_query ("SELECT ID,Count FROM Queries WHERE Value='$word'");
|
||||
if ($result) {
|
||||
$i = mysql_num_rows($result);
|
||||
if ($i == 0) {
|
||||
mysql_free_result($result);
|
||||
mysql_query ("INSERT INTO Queries (Value,Count) VALUES ('$word',1)");
|
||||
} else {
|
||||
$id = mysql_result($result, 0, 0);
|
||||
$count = mysql_result($result, 0, 1);
|
||||
$count ++;
|
||||
mysql_query ("UPDATE Queries SET Count=$count WHERE ID=$id");
|
||||
}
|
||||
} else {
|
||||
mysql_query ("INSERT INTO Queries (Value,Count) VALUES ('$word',1)");
|
||||
}
|
||||
}
|
||||
function queryWord($word) {
|
||||
$result = NULL;
|
||||
$j = 0;
|
||||
if ($word) {
|
||||
$result = mysql_query ("SELECT words.relevance, symbols.name, symbols.type, symbols.module, symbols.descr FROM words, symbols WHERE LCASE(words.name) LIKE LCASE('$word') and words.symbol = symbols.name ORDER BY words.relevance DESC LIMIT 75");
|
||||
if ($result) {
|
||||
$j = mysql_num_rows($result);
|
||||
if ($j == 0)
|
||||
mysql_free_result($result);
|
||||
}
|
||||
logQueryWord($word);
|
||||
}
|
||||
return array($result, $j);
|
||||
}
|
||||
function queryHTMLWord($word) {
|
||||
$result = NULL;
|
||||
$j = 0;
|
||||
if ($word) {
|
||||
$result = mysql_query ("SELECT relevance, name, id, resource, section FROM wordsHTML WHERE LCASE(name) LIKE LCASE('$word') ORDER BY relevance DESC LIMIT 75");
|
||||
if ($result) {
|
||||
$j = mysql_num_rows($result);
|
||||
if ($j == 0)
|
||||
mysql_free_result($result);
|
||||
}
|
||||
logQueryWord($word);
|
||||
}
|
||||
return array($result, $j);
|
||||
}
|
||||
function queryArchiveWord($word) {
|
||||
$result = NULL;
|
||||
$j = 0;
|
||||
if ($word) {
|
||||
$result = mysql_query ("SELECT wordsArchive.relevance, wordsArchive.name, 'libvir-list', archives.resource, archives.title FROM wordsArchive, archives WHERE LCASE(wordsArchive.name) LIKE LCASE('$word') and wordsArchive.ID = archives.ID ORDER BY relevance DESC LIMIT 75");
|
||||
if ($result) {
|
||||
$j = mysql_num_rows($result);
|
||||
if ($j == 0)
|
||||
mysql_free_result($result);
|
||||
}
|
||||
logQueryWord($word);
|
||||
}
|
||||
return array($result, $j);
|
||||
}
|
||||
function resSort ($a, $b) {
|
||||
list($ra,$ta,$ma,$na,$da) = $a;
|
||||
list($rb,$tb,$mb,$nb,$db) = $b;
|
||||
if ($ra == $rb) return 0;
|
||||
return ($ra > $rb) ? -1 : 1;
|
||||
}
|
||||
if (($query) && (strlen($query) <= 50)) {
|
||||
$link = mysql_connect ("localhost", "nobody");
|
||||
if (!$link) {
|
||||
echo "<p> Could not connect to the database: ", mysql_error();
|
||||
} else {
|
||||
mysql_select_db("libvir", $link);
|
||||
$list = explode (" ", $query);
|
||||
$results = array();
|
||||
$number = 0;
|
||||
for ($number = 0;$number < count($list);$number++) {
|
||||
|
||||
$word = $list[$number];
|
||||
if (($scope == 'any') || ($scope == 'API')) {
|
||||
list($result, $j) = queryWord($word);
|
||||
if ($j > 0) {
|
||||
for ($i = 0; $i < $j; $i++) {
|
||||
$relevance = mysql_result($result, $i, 0);
|
||||
$name = mysql_result($result, $i, 1);
|
||||
$type = mysql_result($result, $i, 2);
|
||||
$module = mysql_result($result, $i, 3);
|
||||
$desc = mysql_result($result, $i, 4);
|
||||
if (array_key_exists($name, $results)) {
|
||||
list($r,$t,$m,$d,$w,$u) = $results[$name];
|
||||
$results[$name] = array(($r + $relevance) * 2,
|
||||
$t,$m,$d,$w,$u);
|
||||
} else {
|
||||
$id = $name;
|
||||
$m = strtolower($module);
|
||||
$url = "html/libvirt-$module.html#$id";
|
||||
$results[$name] = array($relevance,$type,
|
||||
$module, $desc, $name, $url);
|
||||
}
|
||||
}
|
||||
mysql_free_result($result);
|
||||
}
|
||||
}
|
||||
if (($scope == 'any') || ($scope == 'DOCS')) {
|
||||
list($result, $k) = queryHTMLWord($word);
|
||||
if ($k > 0) {
|
||||
for ($i = 0; $i < $k; $i++) {
|
||||
$relevance = mysql_result($result, $i, 0);
|
||||
$name = mysql_result($result, $i, 1);
|
||||
$id = mysql_result($result, $i, 2);
|
||||
$module = mysql_result($result, $i, 3);
|
||||
$desc = mysql_result($result, $i, 4);
|
||||
$url = $module;
|
||||
if ($id != "") {
|
||||
$url = $url + "#$id";
|
||||
}
|
||||
$results["$name _html_ $number _ $i"] =
|
||||
array($relevance, "XML docs",
|
||||
$module, $desc, $name, $url);
|
||||
}
|
||||
mysql_free_result($result);
|
||||
}
|
||||
}
|
||||
if (($scope == 'any') || ($scope == 'LISTS')) {
|
||||
list($result, $j) = queryArchiveWord($word);
|
||||
if ($j > 0) {
|
||||
for ($i = 0; $i < $j; $i++) {
|
||||
$relevance = mysql_result($result, $i, 0);
|
||||
$name = mysql_result($result, $i, 1);
|
||||
$type = mysql_result($result, $i, 2);
|
||||
$url = mysql_result($result, $i, 3);
|
||||
$desc = mysql_result($result, $i, 4);
|
||||
if (array_key_exists($url, $results)) {
|
||||
list($r,$t,$m,$d,$w,$u) = $results[$url];
|
||||
$results[$name] = array(($r + $relevance) * 2,
|
||||
$t,$m,$d,$w,$u);
|
||||
} else {
|
||||
$id = $name;
|
||||
$m = strtolower($module);
|
||||
$u = str_replace(
|
||||
"http://www.redhat.com/archives/libvir-list/", "", $url);
|
||||
$results[$url] = array($relevance,$type,
|
||||
$u, $desc, $name, $url);
|
||||
}
|
||||
}
|
||||
mysql_free_result($result);
|
||||
}
|
||||
}
|
||||
}
|
||||
if ((count($results) == 0) && (count($list) == 1)) {
|
||||
$word = $list[0];
|
||||
if (($scope == 'any') || ($scope == 'XMLAPI')) {
|
||||
list($result, $j) = queryWord("vir$word");
|
||||
if ($j > 0) {
|
||||
for ($i = 0; $i < $j; $i++) {
|
||||
$relevance = mysql_result($result, $i, 0);
|
||||
$name = mysql_result($result, $i, 1);
|
||||
$type = mysql_result($result, $i, 2);
|
||||
$module = mysql_result($result, $i, 3);
|
||||
$desc = mysql_result($result, $i, 4);
|
||||
if (array_key_exists($name, $results)) {
|
||||
list($r,$t,$m,$d,$w,$u) = $results[$name];
|
||||
$results[$name] = array(($r + $relevance) * 2,
|
||||
$t,$m,$d,$w,$u);
|
||||
} else {
|
||||
$id = $name;
|
||||
$m = strtolower($module);
|
||||
$url = "html/libvirt-$module.html#$id";
|
||||
$results[$name] = array($relevance,$type,
|
||||
$module, $desc, $name, $url);
|
||||
}
|
||||
}
|
||||
mysql_free_result($result);
|
||||
}
|
||||
}
|
||||
}
|
||||
mysql_close($link);
|
||||
$nb = count($results);
|
||||
echo "<h3 align='center'>Found $nb results for query $querystr</h3>\n";
|
||||
usort($results, "resSort");
|
||||
|
||||
if ($nb > 0) {
|
||||
printf("<table><tbody>\n");
|
||||
printf("<tr><td>Quality</td><td>Symbol</td><td>Type</td><td>module</td><td>Description</td></tr>\n");
|
||||
$i = 0;
|
||||
while (list ($name, $val) = each ($results)) {
|
||||
list($r,$t,$m,$d,$s,$u) = $val;
|
||||
$m = str_replace("<", "<", $m);
|
||||
$s = str_replace("<", "<", $s);
|
||||
$d = str_replace("<", "<", $d);
|
||||
echo "<tr><td>$r</td><td><a href='$u'>$s</a></td><td>$t</td><td>$m</td><td>$d</td></tr>";
|
||||
$i = $i + 1;
|
||||
if ($i > 75)
|
||||
break;
|
||||
}
|
||||
printf("</tbody></table>\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
@ -1,16 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<body>
|
||||
<h1>Search the documentation on Libvirt.org</h1>
|
||||
|
||||
<p>
|
||||
The search service indexes the libvirt APIs and documentation as
|
||||
well as the libvir-list@redhat.com mailing-list archives. To use
|
||||
it simply provide a set of keywords:
|
||||
</p>
|
||||
|
||||
<span id="php_placeholder"/>
|
||||
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user