[ticket/12789] Remove the directories in \phpbb\cache\driver\memory::purge()

PHPBB3-12789
[ticket/12789] Move duplicated functions to the base class

PHPBB3-12789
Merge remote-tracking branch 'github-nicofuma/ticket/12789' into develop-ascraeus

* github-nicofuma/ticket/12789:
  [ticket/12789] Move duplicated functions to the base class
  [ticket/12789] Remove the directories in \phpbb\cache\driver\memory::purge()