X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fschemaupdater.php;h=ae746c10b546a4919fde4ab68f63a6943c5194cc;hb=c214aa5149df0e0804c362021c209f78b5ee6483;hp=1960a0693001c6948191dcf629b71c1bab38945e;hpb=8884a5255fb90fda67b63fa0d4252d77176337e5;p=quix0rs-gnu-social.git diff --git a/lib/schemaupdater.php b/lib/schemaupdater.php index 1960a06930..ae746c10b5 100644 --- a/lib/schemaupdater.php +++ b/lib/schemaupdater.php @@ -28,9 +28,7 @@ * @link http://status.net/ */ -if (!defined('STATUSNET')) { - exit(1); -} +if (!defined('GNUSOCIAL')) { exit(1); } class SchemaUpdater { @@ -46,6 +44,11 @@ class SchemaUpdater */ public function register($tableName, array $tableDef) { + // Check if the table we're registering is related to a Managed_DataObject + if (is_a(ucfirst($tableName), 'Managed_DataObject', true)) { + call_user_func("{$tableName}::beforeSchemaUpdate"); + } + $this->tables[$tableName] = $tableDef; }