Hi David,
I was wondering if it was possible to make a progress indicator to show how far through an import is?
It would not necessarily have to show in realation to total number and could just be a counter on imported rows. Obviously a percentage through would be nice but i'm guessing a lot more complicated.
Thanks David,
A very simple implementation! I will try it out tonight,
Julian
Hi David,
I've been testing the new distribution software on my test site and I thought it would be a good idea to include the above script. Unfortunately when I click on 'Import All' all that happens is, a couple of minutes of waiting then I get the following message;
X-Powered-By: PHP/5.2.8
Content-Type: text/plain
This repeats on the page about a zillion times, then followed by this message;
Warning: passthru() [function.passthru]: Unable to fork [php ../scripts/import.php @ALL] in /home/namedcom/public_html/newtest/admin/importAll.php on line 4
What am I doing wrong? Any ideas please.
Regards
Hayden
Hi Hayden,
I'm not sure why you would be seeing it multiple times as it should only try (and fail) once; however it is possible that the PHP binary cannot be found. Could you try it as follows:
<?php
header("Content-Type: text/plain");
passthru("/usr/bin/php ../scripts/import.php @ALL");
?>
(i've removed the implicit flush line in-case that was something to do with the repeating)...
Cheers,
David.
Hi,
I tried that, I got the same repeated message as above but the end message was;
Warning: passthru() [function.passthru]: Unable to fork [/usr/bin/php ../scripts/import.php @ALL] in /home/namedcom/public_html/newtest/admin/importAll.php on line 3
Regards
Hayden
Hi Hayden,
Thanks - that would indicate that the command line version of PHP is not available. Bear with me; and I'll create an import all script including progress indicator as a regular script...
Cheers,
David.
Thanks David,
Sorry to be a pain!!!!
Regards
Hayden
Hi,
I've combined your posts regarding this and an Import All link from within the administration area. One method is to create a PHP script to "pass thru" the automation script with the @ALL parameter. To do this; create the following PHP file in your /admin/ folder:
importAll.php
<?php
ob_implicit_flush(TRUE);
header("Content-Type: text/plain");
passthru("php ../scripts/import.php @ALL");
?>
If you would then like to add a link to the administration menu, look for the following code on line 20 of admin/admin_menu.php:
print "<a href='moderate.php'>Moderate Reviews</a> ";
...and REPLACE that with:
print "<a href='moderate.php'>Moderate Reviews</a> ";
print "<a href='importAll.php'>Import All</a> ";
The output that will be generated will be identical to that seen when using import.php from the command line - so it will show a product progress through each feed Vs the total number of products in that feed (if known).
Hope this helps!
Cheers,
David.