本文整理汇总了PHP中Options::isOptionSet方法的典型用法代码示例。如果您正苦于以下问题:PHP Options::isOptionSet方法的具体用法?PHP Options::isOptionSet怎么用?PHP Options::isOptionSet使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Options
的用法示例。
在下文中一共展示了Options::isOptionSet方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
function __construct($pageID, $language)
{
$this->uri = RDFTriple::page($pageID);
$this->language = $language;
if (Options::isOptionSet('predicateFilter')) {
$p = Options::getOption('predicateFilter');
foreach ($p as $one) {
//echo $one."\n";
$this->predicateFilterList[] = trim($one);
}
}
if (Options::isOptionSet('objectFilter')) {
$o = Options::getOption('objectFilter');
foreach ($o as $one) {
//echo $one."\n";
$this->objectFilterList[] = trim($one);
}
}
if (Options::isOptionSet('predicateObjectFilter')) {
$po = Options::getOption('predicateObjectFilter');
foreach ($po as $one) {
//echo $one."\n";
$pos = strpos($one, " ");
$currentp = trim(substr($one, 0, $pos));
$currento = trim(substr($one, $pos + 1));
//echo $currentp."\n";
//echo $currento."\n";
$this->predicateFilterList[] = $one;
}
}
}
示例2: __construct
function __construct($metainfo)
{
$this->uri = RDFtriple::page($metainfo['pageTitle']);
$this->language = $metainfo['language'];
$this->oaiId = $metainfo['oaiId'];
$this->graphURI = Options::getOption('graphURI');
$this->annotationGraphURI = Options::getOption('annotationGraphURI');
$this->generateOWLAxiomAnnotations = Options::getOption('generateOWLAxiomAnnotations');
$this->languageProperties = Options::getOption('stringPredicateWithForeignlanguages');
$this->debug_turn_off_insert = Options::getOption('debug_turn_off_insert');
$this->debug_run_tests = Options::getOption('debug_run_tests');
$this->hash = new Hash($this->oaiId, $this->uri->getURI());
//$this->metainfo = $metainfo;
$this->subjectSPARULpattern = $this->uri->toSPARULPattern();
if (Options::isOptionSet('predicateFilter')) {
$p = Options::getOption('predicateFilter');
$this->log(WARN, 'currently not working');
}
if (Options::isOptionSet('objectFilter')) {
$o = Options::getOption('objectFilter');
$this->log(WARN, 'currently not working');
}
if (Options::isOptionSet('predicateObjectFilter')) {
$po = Options::getOption('predicateObjectFilter');
$this->log(WARN, 'currently not working');
}
}
示例3: printAll
function printAll($lastarticles, $language)
{
$statisticdir = Options::getOption('statisticdir');
Timer::start('main::glob');
if (Options::getOption('noglob')) {
Statistics::setArticleQueue('deactivated for speed');
} else {
Statistics::setArticleQueue(count(glob(Options::getOption('oaiRecords') . "/*.*")));
}
Timer::stop('main::glob');
/*
* //too slow
Timer::start('main::lswc');
Statistics::setArticleQueue(exec ('ls -1 '.Options::getOption('oaiRecords').' | wc -l'));
Timer::stop('main::lswc');
*/
$data = array();
$data['lastarticles'] = $lastarticles;
Timer::stop("main::Runtime");
$timeString = Timer::getTimeAsString();
$data['timeString'] = $timeString;
$data['time'] = Timer::$time;
Timer::start("main::Runtime");
$overall = array();
$overall['startingtime'] = Timer::$startingTime;
$overall['lasttime'] = microtime(true);
$data['timeOverall'] = $overall;
Timer::stop("main::processing");
$data['processingTime'] = Timer::$time["main::processing"]['total'];
Timer::start("main::processing");
//toFile($time, 'timeString.txt', $statisticdir);
//do statistics
//Timer::timeToFile($statisticdir);
// Statistics::statisticsToFile($statisticdir);
$data['triples'] = Statistics::$countArr;
$data['extractorMeta'] = Statistics::$extractorMeta;
$s = Timer::getElapsedSeconds();
$t = Statistics::getTotalTriples();
$memory = "memory_get_usage (true ): " . memory_get_usage(true) . "\n";
$memory .= "memory_get_usage (false ): " . memory_get_usage(false) . "\n";
$memory .= "memory_get_peak_usage (true ): " . memory_get_peak_usage(true) . "\n";
$memory .= "memory_get_peak_usage (false ): " . memory_get_peak_usage(false) . "\n";
$data['memory'] = $memory;
//toFile($memory, 'memory.txt', $statisticdir);
//echo $s."\n";
$general = "Seconds per article: " . $s / Statistics::getTotalArticles() . "\n";
$general .= "Articles per second: " . Statistics::getTotalArticles() / $s . "\n";
$general .= "Articles per hour: " . Statistics::getTotalArticles() / $s * 3600 . "\n";
$general .= "Category per second: " . Statistics::getTotalCategories() / $s . "\n";
$general .= "Category per hour: " . Statistics::getTotalCategories() / $s * 3600 . "\n";
$general .= "Redirect per second: " . Statistics::getTotalRedirects() / $s . "\n";
$general .= "Redirect per hour: " . Statistics::getTotalRedirects() / $s * 3600 . "\n";
$general .= "Triples per second: " . $t / $s . "\n";
$general .= "Triples per minute: " . $t / $s * 60 . "\n";
$general .= "Triples per hour: " . $t / $s * 3600 . "\n";
$general .= "Triples per day: " . $t / $s * 3600 * 24 . "\n";
$data['general'] = $general;
$append = '';
if (Options::isOptionSet('processID')) {
$append = Options::$config['processID'];
}
$indexfile = 'index' . $append . '.html';
toFile(Statistics::generateStatisticHTML(Options::getOption('linkeddataresourceprefix'), $language, $data), $indexfile, $statisticdir);
Logger::info('wrote html file to ' . $statisticdir . '/' . $indexfile);
}