Remove extraneous functionality from core.
We need to remove the extraneous functionality from the core into the specific plugins.
Things like messaging, follow, comment_vote (check if done), useractivity, tags, categories ...
Things like messaging, follow, comment_vote (check if done), useractivity, tags, categories ...
Leave a comment
on 2010-11-30 12:31 *
By
Description changed from We need to remove the extra... to We need to remove the extra...
on 2010-11-30 13:42 *
By nick_ramsay
All these things were moved from their respective plugins into the core over the last few releases. The reason for that was to give Hotaru a set of classes with commonly used CMS functions so that plugins could be created more easily. For example, I made a non-public plugin called "Like" which uses methods in the Vote class. If those methods are moved into the Vote plugin, they would no longer be available and would make development of other voting plugins more troublesome.
on 2010-11-30 15:07 *
By
I can see your point and I admit that I wasn't aware of such decision.
The common functionality can be used by
Combined with the
All this without preloading the functionality when the Hotaru instance is fired up thus reducing the memory footprint.
The common functionality can be used by
include(PLUGINS.'<dependancy_plugin_name>/libs/<lib_name>.php')
for the plugins that need something from another more basic plugin.Combined with the
require:
directive in the plugin metadata comment header a plugin that is being installed can protest if the required functionality doesn't exist and prompt the the user that another plugin is needed.All this without preloading the functionality when the Hotaru instance is fired up thus reducing the memory footprint.
on 2010-12-01 00:11 *
By nick_ramsay
I thought most classes in libs were only loaded when needed, by SmartLoader? Before SmartLoader was introduced, I had conditions around most function calls in Hotaru.php to only include each class when not already included. Here's an example from the old Hotaru 1.0:
Is it different now? Is everything pre-loaded?
public function getEmailFromId($userid = 0)
{
require_once(LIBS . 'UserInfo.php');
$userInfo = new UserInfo();
return $userInfo->getEmailFromId($this, $userid);
}
Is it different now? Is everything pre-loaded?
on 2010-12-13 22:40 *
By
I searched in the Hotaru core and the HotaruExtensions repos for uses of the functions declared in the "VOTE FUNCTIONS" section of Hotaru.php and couldn't find any occurences of them being used anywhere. Should we remove them ?
on 2010-12-14 00:39 *
By nick_ramsay
I rewrote the Vote plugin to use them back in the summer, but never released it. I guess the class can be removed.
on 2010-12-14 01:01 *
By nick_ramsay
Re: Replacing Hotaru::email() with EmailFunctions::email()
I'm not really keen on this because until now, newbie plugin developers have learned that Hotaru does cool stuff with simply $h->doSomethingCool(), using the Hotaru.php file as a reference for all these cool functions. By changing $h->email() to EmailFunctions::email(), you're breaking tradition, and possibly introducing syntax that is new for beginner developers. I hope that we can make plugin development easier for newbies, but this change sets a precedent for more changes to the :: syntax, and that requires newbies to actually look in the libs folder, something they haven't had to do before.
If you really must make this change permanent, then don't forget to update the version numbers and readme files for the affected plugins if they haven't already been updated since their last release in the forums.
I'm not really keen on this because until now, newbie plugin developers have learned that Hotaru does cool stuff with simply $h->doSomethingCool(), using the Hotaru.php file as a reference for all these cool functions. By changing $h->email() to EmailFunctions::email(), you're breaking tradition, and possibly introducing syntax that is new for beginner developers. I hope that we can make plugin development easier for newbies, but this change sets a precedent for more changes to the :: syntax, and that requires newbies to actually look in the libs folder, something they haven't had to do before.
If you really must make this change permanent, then don't forget to update the version numbers and readme files for the affected plugins if they haven't already been updated since their last release in the forums.
on 2010-12-14 05:34 *
By
The worst thing about the code structure of Hotaru now is the dependency injection of the main Hotaru class. Having the $h object thrown around doesn't make the code testable (thus controllable, measurable). Dependency injection used like that makes the parts of the code bad to maintain or extend.
If it is plugin developers (newbie or not) that we are after here we can't say "just use these". HotaruCMS can provide good foundation on how to program in PHP. In any case, having a class that exposes the API in a certain way is really not that hard ;)
If it is plugin developers (newbie or not) that we are after here we can't say "just use these". HotaruCMS can provide good foundation on how to program in PHP. In any case, having a class that exposes the API in a certain way is really not that hard ;)
on 2010-12-14 07:26 *
By nick_ramsay
Well I admit that having the Hotaru "shortcut" methods hasn't attracted the number of newbie plugin developers that I had hoped for anyway, so I'll put my faith in your judgment that using class libraries directly is best for Hotaru.
on 2010-12-14 08:28 *
By
I sincerely admire the constant open-ness that you breath into the project!
Apart from that, it not about having faith, it is about being able to steer and manage HotaruCMS development.
I know that it is just a few people for now,.. but lets get it right. :)
Apart from that, it not about having faith, it is about being able to steer and manage HotaruCMS development.
I know that it is just a few people for now,.. but lets get it right. :)
on 2010-12-19 12:22 *
By nick_ramsay
The updated deleteFiles() function in FileSystem.php is a bit dodgy. Try installing or uninstalling a plugin and you'll see what I mean. ;)
(In revision:2321) [Branch 1.5] Fixing the FileSystem::deleteFiles() as per Nick's comment refs #182