[Wikitech-l] Detect running from maintenance script in a parser function extension
Hello, I'm checking whether I can detect that a process is run from a maintenance script in a parser function extension. Which would be the best way / more recommendable to detect it? Thanks! -- Toni Hermoso Pulido http://www.cau.cat ___ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Re: [Wikitech-l] Detect running from maintenance script in a parser function extension
On Tue, Mar 12, 2013 at 1:47 PM, Toni Hermoso Pulido toni...@cau.catwrote: Hello, I'm checking whether I can detect that a process is run from a maintenance script in a parser function extension. Which would be the best way / more recommendable to detect it? Thanks! $wgCommandLineMode should be able to tell you, although I think checking if the RUN_MAINTENANCE_IF_MAIN constant is set is probably a better method. *--* *Tyler Romeo* Stevens Institute of Technology, Class of 2015 Major in Computer Science www.whizkidztech.com | tylerro...@gmail.com ___ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Re: [Wikitech-l] Detect running from maintenance script in a parser function extension
On 12/03/13 18:47, Toni Hermoso Pulido wrote: Hello, I'm checking whether I can detect that a process is run from a maintenance script in a parser function extension. Which would be the best way / more recommendable to detect it? Thanks! Why do you want to do it? It is probably a bad idea. ___ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Re: [Wikitech-l] Detect running from maintenance script in a parser function extension
On 2013-03-12 3:19 PM, Tyler Romeo tylerro...@gmail.com wrote: On Tue, Mar 12, 2013 at 1:47 PM, Toni Hermoso Pulido toni...@cau.cat wrote: Hello, I'm checking whether I can detect that a process is run from a maintenance script in a parser function extension. Which would be the best way / more recommendable to detect it? Thanks! $wgCommandLineMode should be able to tell you, although I think checking if the RUN_MAINTENANCE_IF_MAIN constant is set is probably a better method. *--* *Tyler Romeo* Stevens Institute of Technology, Class of 2015 Major in Computer Science www.whizkidztech.com | tylerro...@gmail.com ___ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l More interesting question - why do you need to know. Making wikitext vary between maintenance script and normal may cause a bit of breakage given jobQueue etc. -bawolff ___ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Re: [Wikitech-l] Detect running from maintenance script in a parser function extension
Al 12/03/13 21:08, En/na Brian Wolff ha escrit: On 2013-03-12 3:19 PM, Tyler Romeo tylerro...@gmail.com wrote: On Tue, Mar 12, 2013 at 1:47 PM, Toni Hermoso Pulido toni...@cau.cat wrote: Hello, I'm checking whether I can detect that a process is run from a maintenance script in a parser function extension. Which would be the best way / more recommendable to detect it? Thanks! $wgCommandLineMode should be able to tell you, although I think checking if the RUN_MAINTENANCE_IF_MAIN constant is set is probably a better method. *--* *Tyler Romeo* Stevens Institute of Technology, Class of 2015 Major in Computer Science www.whizkidztech.com | tylerro...@gmail.com ___ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l More interesting question - why do you need to know. Making wikitext vary between maintenance script and normal may cause a bit of breakage given jobQueue etc. Hello, maybe it's a bit weird and little orthodox… In any case, it's for batch processing (with WikiPage::doEdit) some wiki pages that have a UserFunctions parserfunction in their wikitext http://www.mediawiki.org/wiki/Extension:UserFunctions so that such parser function is ignored in building the page. Cheers, -- Toni Hermoso Pulido http://www.cau.cat ___ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Re: [Wikitech-l] Detect running from maintenance script in a parser function extension
On 3/12/13, Toni Hermoso Pulido toni...@cau.cat wrote: Al 12/03/13 21:08, En/na Brian Wolff ha escrit: On 2013-03-12 3:19 PM, Tyler Romeo tylerro...@gmail.com wrote: On Tue, Mar 12, 2013 at 1:47 PM, Toni Hermoso Pulido toni...@cau.cat wrote: Hello, I'm checking whether I can detect that a process is run from a maintenance script in a parser function extension. Which would be the best way / more recommendable to detect it? Thanks! $wgCommandLineMode should be able to tell you, although I think checking if the RUN_MAINTENANCE_IF_MAIN constant is set is probably a better method. *--* *Tyler Romeo* Stevens Institute of Technology, Class of 2015 Major in Computer Science www.whizkidztech.com | tylerro...@gmail.com ___ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l More interesting question - why do you need to know. Making wikitext vary between maintenance script and normal may cause a bit of breakage given jobQueue etc. Hello, maybe it's a bit weird and little orthodox… In any case, it's for batch processing (with WikiPage::doEdit) some wiki pages that have a UserFunctions parserfunction in their wikitext http://www.mediawiki.org/wiki/Extension:UserFunctions so that such parser function is ignored in building the page. Cheers, -- Toni Hermoso Pulido http://www.cau.cat ___ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l Ok, that's probably safe, since that extension disables caching. --bawolff ___ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l