0

I have looked and looked all over to find a way to make something similar to PhpBB's automod system they use for their software.

I cannot seem to find anything similar to this with the whole xml find and replace code updater and mod installer.

I may just be typing in the wrong keywords in Google, but does anyone know of any system like this available before I start trying to make my own?

EDIT: I mean more like a code updater. For example find and replaces in a php file.

FIND:

?>

ADD BEFORE:

echo "this is text added before the ?>";

I realize this could be done with str_replace but there is surely a system out there that already does this reliably.

alexander7567
  • 665
  • 13
  • 35
  • Why not use the one that phpBB uses? – Niko Jun 14 '13 at 15:43
  • 1
    Have a look at http://stackoverflow.com/questions/42/best-way-to-allow-plugins-for-a-php-application, and [PHPPlexus](https://code.google.com/p/phpplexus/). – cmbuckley Jun 14 '13 at 15:44
  • @Niko because its not for phpbb... Its just for my own stuff. – alexander7567 Jun 14 '13 at 16:12
  • @cbuckley I suppose I did not make myself clear exactly what I wanted.. I edit my OP. – alexander7567 Jun 14 '13 at 16:17
  • 2
    phpBB's "automod" functionality is an **unholy abomination**. Good software can be extended with modules (like WordPress or MediaWiki extensions) – patching is a terrible way to go about this. –  Jun 14 '13 at 17:10

1 Answers1

2

The reason that a system doesn't exist outside of phpBB is because it's an incredibly poor way to manage modifications. Your question does not make it clear what you want to gain from this, but since it is your own code, you should definitely not look to copy something so awful.

For “patching” code

If you want the ability to apply updates to your code, then you should look at handling it through version control. For instance, you could develop and test in a local git repository, and once you are happy, push the changes to the server. You have many options here from a basic update script to a fully-fledged Continuous Integration solution.

phpBB have implemented a solution for patching code on your live site via a Web interface, which has many issues with security, verifiability and maintainability among others.

For exposing “plugin” functionality

If you want the ability to register plugins in parts of your code, then you should architect your code as such to allow it to be handled easily. Wordpress, MediaWiki and other projects can help you write such a structure.

cmbuckley
  • 40,217
  • 9
  • 77
  • 91