AnthonyH Posted May 21, 2011 Share Posted May 21, 2011 Hello, I am having trouble with my wiki and it keeps giving me an error that I just can't find and it's driving me nutz! Can someone look at this and see the problem? Parse error: syntax error, unexpected T_FUNCTION, expecting T_VARIABLE in /home/revo/public_html/members/wiki/includes/AutoLoader.php on line 587 Here is the line along with a few previous and prior lines of the actual code - line 578-560: # Make an absolute path, this improves performance by avoiding some stat calls if ( substr( $filename, 0, 1 ) != '/' && substr( $filename, 1, 1 ) != ':' ) { global $IP; $filename = "$IP/$filename"; }{ require( $filename ); return true; } static function loadAllExtensions( $className ) { global $wgAutoloadClasses, $wgAutoloadClasses; } foreach( $wgAutoloadClasses as $class => $file ) { if( !( class_exists( $class, false ) || interface_exists( $class, false ) ) ) { require( $file ); } } } } function wfLoadAllExtensions() { AutoLoader::loadAllExtensions(); } if ( function_exists( 'spl_autoload_register' ) ) { spl_autoload_register( array( 'AutoLoader', 'autoload' ) ); } else { function __autoload( $class ) { AutoLoader::autoload( $class ); } } ?> The actual line that has the error is: static function loadAllExtensions( $className ) { Best Regards, Anthony Quote Link to comment Share on other sites More sharing options...
fugix Posted May 21, 2011 Share Posted May 21, 2011 In you first if statement. After you end the if statement you forgot to add "else" after Quote Link to comment Share on other sites More sharing options...
jcbones Posted May 21, 2011 Share Posted May 21, 2011 In you first if statement. After you end the if statement you forgot to add "else" after HUH??? OK, after careful consideration, I followed you. Your post needs to be clear and concise in order to help someone. Fugix is talking about here: # Make an absolute path, this improves performance by avoiding some stat calls if ( substr( $filename, 0, 1 ) != '/' && substr( $filename, 1, 1 ) != ':' ) { global $IP; $filename = "$IP/$filename"; }{ //<-missed your 'else' between the brackets. require( $filename ); return true; } Quote Link to comment Share on other sites More sharing options...
fugix Posted May 21, 2011 Share Posted May 21, 2011 Yeah. Sorry I'm on an iPad. Hard to copy paste code. Thanks for clarifying jcbones Quote Link to comment Share on other sites More sharing options...
AnthonyH Posted May 21, 2011 Author Share Posted May 21, 2011 Thank you both! Now that is fixed I get another error: Fatal error: Class 'WebRequest' not found in /home/revo/public_html/members/wiki/includes/Setup.php on line 156 Here is the code along the lines 154-156: $wgIP = false; # Load on demand # Can't stub this one, it sets up $_GET and $_REQUEST in its constructor $wgRequest = new WebRequest; Your help is truly appreciated! Quote Link to comment Share on other sites More sharing options...
jcbones Posted May 23, 2011 Share Posted May 23, 2011 Self explanatory, PHP cannot find the class 'WebRequest'. Either it does NOT exist, or you spelt it wrong. Perhaps you missed an include. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.