jordanwb Posted June 1, 2008 Share Posted June 1, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/108244-solved-unexpected/ Share on other sites More sharing options...
redbullmarky Posted June 1, 2008 Share Posted June 1, 2008 try Plugin::$plugins = $plugins; as it's a static property Quote Link to comment https://forums.phpfreaks.com/topic/108244-solved-unexpected/#findComment-554942 Share on other sites More sharing options...
jordanwb Posted June 1, 2008 Author Share Posted June 1, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/108244-solved-unexpected/#findComment-555179 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.