Just to make the following intelligible without going through everything, I'm trying to "batch upload" images into a local MediaWiki site, using rebuildImages.php. Here is Rob's reply to my most recent question:
Either use the script I mentioned in a former post (which can be stolen from SVN trunk) or set $wgHashedUploadDirectory to false and try again.
Rob Church _______________________________________________
And, unfortunately, here is what I did in "rebuildImages.php":
function crawlMissing() { global $wgUploadDirectory, $wgHashedUploadDirectory; $wgHashedUploadDirectory = FALSE; if( $wgHashedUploadDirectory ) {
and the following command line execution and result:
kenneth-mcdonalds-computer:~/Sites/mediawiki-1.6.5/maintenance Ken$ php rebuildImages.php --missing wikidb 2006-05-17 20:06:18: crawling /Users/Ken/Sites/mediawiki-1.6.5/images wikidb 2006-05-17 20:06:19: Surprising mime type: unknown/unknown wikidb 2006-05-17 20:06:19: /Users/Ken/Sites/mediawiki-1.6.5/images/README kenneth-mcdonalds-computer:~/Sites/mediawiki-1.6.5/maintenance Ken$
I get the feeling that if only I could tell rebuildImages where I _really_ want it to get the new images from, I could get this to work. But I don't have the PHP or MW knowledge to try that with even the smallest likelihood of success. Can I simply set $wgUploadDirectory to something appropriate, and if so, is the path absolute in the computer, relative to the main MW directory, or specified somehow else :-)
Rob mentioned another possible script I could check out from SVN, and I'll try that if I have to. But I feel this is _so_ close, surely I must be able to get it to work...and I'm not really a development geek, so I'd prefer to avoid messing around with Subversion.
Thanks again, Ken
On 17/05/06, Ken McDonald ken@pixologic.com wrote:
With many thanks to responses to previous questions, I think I _almost_ at the point of being able to bulk upload images. Here's the situation:
- My images are in a file "uploads" in the "main" wiki directory, i.e.
the one containing the "maintenance" directory. They all have a .jpg suffix
- I have added and configured an "AdminSettings.php" file in the main
directory. I can now run the rebuildImages script, which I could not do before.
I get two different types of results when I try to execute the rebuildImages script while in the maintenance directory:
If I run "php rebuildImages.php", I get the result;
wikidb 2006-05-17 18:43:07: Processing image... wikidb 2006-05-17 18:43:07: Finished image... 0 of 2 rows updated wikidb 2006-05-17 18:43:07: Processing oldimage... wikidb 2006-05-17 18:43:07: Finished oldimage... 0 of 0 rows updated
I have two images already in the wiki, I assume that is what is being reflected in this output.
If I run "php rebuildImages.php --missing", The result is much longer, starting with:
wikidb 2006-05-17 18:45:00: no directory, skipping /Users/Ken/Sites/mediawiki-1.6.5/images/0/00 wikidb 2006-05-17 18:45:00: no directory, skipping /Users/Ken/Sites/mediawiki-1.6.5/images/0/01 wikidb 2006-05-17 18:45:00: no directory, skipping /Users/Ken/Sites/mediawiki-1.6.5/images/0/02 wikidb 2006-05-17 18:45:00: no directory, skipping /Users/Ken/Sites/mediawiki-1.6.5/images/0/03 wikidb 2006-05-17 18:45:00: no directory, skipping /Users/Ken/Sites/mediawiki-1.6.5/images/0/04 wikidb 2006-05-17 18:45:00: no directory, skipping /Users/Ken/Sites/mediawiki-1.6.5/images/0/05 wikidb 2006-05-17 18:45:00: no directory, skipping /Users/Ken/Sites/mediawiki-1.6.5/images/0/06 wikidb 2006-05-17 18:45:00: no directory, skipping /Users/Ken/Sites/mediawiki-1.6.5/images/0/07 wikidb 2006-05-17 18:45:00: no directory, skipping /Users/Ken/Sites/mediawiki-1.6.5/images/0/08 wikidb 2006-05-17 18:45:00: no directory, skipping /Users/Ken/Sites/mediawiki-1.6.5/images/0/09 wikidb 2006-05-17 18:45:00: no directory, skipping /Users/Ken/Sites/mediawiki-1.6.5/images/0/0a wikidb 2006-05-17 18:45:00: no directory, skipping /Users/Ken/Sites/mediawiki-1.6.5/images/0/0b wikidb 2006-05-17 18:45:00: no directory, skipping /Users/Ken/Sites/mediawiki-1.6.5/images/0/0c wikidb 2006-05-17 18:45:00: no directory, skipping /Users/Ken/Sites/mediawiki-1.6.5/images/0/0d wikidb 2006-05-17 18:45:00: no directory, skipping /Users/Ken/Sites/mediawiki-1.6.5/images/0/0e wikidb 2006-05-17 18:45:00: no directory, skipping /Users/Ken/Sites/mediawiki-1.6.5/images/0/0f
and so on...
I'm assuming this causes rebuildImages to look through the "images" dir, looking for files it doesn't know about, and then add them to the database.
Does this mean I need to add my files to that directory before running the script? If so, where? The directory apparently has a very specific structure, and I don't want to put images in incorrect places. Or can I get "rebuildImages" to look at another directory (eg. /wikimain/uploads), move them into the appropriate place in "images", and register the with the database?
Once again, so many thanks for helping with this. We have (at least) several hundred images that need to be put into the site, and don't really like the thought of doing it by hand :-).
Either use the script I mentioned in a former post (which can be stolen from SVN trunk) or set $wgHashedUploadDirectory to false and try again.
Rob Church _______________________________________________ MediaWiki-l mailing list MediaWiki-l@Wikimedia.org http://mail.wikipedia.org/mailman/listinfo/mediawiki-l