本文整理汇总了PHP中Indexer::index_one_file方法的典型用法代码示例。如果您正苦于以下问题:PHP Indexer::index_one_file方法的具体用法?PHP Indexer::index_one_file怎么用?PHP Indexer::index_one_file使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Indexer
的用法示例。
在下文中一共展示了Indexer::index_one_file方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: usage
if (is_dir($directory)) {
$indexer->set_data_root($directory);
} else {
die("ERROR: {$directory} is not a directory.\n");
}
}
$dir_mes = "in data directory " . $indexer->get_data_root();
if ($csv_filename == null) {
$mes = "Indexation of all linguistic data files";
} else {
$mes = "Indexation of the linguistic data file {$csv_filename}";
$indexer->force_indexation();
}
$logger->info("{$mes} {$dir_mes}\n");
if ($csv_filename != null) {
$indexer->index_one_file($csv_filename);
$logger->info("Nb. of morphemes indexed in this pass: " . $indexer->get_nb_indexed_entries());
} else {
$indexer->index_all_files();
$logger->info("Total nb. of data files: " . count($indexer->list_data_files_in_data_directory()));
$logger->info("Nb. files indexed in this pass: " . $indexer->get_nb_indexed_files());
$logger->info("Total nb. of entries: " . count(file($indexer->get_main_index_pathname())));
$logger->info("Nb. entries indexed in this pass: " . $indexer->get_nb_indexed_entries());
}
function usage($message = null)
{
if ($message != null) {
echo "\n*** {$message} ***\n";
}
echo "\nUsage: php makeindex.php [-options] [<csv filename>]";
echo "\n\nwhere options include:";