problem rebuild-permissions
I have problems rebuilding my node_access table (too much nodes...). Increasing my php execution time/memory limit is not an option so I thougth of creating a script which updates one node at a time, and using javascript loads to save the next node (I know making a module with ajax would be more elegant, but not enough time...) It basically recive a nid, load the node, node_access_acquire_grants(), and refresh with the next node. Should it work or it has some problem? thanks <?php if ($_SERVER['REMOTE_ADDR']!='XXX.XXX.XXX.XXX') exit(); //ensure just me can run this script require_once './includes/bootstrap.inc'; drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); user_authenticate('admin', 'admin'); $actual=db_result(db_query("SELECT nid FROM {node} WHERE nid > %d ORDER BY nid",$_GET['node'])); if ($actual>0) { $sencer=node_load($actual); node_access_acquire_grants($sencer); } ?><html> <head> <script type="text/javascript"> <!-- function delayer(){ window.location = "rebuild_permissions.php?node=<?=$actual?>" } //--> </script> </head> <body <?=($actual>0 ? " onLoad=\"setTimeout('delayer()', 1000)\"" : "") ?>> <?php if ($actual>0) echo "doing...".$actual; else echo "Done"; ?> </body> </html> -- *La felicitat ha de ser compatible, compartible i cooperativa. *Envellim quan els records superen les esperances. *Als llocs desconeguts només s'hi arriba per camins desconeguts. *Abans d'imprimir aquest missatge, pensa en el medi ambient.
On Fri, Jun 13, 2008 at 5:23 AM, Lluís <enboig@gmail.com> wrote:
I have problems rebuilding my node_access table (too much nodes...). Increasing my php execution time/memory limit is not an option ...
Yeah this was a problem in D5. In D6 there's the batch api that handles this. You might mine this issue for hints: http://drupal.org/node/144337 andrew
participants (2)
-
andrew morton -
Lluís