Jump to content

WIKI - code error


AnthonyH

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/237062-wiki-code-error/
Share on other sites

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;
   }

Link to comment
https://forums.phpfreaks.com/topic/237062-wiki-code-error/#findComment-1218522
Share on other sites

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!

 

Link to comment
https://forums.phpfreaks.com/topic/237062-wiki-code-error/#findComment-1218529
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.