upgrade_tools.php 769 B

1234567891011121314151617181920212223242526
  1. <?php
  2. /**
  3. * Process upgrades for the videolist plugin
  4. */
  5. function upgrade_module_run($module) {
  6. $path = elgg_get_plugins_path() . "$module/upgrades/";
  7. $files = elgg_get_upgrade_files($path);
  8. foreach ($files as $file) {
  9. include "$path{$file}";
  10. }
  11. }
  12. function upgrade_change_subtype($entity, $subtype) {
  13. $dbprefix = elgg_get_config('dbprefix');
  14. $subtype_id = add_subtype('object', $subtype);
  15. update_data("UPDATE {$dbprefix}entities set subtype=$subtype_id WHERE guid=$entity->guid");
  16. return true;
  17. }
  18. function upgrade_update_river($id, $view, $object_guid, $annotation_id) {
  19. $dbprefix = elgg_get_config('dbprefix');
  20. update_data("UPDATE {$dbprefix}river set view='$view', object_guid=$object_guid, annotation_id=$annotation_id WHERE id=$id");
  21. return true;
  22. }