Пример #1
0
function XML2TXT_END($parser, $name)
{
    global $mem, $namespaces, $tags, $page_counter, $dir;
    if ($mem['name'] == 'NAMESPACE') {
        $namespaces[$mem['key']] = $mem['text'];
    } else {
        if ($mem['name'] == 'PAGE') {
            $loc = get_file_location_global($dir, $mem['namespace'], $mem['title'], true);
            store_file($loc, $mem['text'], 'text');
            $page_counter++;
            if ($page_counter % 1000 == 0) {
                print '.';
                if ($page_counter % 50000 == 0) {
                    print "<br/>";
                }
                flush();
            }
        }
    }
    array_pop($tags);
    if (count($tags) > 0) {
        $mem['name'] = array_pop($tags);
        $tags[] = $mem['name'];
    } else {
        $mem['name'] = "";
    }
}
Пример #2
0
 function get_file_location($ns, $title)
 {
     return get_file_location_global($this->basedir, $ns, $title, false);
 }