[translations] determining correct import

Gabor Hojtsy gabor at hojtsy.hu
Mon Feb 5 10:18:59 UTC 2007


On Sun, 4 Feb 2007, Jakub Suchy wrote:
>> 100% was imported). We need some fallback or determine a way how to
>> speed up the process (cron?)
>
> I was thinking about options and so far i have found two, both BAD.
> Ideas please?
>
> In both cases, we determine files needed to be imported and we store
> their names into database/session/whatever.
>
> [...]
>
> This will redirect and loop import.php until all files are processed.
> This is BAD solution, but can't think of better one now. Anyone?

This is indeed a very real problem. See the update.php solution. It does 
what you describe. First it collects the updates need to be run, then it 
pushes that into the session. Then runs update to update, going through 
the array in the session. It also displays a nice progress bar, so that 
you see where you are, and that something is happening.

So a solution for such things is already in Drupal. The interesting 
question is whether we can utilize it somehow, or just need to copy code. 
This is a problem in install time and later when you go into automatic 
update. Both places would be better with a step-by-step import process, 
where memory and runtime is not that big a consern. The update process 
already solves this a great deal, so no need to reinvent the weel. We just 
need to reuse of steal code :)

Gabor


More information about the translations mailing list