Shared PHP functions that can be ported to anything.