Пример #1
0
\t<body style="border-top:15px solid #FC3">
\t<div align="center">
eod;
$step = ps('step');
switch ($step) {
    case "":
        chooseLang();
        break;
    case "getDbInfo":
        getDbInfo();
        break;
    case "getTxpLogin":
        getTxpLogin();
        break;
    case "printConfig":
        printConfig();
        break;
    case "createTxp":
        createTxp();
}
?>
</div>
</body>
</html>
<?php 
// -------------------------------------------------------------
function chooseLang()
{
    echo '<form action="' . $GLOBALS['rel_siteurl'] . '/textpattern/setup/index.php" method="post">', '<table id="setup" cellpadding="0" cellspacing="0" border="0">', tr(tda(hed('Welcome to Textpattern', 3) . graf('Please choose a language:') . langs() . graf(fInput('submit', 'Submit', 'Submit', 'publish')) . sInput('getDbInfo'), ' width="400" height="50" colspan="4" align="left"')), '</table></form>';
}
// -------------------------------------------------------------
Пример #2
0
$pageName = $argv[1];
$outFileName = $argv[2];
echo "Command line version of the live extraction workflow.\n";
echo "Processing page: {$pageName}\n";
echo "Output file: {$outFileName}\n";
ini_set("memory_limit", "512M");
include 'dbpedia.php';
//$currentArticleFile = Options::getFileOptionWithID('currentArticleFile');
$extractors = array();
$extractors[ARTICLE] = Options::getArticleConfiguration();
$extractors[CATEGORY] = Options::getCategoryConfiguration();
$extractors[REDIRECT] = Options::getRedirectConfiguration();
$validstates = array(ACTIVE, KEEP, PURGE);
// message at beginning
if (Options::getOption('showconfig')) {
    printConfig($extractors);
}
$language = Options::getOption('language');
if (!isset($language)) {
    $language = "en";
    Logger::warn("Language not set. Defaulting to '{$language}'.");
}
echo "Langauge = '{$language}'\n";
/*if(Options::isOptionSet('language')){
    Logger::warn('option "language" has no effect for live extraction');
}*/
$pageTitles = new ArrayObject(array($pageName));
$manager = new ExtractionManager();
$collection = new LiveWikipediaCollection($language);
$job = new ExtractionJob($collection, $pageTitles);
$destination = new NTripleDumpDestination($outFileName);