Merge remote branch 'origin/master' into account
[platal.git] / bin / search.rebuild_db.php
index 1b9917f..cd7e56c 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/php5 -q
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2009 Polytechnique.org                              *
+ *  Copyright (C) 2003-2010 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
  ***************************************************************************/
 
 require('./connect.db.inc.php');
-require('user.func.inc.php');
 
 ini_set('memory_limit', "16M");
 $globals->debug = 0; // Do not store backtraces
 
-$res = XDB::iterRow("SELECT  user_id
-                       FROM  auth_user_md5");
+$res = XDB::iterRow('SELECT  pid
+                       FROM  profiles');
 $i = 0;
 $n = $res->total();
-while ($uid = $res->next()->fetchOneCell()) {
-    user_reindex($uid);
+while ($pid = $res->next()->fetchOneCell()) {
+    Profile::rebuildSearchTokens($pid);
     printf("\r%u / %u",  ++$i, $n);
 }