32 lines
673 B
PHP
32 lines
673 B
PHP
<?php
|
|
|
|
use RenanBr\BibTexParser\Listener;
|
|
use RenanBr\BibTexParser\Parser;
|
|
use RenanBr\BibTexParser\Processor;
|
|
|
|
require dirname(__FILE__).'/common.php';
|
|
|
|
$m = setup_mustache();
|
|
|
|
|
|
// Create and configure a Listener
|
|
$listener = new Listener();
|
|
$listener->addProcessor(new Processor\TagNameCaseProcessor(CASE_LOWER));
|
|
|
|
// Create a Parser and attach the listener
|
|
$parser = new Parser();
|
|
$parser->addListener($listener);
|
|
|
|
// Parse the content, then read processed data from the Listener
|
|
try {
|
|
$parser->parseFile('assets/bib/export-bibtex.bib');
|
|
$entries = $listener->export();
|
|
|
|
print_r($entries);
|
|
} catch (Exception $e) {
|
|
print_r($e);
|
|
print_r($e->getMessage());
|
|
}
|
|
|
|
|