User:Leucosticte/Doing the Newgon stuff

<?php
$cmd = array (
        '/usr/local/php53/bin/php importDump.php < ~/childwiki.net/boywiki/BoyWiki-20131111070838.xml',
        '/usr/local/php53/bin/php importDump.php < ~/childwiki.net/boywiki/BoyWiki-20131111070901.xml',
        '/usr/local/php53/bin/php importDump.php < ~/childwiki.net/boywiki/BoyWiki-20131111070920.xml',
        '/usr/local/php53/bin/php importDump.php < ~/childwiki.net/boywiki/BoyWiki-20131111071115.xml',
        '/usr/local/php53/bin/php importDump.php < ~/childwiki.net/boywiki/BoyWiki-20131111071144.xml',
        '/usr/local/php53/bin/php importDump.php < ~/childwiki.net/boywiki/BoyWiki-20131111071159.xml',
        '/usr/local/php53/bin/php importDump.php < ~/childwiki.net/boywiki/BoyWiki-20131111071219.xml',
        '/usr/local/php53/bin/php importDump.php < ~/childwiki.net/boywiki/BoyWiki-20131111071234.xml',
        '/usr/local/php53/bin/php importDump.php < ~/childwiki.net/boywiki/BoyWiki-20131111071249.xml',
        '/usr/local/php53/bin/php importDump.php < ~/childwiki.net/boywiki/BoyWiki-20131111071303.xml',
        '/usr/local/php53/bin/php importDump.php < ~/childwiki.net/boywiki/BoyWiki-20131111071321.xml',
        '/usr/local/php53/bin/php importDump.php < ~/childwiki.net/boywiki/BoyWiki-20131111071338.xml',
        '/usr/local/php53/bin/php importDump.php < ~/childwiki.net/boywiki/BoyWiki-20131111071353.xml',
        '/usr/local/php53/bin/php importDump.php < ~/childwiki.net/boywiki/BoyWiki-20131111071407.xml',
        '/usr/local/php53/bin/php importDump.php < ~/childwiki.net/boywiki/BoyWiki-20131111071422.xml',
        '/usr/local/php53/bin/php importDump.php < ~/childwiki.net/boywiki/BoyWiki-20131111071436.xml'
);
foreach ( $cmd as $thisCmd ) {
        echo "$thisCmd\n";
        shell_exec ( $thisCmd );
}
  • Or better yet:
<?php
$files = array (
    'NewgonWiki-20131111072018.xml',
    'NewgonWiki-20131111072043.xml',
    'NewgonWiki-20131111072059.xml',
    'NewgonWiki-20131111072116.xml',
    'NewgonWiki-20131111072149.xml',
    'NewgonWiki-20131111072204.xml',
    'NewgonWiki-20131111072239.xml',
    'NewgonWiki-20131111072258.xml',
    'NewgonWiki-20131111072403.xml',
    'NewgonWiki-20131111072429.xml',
    'NewgonWiki-20131111072445.xml',
    'NewgonWiki-20131111072501.xml',
    'NewgonWiki-20131111072516.xml',
    'NewgonWiki-20131111072534.xml',
    'NewgonWiki-20131111072645.xml',
    'NewgonWiki-20131111072659.xml'
);
foreach ( $files as $file ) {
        $cmd = '/usr/local/php53/bin/php importDump.php < ~/childwiki.net/newgon/' . $file;
        echo "$cmd\n";
        shell_exec ( $cmd );
}
  • [stauffenbergssh@ipe:~/childwiki.net/w/maintenance ] $ php childLoop.php
  • Get a cup of coffee
  • Repeat for newgon
  • Find out the file extensions of the images. If you want to have fun, use getAllFileExtensions.php:
<?php
// Usage: php getAllFileExtensions.php path/to/files    
$number = 0;
$path = '.';
if ( isset ( $argv[1] ) ) {
        $path = $argv[1];
}
$extensions = array();
if ( $handle = opendir ( $path ) ) {
    while (false !== ( $entry = readdir ( $handle ) ) ) {
        if ( $entry != "." && $entry != ".." ) {
             $extensions[] = pathinfo ( $entry, PATHINFO_EXTENSION );
             $number++;
        }
    }
    closedir ( $handle );
}
echo "$number images\n";
$isFirst = true;
$extensions = array_unique ( $extensions );
foreach ( $extensions as $ext ) {
        if ( !$isFirst ) {
                echo ', ';
        }
        echo $ext;
        $isFirst = false;
}
  • However, I'll you right now that the extensions are png, jpg, mp3, mp4, gif, JPG, PNG, pdf, jpeg, txt.
  • importImages.php --extensions=png,jpg,mp3,mp4,gif,JPG,PNG,pdf,jpeg,txt ~/down/down (maybe you don't even need the extensions, as long as you get the right directory. On second thought, better use those extensions; who knows if you have them as allowable ones)
  • (Do Manual:importImages.php after importing the file description pages)