When you said "through plain PHP," I interpreted that to mean outside the wiki - i.e. a stand alone PHP program. You could do that the way I showed, but what you are pointing to with that URL is for use within the wiki - e.g. from within an extension.
What version of MW are you using - the hook function you need may be in your version if you are not running 1.14 or 1.15. Without seeing details of what you're doing, anything I say would be a wild guess. Adam Meyer wrote: > It looks like this would be my answer. > http://www.mediawiki.org/wiki/API:Calling_internally > > But it dosnt work. > I get some error about a hook function missing or something. > > But I would love it if it could work this easily. > > > On Jun 19, 2009, at 9:28 PM, Michael Daly wrote: > >> Adam Meyer wrote: >> >>> Is this doable? >> There may be a better way to do this, but... >> >> In PHP, you can get the wiki page as if it was a file: >> >> $myPageUrl ="http://example.com/api.php?action=parse&text={{:Main >> Page}}__TOC__&prop=sections"; >> // set to 20 second timeout then restore. >> $currentTimeout = ini_set( 'default_socket_timeout', "20" ); >> $myPage = file($myPageUrl); >> ini_set( 'default_socket_timeout', $currentTimeout ); >> >> >> This will produce a list of section headers. Count them to see what >> the >> last one is. >> >> I've found it useful to ensure that any timeouts due to the web page >> access are trapped here and don't run into the overall program >> timeout. >> Restore the old timeout once the page is read. >> >> If you need to set up a session (e.g. to log in and stay logged in >> while >> you get data from pages) look up curl in the online PHP manual. >> >> Mike >> >> >> _______________________________________________ >> MediaWiki-l mailing list >> [email protected] >> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l > > > _______________________________________________ > MediaWiki-l mailing list > [email protected] > https://lists.wikimedia.org/mailman/listinfo/mediawiki-l > _______________________________________________ MediaWiki-l mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
