Extension talk:ASHighlight

SVN repo down?
I've been trying to nab this from the SVN repository all day, and haven't been able to load the page. Anyone know of another source to download this? Anderiv 19:51, 18 July 2008 (UTC)

Fix for MW 11.1.0
This extension gives the following error with Mediawiki 11.1.0

Detected bug in an extension! Hook ashighlightLoadMessages failed to return a value; should return true to continue hook processing or false to abort. Backtrace: ....

This was fixed by adding a return(TRUE) to the ashighlightLoadMessages function.

Before:

function ashighlightLoadMessages { static $loaded = false; if ( $loaded ) { return; }   global $wgMessageCache; require_once( dirname( __FILE__ ) . '/ashighlight.i18n.php' ); foreach( efashighlightMessages as $lang => $messages ) $wgMessageCache->addMessages( $messages, $lang ); }

After:

function ashighlightLoadMessages { static $loaded = false; if ( $loaded ) { return; }   global $wgMessageCache; require_once( dirname( __FILE__ ) . '/ashighlight.i18n.php' ); foreach( efashighlightMessages as $lang => $messages ) $wgMessageCache->addMessages( $messages, $lang ); # return(TRUE); }

About the fix for MW 11.1.0
Haven't been able to test this, haven't got that version installed. But it looks like the 'after' case above is not quite right: there is a 'return' which should be 'return TRUE' and another one that is commented out. So you'll probably need to play around and see what works.

I have updated the sources in the SVN repository to include 'return TRUE'. Please let me know how it works. Jdpipe 22:46, 12 January 2008 (UTC)

Issue on Windows with Mediawiki 1.9.3 and PHP 5.2.5
I'm trying this extension on a corporate installation of Mediawiki. I installed the windows package for the highlight library, and I modified the ashighlight.class.php file to reference the appropriate language files. The highlight library was installed to c:\WinHighlight (it defaulted to under Program Files, which I thought might be troublesome because of the space in the directory name). I also found a hard-coded temp path, which I changed to C:\Temp. It gives this error: Process 'highlight --fragment --syntax="php" --style-outfile="C:\Temp/highlight.css"' failed to start? It then prints out a usage message with an example syntax and a note about which languages are supported. The wikitext I tried was this: The error and usage messages appear within a red-bordered box on the rendered wiki page. Can you share any ideas on what I can do?


 * Did you check that 'highlight' is in your PATH? Jdpipe 04:14, 29 January 2008 (UTC)


 * I checked, and it was not. I added it to the path, and verified that I could then execute the highlight program from the command prompt.  However, the same error message still appears on the wiki page.  I also tried rebooting the host, and it still has the error...  -- Thanks, KaJun


 * PHP is probably using cmd.exe to open processes, and you need to give your MACHINENAME\IUSR_MACHINENAME account access to c:\windows\system32\cmd.exe, or whatever account IIS is using. - Chris

Using Apache2
I got it to work with apache2 for windows. I had to change $cmd='blah' to $cmd="c:\\winhighlight\\highlight.exe"; the hard coded temp dir to c:\\temp and the defined langdefs dir to c:\\winhighlight\\langDefs. After that though it just worked. My apache service is running with a local service account _apache which has power user privileges.