-# upgrade db (only) on special trigger (assures only one upgrade at a time)
-if (isset($_SERVER['HTTP_X_UPGRADE_DB_NOW'])) {
- require_once(DOCROOT . 'inc/db_upgrade.php');
- db_upgrade();
-}
+# Create tables, update schema, etc as necessary
+require_once(__DIR__.'/'.'inc/db_upgrade.php');
+db_upgrade();
+
+# paypal_ipn.php calls these when it receives a valid payment
+$GLOBALS['payment_handlers'] = [
+ # the key (below) must be the first word in the paypal variable "custom"
+ # the file will be run with wfpl's file_run()
+ # example:
+ #'membership' => __DIR__.'/'.'inc/payment_membership.php'
+];