aboutsummaryrefslogtreecommitdiff
path: root/mod/upgrade-tools/lib/upgrade_tools.php
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2014-03-15 14:55:00 -0300
committerSilvio Rhatto <rhatto@riseup.net>2014-03-15 14:55:00 -0300
commitf3beeb45f9f192aee6ede0c9b6f0fa8b8d82a9ef (patch)
tree39ea928f9fa9414cac01889dc6ec28379c02e977 /mod/upgrade-tools/lib/upgrade_tools.php
parent1a4a96bd03e016e5d32a5c3050f40c1011a0f893 (diff)
parent912fa61a7f5bbeb68c575089333df9b208627aa4 (diff)
downloadelgg-f3beeb45f9f192aee6ede0c9b6f0fa8b8d82a9ef.tar.gz
elgg-f3beeb45f9f192aee6ede0c9b6f0fa8b8d82a9ef.tar.bz2
Merge commit '912fa61a7f5bbeb68c575089333df9b208627aa4' as 'mod/upgrade-tools'
Diffstat (limited to 'mod/upgrade-tools/lib/upgrade_tools.php')
-rw-r--r--mod/upgrade-tools/lib/upgrade_tools.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/mod/upgrade-tools/lib/upgrade_tools.php b/mod/upgrade-tools/lib/upgrade_tools.php
new file mode 100644
index 000000000..20badf9be
--- /dev/null
+++ b/mod/upgrade-tools/lib/upgrade_tools.php
@@ -0,0 +1,25 @@
+<?php
+
+/**
+ * Process upgrades for the videolist plugin
+ */
+function upgrade_module_run($module) {
+ $path = elgg_get_plugins_path() . "$module/upgrades/";
+ $files = elgg_get_upgrade_files($path);
+ foreach ($files as $file) {
+ include "$path{$file}";
+ }
+}
+
+function upgrade_change_subtype($entity, $subtype) {
+ $dbprefix = elgg_get_config('dbprefix');
+ $subtype_id = add_subtype('object', $subtype);
+ update_data("UPDATE {$dbprefix}entities set subtype=$subtype_id WHERE guid=$entity->guid");
+ return true;
+}
+
+function upgrade_update_river($id, $view, $object_guid, $annotation_id) {
+ $dbprefix = elgg_get_config('dbprefix');
+ update_data("UPDATE {$dbprefix}river set view='$view', object_guid=$object_guid, annotation_id=$annotation_id WHERE id=$id");
+ return true;
+}