MyBB Community Forums

Full Version: Objects in plugins - MyBB 1.6.5
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Quote:Yeah sure, but it's easy to put objects in global...

No, because all code is inside pluginSystem object.
You can't use global to you object (you can, but it isn't work), but you can use global to $plugins object.
I try this:

// Add hooks
$plugins->objects['MyPlugin'] = new MyPlugin();

$plugins->hooks["postbit"][10]["myPluginMethod"] = array("function" => create_function('&$post','global $plugins; return $plugins->objects[\'MyPlugin\']->myPluginMethod($post);'));

I know, a little strange, but it's works.

Quote:Maybe you want to elaborate?

1. Access control to properties and methods.
2. Free movement of data inside the object (I don't must use global, global and global and global).
as lukasamd wrote, you shouldn't make such a big system change in current branch, especially without any prior notification
it's not the plugin developers that are going to lose something here (not counting time spent to update plugins), but administrators and forum users, whose plugins (not all of them) wont work the moment they update their forum
new versions of plugins won't appear 5 minutes after you release new MyBB update ... now we count this time in days, not minutes, and still there are incompatible plugins, and there will be
question for administrators is: should I update MyBB and try to update plugins myself ... if I know how to ?? or maybe skip it, because it's not worth it

P.S.
your own wiki agrees with second option:
Quote:Latest MyBB Release: Version 1.6.4 (July 26, 2011)
that's current announcement
(2011-11-26, 01:15 PM)Soul Reaver Wrote: [ -> ]as lukasamd wrote, you shouldn't make such a big system change in current branch, especially without any prior notification
it's not the plugin developers that are going to lose something here (not counting time spent to update plugins), but administrators and forum users, whose plugins (not all of them) wont work the moment they update their forum
new versions of plugins won't appear 5 minutes after you release new MyBB update ... now we count this time in days, not minutes, and still there are incompatible plugins, and there will be
question for administrators is: should I update MyBB and try to update plugins myself ... if I know how to ?? or maybe skip it, because it's not worth it

P.S.
your own wiki agrees with second option:
Quote:Latest MyBB Release: Version 1.6.4 (July 26, 2011)
that's current announcement

We were all notified of the changes within plenty of time. And yes, you should upgrade. To not upgrade would be stupid seeing as there are publicly documented security vulnerabilities in 1.6.4.
I think the three weeks or whatever was plenty of notice.

As for the changes, most of them were required because php 5.3.x has deprecated some of what we were using.
Pages: 1 2