Jump to content

[SOLVED] unexpected '='


jordanwb

Recommended Posts

Error:

 

Parse error: syntax error, unexpected '=' in /var/www/scm/core/plugin.php on line 28

 

<?php

abstract class Plugin
{
private $sql_engine;

static public $plugins;

public function __construct (DatabaseEngine $sql_engine)
{
	$this->sql_engine = $sql_engine;
}

public static function load_plugins (DatabaseEngine $sql_engine)
{
	$query = "SELECT * FROM `".$sql_engine->table_prefix."pluigns` WHERE `plugin_enabled`=1";
	$plugins = null;

	if ($result = $sql_engine->query ($query))
	{
		if ($sql_engine->has_rows ($result))
		{
			while ($plugin = $sql_engine->get_next_row ($result))
			{
				include ("plugins/".$plugin["plugin_path"]);
			}

			Plugin::plugins = $plugins;
		}
	}

	return $plugins;
}

public abstract function make_menu ();
public abstract function content ();
}

?>

 

The problem is in the static function load_plugins () on this line:

 

Plugin::plugins = $plugins;

 

Now if there were any plugins in the table $plugins would not be null. It would be an array of classes extending the Plugin class. I have the static variable so plugins can access other installed plugins.

 

[Edit] Loving the new site.  ;D

Link to comment
Share on other sites

So why do I in order to access an instance property do $this->property but for a static property I do Class::$property? That makes no sense. It should be

 

$this->property and

Class::property

 

or

 

$this->$property and

Class::$property

 

They're both accessing a property the only difference is whether or not they're static.

 

Anyways it worked.

 

I never got an email saying there was a reply despite selecting that.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.