BxDolMConfig.php 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  1. <?php defined('BX_DOL') or die('hack attempt');
  2. /**
  3. * Copyright (c) UNA, Inc - https://una.io
  4. * MIT License - https://opensource.org/licenses/MIT
  5. *
  6. * @defgroup DolphinMigration Dolphin Migration
  7. * @ingroup UnaModules
  8. *
  9. * @{
  10. */
  11. class BxDolMConfig extends BxBaseModGeneralConfig
  12. {
  13. /**
  14. * @var array una modules uris, associated with migration modules names (mainly uses for Timeline migration)
  15. */
  16. public $_aModulesAliases = array(
  17. 'bx_store' => 'store',
  18. 'bx_files' => 'files',
  19. 'bx_poll' => 'polls',
  20. 'bx_events' => 'events',
  21. 'bx_groups' => 'groups',
  22. 'bx_blogs' => 'blogs'
  23. );
  24. /**
  25. * @var bool allows to overwrite existed members profile data
  26. */
  27. public $_bIsOverwrite = false;
  28. /**
  29. * @var bool allows to transfer photo albums even if they are empty
  30. */
  31. public $_bTransferEmpty = true;
  32. /**
  33. * @var bool allows to use members NickName instead of FullName
  34. */
  35. public $_bUseNickName = false;
  36. /**
  37. * @var int interval in milliseconds for checking if the data already transferred but script still works.
  38. */
  39. public $_iCheckInterval = 60000;
  40. /**
  41. * @var array modules for transfer from Dolphin to UNA with parameters
  42. * [table_name] - (string) table from which to get data
  43. * [migration_class] - (string) class name/file name for data migration
  44. * [dependencies] - (array) list of the modules which should be migrated before transferring selected module
  45. * [plugins] - (array) list of the modules which should be installed on UNA before transferring selected module
  46. */
  47. public $_aMigrationModules = array(
  48. 'profiles' => array(
  49. 'table_name' => 'Profiles',
  50. 'migration_class' => 'BxDolMProfiles',
  51. 'dependencies' => array(
  52. ),
  53. 'plugins' => array(
  54. 'bx_persons' => 'Persons',
  55. ),
  56. ),
  57. 'profile_fields' => array(
  58. 'table_name' => 'sys_profile_fields',
  59. 'migration_class' => 'BxDolMProfilesFields',
  60. 'dependencies' => array(
  61. 'profiles',
  62. ),
  63. 'plugins' => array(
  64. 'bx_persons' => 'Persons',
  65. ),
  66. ),
  67. 'blogs' => array(
  68. 'table_name' => 'bx_blogs_posts',
  69. 'migration_class' => 'BxDolMBlogs',
  70. 'type' => 'blog',
  71. 'keywords' => 'bx_posts_meta_keywords',
  72. 'dependencies' => array(
  73. 'profiles',
  74. ),
  75. 'plugins' => array(
  76. 'bx_persons' => 'Persons',
  77. 'bx_posts' => 'Posts'
  78. ),
  79. ),
  80. 'groups' => array(
  81. 'table_name' => 'bx_groups_main',
  82. 'migration_class' => 'BxDolMGroups',
  83. 'type' => 'bx_groups',
  84. 'keywords' => 'bx_groups_meta_keywords',
  85. 'dependencies' => array(
  86. 'profiles',
  87. ),
  88. 'plugins' => array(
  89. 'bx_persons' => 'Persons',
  90. 'bx_groups' => 'Groups'
  91. ),
  92. ),
  93. 'events' => array(
  94. 'table_name' => 'bx_events_main',
  95. 'type' => 'bx_events',
  96. 'keywords' => 'bx_events_meta_keywords',
  97. 'migration_class' => 'BxDolMEvents',
  98. 'dependencies' => array(
  99. 'profiles',
  100. ),
  101. 'plugins' => array(
  102. 'bx_persons' => 'Persons',
  103. 'bx_events' => 'Events'
  104. ),
  105. ),
  106. 'photos' => array(
  107. 'table_name' => 'bx_photos_main',
  108. 'table_name_albums' => 'sys_albums',
  109. 'type' => 'bx_photos',
  110. 'keywords' => 'bx_albums_meta_keywords_media',
  111. 'migration_class' => 'BxDolMPhotoAlbums',
  112. 'dependencies' => array(
  113. 'profiles',
  114. ),
  115. 'plugins' => array(
  116. 'bx_persons' => 'Persons',
  117. 'bx_albums' => 'Albums'
  118. ),
  119. ),
  120. 'videos' => array(
  121. 'table_name' => 'RayVideoFiles',
  122. 'table_name_albums' => 'sys_albums',
  123. 'type' => 'bx_videos',
  124. 'keywords' => 'bx_albums_meta_keywords_media',
  125. 'migration_class' => 'BxDolMVideoAlbums',
  126. 'dependencies' => array(
  127. 'profiles',
  128. ),
  129. 'plugins' => array(
  130. 'bx_persons' => 'Persons',
  131. 'bx_albums' => 'Albums'
  132. ),
  133. ),
  134. 'conversations' => array(
  135. 'table_name' => 'sys_messages',
  136. 'migration_class' => 'BxDolMConv',
  137. 'dependencies' => array(
  138. 'profiles',
  139. ),
  140. 'plugins' => array(
  141. 'bx_persons' => 'Persons',
  142. 'bx_convos' => 'Conversations'
  143. ),
  144. ),
  145. 'forum' => array(
  146. 'table_name' => 'bx_forum_topic',
  147. 'table_name_post' => 'bx_forum_post',
  148. 'migration_class' => 'BxDolMForum',
  149. 'dependencies' => array(
  150. 'profiles',
  151. ),
  152. 'plugins' => array(
  153. 'bx_persons' => 'Persons',
  154. 'bx_forum' => 'Discussions'
  155. ),
  156. ),
  157. 'polls' => array(
  158. 'table_name' => 'bx_poll_data',
  159. 'migration_class' => 'BxDolMPolls',
  160. 'type' => 'bx_poll',
  161. 'keywords' => 'bx_polls_meta_keywords',
  162. 'dependencies' => array(
  163. 'profiles',
  164. ),
  165. 'plugins' => array(
  166. 'bx_persons' => 'Persons',
  167. 'bx_polls' => 'Polls'
  168. ),
  169. ),
  170. 'files' => array(
  171. 'table_name' => 'bx_files_main',
  172. 'migration_class' => 'BxDolMFiles',
  173. 'type' => 'bx_files',
  174. 'keywords' => 'bx_files_meta_keywords',
  175. 'dependencies' => array(
  176. 'profiles',
  177. ),
  178. 'plugins' => array(
  179. 'bx_persons' => 'Persons',
  180. 'bx_files' => 'Files'
  181. ),
  182. ),
  183. 'store' => array(
  184. 'table_name' => 'bx_store_products',
  185. 'migration_class' => 'BxDolMMarket',
  186. 'type' => 'bx_store',
  187. 'keywords' => 'bx_market_meta_keywords',
  188. 'dependencies' => array(
  189. 'profiles',
  190. ),
  191. 'plugins' => array(
  192. 'bx_persons' => 'Persons',
  193. 'bx_market' => 'Market'
  194. ),
  195. ),
  196. 'quotes' => array(
  197. 'table_name' => 'bx_quotes_units',
  198. 'migration_class' => 'BxDolMQuotes',
  199. 'plugins' => array(
  200. 'bx_quoteofday' => 'Quotes'
  201. ),
  202. ),
  203. 'shoutbox' => array(
  204. 'table_name' => 'bx_shoutbox_messages',
  205. 'migration_class' => 'BxDolMShoutBox',
  206. 'dependencies' => array(
  207. 'profiles',
  208. ),
  209. 'plugins' => array(
  210. 'bx_persons' => 'Persons',
  211. 'bx_messenger' => 'Jot Messenger'
  212. ),
  213. ),
  214. 'simple_messenger' => array(
  215. 'table_name' => 'bx_simple_messenger_messages',
  216. 'migration_class' => 'BxDolMSimpleMessenger',
  217. 'dependencies' => array(
  218. 'profiles',
  219. ),
  220. 'plugins' => array(
  221. 'bx_persons' => 'Persons',
  222. 'bx_messenger' => 'Jot Messenger'
  223. ),
  224. ),
  225. 'chat' => array(
  226. 'table_name' => 'RayChatHistory',
  227. 'migration_class' => 'BxDolMChat',
  228. 'dependencies' => array(
  229. 'profiles',
  230. ),
  231. 'plugins' => array(
  232. 'bx_persons' => 'Persons',
  233. 'bx_messenger' => 'Jot Messenger'
  234. ),
  235. ),
  236. 'timeline' => array(
  237. 'table_name' => 'bx_wall_events',
  238. 'migration_class' => 'BxDolMTimeline',
  239. 'dependencies' => array
  240. (
  241. 'profiles',
  242. ),
  243. 'plugins' => array
  244. (
  245. 'bx_persons' => 'Persons',
  246. 'bx_timeline' => 'Timeline'
  247. ),
  248. ),
  249. 'membership_levels' => array(
  250. 'table_name' => 'sys_acl_levels',
  251. 'migration_class' => 'BxDolMMemLevels',
  252. 'dependencies' => array(
  253. 'profiles',
  254. ),
  255. 'plugins' => array(
  256. 'bx_acl' => 'Paid Levels'
  257. ),
  258. )
  259. );
  260. public function __construct($aModule)
  261. {
  262. $this -> _bIsOverwrite = getParam('bx_dolphin_migration_overwrite');
  263. $this -> _bTransferEmpty = getParam('bx_dolphin_migration_empty_albums');
  264. $this -> _bUseNickName = getParam('bx_dolphin_migration_use_nickname');
  265. parent::__construct($aModule);
  266. }
  267. }
  268. /** @} */