General idea of adaptability

The simplest way to make something adaptable is to write the general code in a base class and call is MySomethingBase, for example. Check if a local adaptation is available in a specified filename in the local directory, if it is just include that file. If it isn't, create a class MySomething extends MySomethingBase and is empty.

The base code would look like this:

class MySomethingStd {
  // filled with functions.... Of course.
}

if(file_exists("../local/something.php")) {
  include_once("../local/something.php");
} else {
  class MySomething extends MySomethingStd {
  }
}

The local something.php would of course also contain the same definition as in the else but would not be empty.

This works best with small functions in the class that has single and well defined functions, in some cases it might even be worthwhile to split a function into several sub functions to make it more flexible for adaptions. In the overriding class "MySomething" you can call the parent class at any time to get standard behaviour run. Note that you should always run the standard code, it's extremly rare that you'll need to completely override a behaviour. If you think you do, follow the code path first to make sure nothing of importance is skipped.