svn: /web/php/trunk/ search-index.php
[email protected] (Stewart Lord)
| Newsgroups | php.webmaster |
|---|---|
| Message-ID | <[email protected]> |
stewartlord Sat, 01 Jan 2011 20:49:54 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=306960
Log:
Search index is now served as an empty array "[]" if generated json search
index files can't be found.
Changed paths:
U web/php/trunk/search-index.php
Modified: web/php/trunk/search-index.php
===================================================================
--- web/php/trunk/search-index.php 2011-01-01 20:46:12 UTC (rev 306959)
+++ web/php/trunk/search-index.php 2011-01-01 20:49:54 UTC (rev 306960)
@@ -18,5 +18,11 @@
ob_start("ob_gzhandler");
echo "$varname = ";
-readfile(dirname(__FILE__) . "/manual/$langcode/$filename.json");
+$file = dirname(__FILE__) . "/manual/$langcode/$filename.json";
+if (is_readable($file)) {
+ readfile($file);
+} else {
+ echo "[]";
+}
+