[RFC] Cache plugins refactoring

These requests for comments/change have lead to an implemented feature that has been successfully merged into the 3.1/Ascraeus branch. Everything listed in this forum will be available in phpBB 3.1.
Post Reply
User avatar
igorw
Registered User
Posts: 500
Joined: Thu Jan 04, 2007 11:47 pm

[RFC] Cache plugins refactoring

Post by igorw » Thu Sep 09, 2010 7:52 pm

The cache "plugins" system is a mess. The plugin defines the base class (must have a certain name), phpBB provides a class that extends the plugin.

Currently

Code: Select all

// I am a plugin
class acm
{
}

Code: Select all

// I am phpBB
class cache extends acm
{
}
Should be

Code: Select all

// I am phpBB
abstract class phpbb_acm_base implements phpbb_acm_interface
{
}

Code: Select all

// I am a plugin
class phpbb_acm_xcache extends phpbb_acm_base
{
}

Code: Select all

// I am an awesome plugin
class phpbb_acm_awesome_plugin extends phpbb_acm_other_plugin
{
}
Details
  • Proper use of polymorphism
  • Remove includes/cache.php (or make it use a acm instance instead of extending acm)
  • Use class loader
  • Abstract base class and interface
  • All plugins need to be refactored

Post Reply