Page MenuHomePhabricator
Paste P2887

(An Untitled Masterwork)
ActivePublic

Authored by Tgr on Apr 12 2016, 6:44 PM.
> $title = Title::newFromText( 'Monmouth_(Oregon)' );
> $page = WikiPage::factory( $title );
> $parserOptions = ParserOptions::newFromUser( User::newFromName( 'Tgr_(WMF)' ) );
> echo ParserCache::singleton()->getKey( $page, $parserOptions );
enwikivoyage:pcache:idhash:136680-0!*!0!!en!4!*
> $parserOutput = ParserCache::singleton()->get( $page, $parserOptions );
> var_dump( $parserOutput->mProperties );
array(4) {
["wpb_banner"]=>
string(22) "Pagebanner default.jpg"
["wpb_banner_focus_x"]=>
int(0)
["wpb_banner_focus_y"]=>
int(0)
["wikibase_item"]=>
string(8) "Q1650626"
}
> var_dump( $parserOutput->getExtensionData( 'wpb-banner-options' ) );
array(7) {
["tooltip"]=>
string(17) "Monmouth (Oregon)"
["title"]=>
string(17) "Monmouth (Oregon)"
["extraClass"]=>
string(0) ""
["enable-toc"]=>
bool(true)
["data-pos-x"]=>
int(0)
["data-pos-y"]=>
int(0)
["name"]=>
string(22) "Pagebanner default.jpg"
}
> var_dump( $parserOutput->getTOCEnabled() );
bool(false)
> var_dump( $parserOutput->getTOCHTML() );
string(2273) "<div id="toc" class="toc"><div id="toctitle"><h2>Contents</h2></div>
<ul>
<li class="toclevel-1 tocsection-1"><a href="#Understand"><span class="tocnumber">1</span> <span class="toctext">Understand</span></a></li>
<li class="toclevel-1 tocsection-2"><a href="#Get_in"><span class="tocnumber">2</span> <span class="toctext">Get in</span></a>
<ul>
<li class="toclevel-2 tocsection-3"><a href="#By_car"><span class="tocnumber">2.1</span> <span class="toctext">By car</span></a></li>
<li class="toclevel-2 tocsection-4"><a href="#By_bus"><span class="tocnumber">2.2</span> <span class="toctext">By bus</span></a></li>
</ul>
</li>
<li class="toclevel-1 tocsection-5"><a href="#Get_around"><span class="tocnumber">3</span> <span class="toctext">Get around</span></a>
<ul>
<li class="toclevel-2 tocsection-6"><a href="#On_foot"><span class="tocnumber">3.1</span> <span class="toctext">On foot</span></a></li>
<li class="toclevel-2 tocsection-7"><a href="#By_bicycle"><span class="tocnumber">3.2</span> <span class="toctext">By bicycle</span></a></li>
</ul>
</li>
<li class="toclevel-1 tocsection-8"><a href="#See"><span class="tocnumber">4</span> <span class="toctext">See</span></a></li>
<li class="toclevel-1 tocsection-9"><a href="#Do"><span class="tocnumber">5</span> <span class="toctext">Do</span></a></li>
<li class="toclevel-1 tocsection-10"><a href="#Buy"><span class="tocnumber">6</span> <span class="toctext">Buy</span></a>
<ul>
<li class="toclevel-2 tocsection-11"><a href="#Groceries"><span class="tocnumber">6.1</span> <span class="toctext">Groceries</span></a></li>
</ul>
</li>
<li class="toclevel-1 tocsection-12"><a href="#Eat"><span class="tocnumber">7</span> <span class="toctext">Eat</span></a></li>
<li class="toclevel-1 tocsection-13"><a href="#Drink"><span class="tocnumber">8</span> <span class="toctext">Drink</span></a></li>
<li class="toclevel-1 tocsection-14"><a href="#Sleep"><span class="tocnumber">9</span> <span class="toctext">Sleep</span></a></li>
<li class="toclevel-1 tocsection-15"><a href="#Connect"><span class="tocnumber">10</span> <span class="toctext">Connect</span></a></li>
<li class="toclevel-1 tocsection-16"><a href="#Go_next"><span class="tocnumber">11</span> <span class="toctext">Go next</span></a></li>
</ul>
</div>
"

Event Timeline

Tgr created this paste.Apr 12 2016, 6:44 PM