check if index exists before removing it

This commit is contained in:
Uwe Steinmann 2016-01-10 14:25:31 +01:00
parent 07f5512c9a
commit 62cd6e0602

View File

@ -55,7 +55,8 @@ class SeedDMS_SQLiteFTS_Indexer {
* @param string $indexerDir directory on disk containing the index
*/
static function create($indexerDir) { /* {{{ */
unlink($indexerDir.'/index.db');
if(file_exists($indexerDir.'/index.db'))
unlink($indexerDir.'/index.db');
$index = new SeedDMS_SQLiteFTS_Indexer($indexerDir);
/* Make sure the sequence of fields is identical to the field list
* in SeedDMS_SQLiteFTS_Term