svn: /web/php/trunk/ search-index.php
| From: | Stewart Lord | Date: | Sat, 01 Jan 2011 20:49:54 +0000 |
| Subject: | svn: /web/php/trunk/ search-index.php | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-10157@lists.php.net to get a copy of this message | ||
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 "[]";
+}
+