Adam Meyer wrote:
Im on 1.14
So say, I wanted to query the main page for a list of all of its categories, I would think I could do this.
$params = array ( 'action' => 'query', 'prop' => 'categories', 'cllimit' => 500, 'titles' => 'Main Page', 'format' => 'json' );
$api = new ApiMain($params); $api->execute(); $data = & $api->getResultData();
But I get Call to a member function getVal() on a non-object in includes/api/ ApiMain.php on line 146
So I figure this is not how it is done.
I actually figured out what I was doing wrong. You can't do it outside of a hook.
But it also makes it less likely for me to be able use this.
That's inside a 'if (!this->mInternalMode)' block.
Try doing $api = new ApiMain(new FauxRequest($params));