cache.mod.php 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553
  1. <?php
  2. /**
  3. * [WeEngine System] Copyright (c) 2014 WE7.CC
  4. * WeEngine is NOT a free software, it under the license terms, visited http://www.we7.cc/ for more details.
  5. */
  6. function cache_build_template() {
  7. load()->func('file');
  8. rmdirs(IA_ROOT . '/data/tpl', true);
  9. }
  10. function cache_build_setting() {
  11. $setting = table('core_settings')->getall('key');
  12. if (is_array($setting)) {
  13. foreach ($setting as $k => $v) {
  14. $setting[$v['key']] = iunserializer($v['value']);
  15. }
  16. cache_write(cache_system_key('setting'), $setting);
  17. }
  18. }
  19. function cache_build_account_modules($uniacid = 0, $uid = 0) {
  20. load()->model('phoneapp');
  21. load()->model('miniapp');
  22. $uniacid = intval($uniacid);
  23. if (empty($uniacid)) {
  24. cache_clean(cache_system_key('unimodules'));
  25. if (!empty($uid)) {
  26. cache_delete(cache_system_key('user_modules', array('uid' => $uid)));
  27. } else {
  28. cache_clean(cache_system_key('user_modules'));
  29. }
  30. return true;
  31. } else {
  32. cache_delete(cache_system_key('unimodules', array('uniacid' => $uniacid)));
  33. if (empty($uid)) {
  34. $uid = table('account')->searchWithUniacid($uniacid)->searchWithRole('owner')->getOwnerUid();
  35. }
  36. cache_delete(cache_system_key('user_modules', array('uid' => $uid)));
  37. }
  38. $account_info = uni_fetch($uniacid);
  39. if (is_error($account_info)) {
  40. return false;
  41. }
  42. $uni_modules_new = uni_modules_by_uniacid($uniacid);
  43. $module_system = module_system();
  44. foreach ($uni_modules_new as $uni_module_new_key => $uni_module_new_val) {
  45. if (in_array($uni_module_new_key, $module_system)) {
  46. unset($uni_modules_new[$uni_module_new_key]);
  47. } elseif ($account_info->typeSign == 'wxapp' && $uni_module_new_val[MODULE_SUPPORT_WXAPP_NAME] != MODULE_SUPPORT_WXAPP) {
  48. unset($uni_modules_new[$uni_module_new_key]);
  49. }
  50. }
  51. $uni_modules_new = array_keys($uni_modules_new);
  52. if ($account_info->supportVersion) {
  53. $version_modules = array();
  54. if ($account_info['type'] == ACCOUNT_TYPE_PHONEAPP_NORMAL) {
  55. $version_all = phoneapp_version_all($uniacid);
  56. }
  57. if(in_array($account_info['type'], array(ACCOUNT_TYPE_APP_NORMAL, ACCOUNT_TYPE_APP_AUTH))) {
  58. $version_all = miniapp_version_all($uniacid);
  59. }
  60. if (!empty($version_all)) {
  61. foreach($version_all as $version_key => $version_val) {
  62. if (empty($version_val['modules'])) {
  63. continue;
  64. }
  65. foreach ($version_val['modules'] as $module_name => $module_info) {
  66. $version_modules[] = $module_name;
  67. }
  68. }
  69. }
  70. foreach ($uni_modules_new as $uni_module_key => $uni_module_val) {
  71. if (empty($uni_module_val)) {
  72. continue;
  73. }
  74. if (empty($version_modules) || !in_array($uni_module_val, $version_modules)) {
  75. pdo_delete('uni_modules', array('uniacid' => $uniacid, 'module_name' => $uni_module_val));
  76. pdo_delete('users_lastuse', array('uniacid' => $uniacid, 'modulename' => $uni_module_val));
  77. unset($uni_modules_new[$uni_module_key]);
  78. }
  79. }
  80. }
  81. $uni_account_modules = table('uni_modules')->getallByUniacid($uniacid);
  82. $uni_account_modules = array_column($uni_account_modules, 'module_name');
  83. $uni_modules_add = array_diff($uni_modules_new, $uni_account_modules);
  84. $uni_modules_delete = array_diff($uni_account_modules, $uni_modules_new);
  85. $users_lastuse_table = table('users_lastuse');
  86. $users_lastuse_table->searchWithUniacid($uniacid);
  87. $uni_modules_default_list = $users_lastuse_table->getall('modulename');
  88. $uni_modules_default_delete = array_diff(array_keys($uni_modules_default_list), $uni_modules_new);
  89. if (!empty($uni_modules_default_delete)) {
  90. foreach ($uni_modules_default_delete as $module_default_delete_name) {
  91. if (empty($module_default_delete_name)) {
  92. continue;
  93. }
  94. pdo_delete('users_lastuse', array('uniacid' => $uniacid, 'modulename' => $module_default_delete_name));
  95. }
  96. }
  97. if (!empty($uni_modules_add)) {
  98. foreach($uni_modules_add as $module_add_name){
  99. $account_modules_data = array('uniacid' => $uniacid, 'module_name' => $module_add_name);
  100. pdo_insert('uni_modules', $account_modules_data);
  101. }
  102. }
  103. if (!empty($uni_modules_delete)) {
  104. foreach ($uni_modules_delete as $mdoule_delete_name) {
  105. pdo_delete('uni_modules', array('uniacid' => $uniacid, 'module_name' => $mdoule_delete_name));
  106. }
  107. }
  108. $modules_rank_table = table('modules_rank');
  109. $modules_rank_list = $modules_rank_table->getModuleListByUidAndUniacid();
  110. $modules_rank_list = array_keys($modules_rank_list);
  111. $modules_rank_add = array_diff($uni_account_modules, $modules_rank_list);
  112. $modules_rank_delete = array_diff($modules_rank_list, $uni_account_modules);
  113. asort($modules_rank_add);
  114. asort($modules_rank_delete);
  115. if (!empty($modules_rank_add)) {
  116. foreach ($modules_rank_add as $uni_account_module_key => $uni_account_module_name) {
  117. $modules_rank_data = array('uid' => $uid, 'uniacid' => $uniacid, 'module_name' => $uni_account_module_name, 'rank' => $uni_account_module_key);
  118. pdo_insert('modules_rank', $modules_rank_data);
  119. }
  120. }
  121. if (!empty($modules_rank_delete)) {
  122. foreach ($modules_rank_delete as $uni_account_module_name) {
  123. $modules_rank_data = array('uid' => $uid, 'uniacid' => $uniacid, 'module_name' => $uni_account_module_name);
  124. pdo_delete('modules_rank', $modules_rank_data);
  125. }
  126. }
  127. return true;
  128. }
  129. function cache_build_account($uniacid = 0) {
  130. $uniacid = intval($uniacid);
  131. if (empty($uniacid)) {
  132. $uniacid_arr = table('account')->getUniAccountList();
  133. foreach($uniacid_arr as $account){
  134. cache_delete(cache_system_key('uniaccount', array('uniacid' => $account['uniacid'])));
  135. cache_delete(cache_system_key('defaultgroupid', array('uniacid' => $account['uniacid'])));
  136. }
  137. } else {
  138. cache_delete(cache_system_key('uniaccount', array('uniacid' => $uniacid)));
  139. cache_delete(cache_system_key('defaultgroupid', array('uniacid' => $uniacid)));
  140. }
  141. return true;
  142. }
  143. function cache_build_memberinfo($uid) {
  144. $uid = intval($uid);
  145. cache_delete(cache_system_key('memberinfo', array('uid' => $uid)));
  146. return true;
  147. }
  148. function cache_build_users_struct() {
  149. $base_fields = array(
  150. 'uniacid' => '同一公众号id',
  151. 'groupid' => '分组id',
  152. 'credit1' => '积分',
  153. 'credit2' => '余额',
  154. 'credit3' => '预留积分类型3',
  155. 'credit4' => '预留积分类型4',
  156. 'credit5' => '预留积分类型5',
  157. 'credit6' => '预留积分类型6',
  158. 'createtime' => '加入时间',
  159. 'mobile' => '手机号码',
  160. 'email' => '电子邮箱',
  161. 'realname' => '真实姓名',
  162. 'nickname' => '昵称',
  163. 'avatar' => '头像',
  164. 'qq' => 'QQ号',
  165. 'gender' => '性别',
  166. 'birth' => '生日',
  167. 'constellation' => '星座',
  168. 'zodiac' => '生肖',
  169. 'telephone' => '固定电话',
  170. 'idcard' => '证件号码',
  171. 'studentid' => '学号',
  172. 'grade' => '班级',
  173. 'address' => '地址',
  174. 'zipcode' => '邮编',
  175. 'nationality' => '国籍',
  176. 'reside' => '居住地',
  177. 'graduateschool' => '毕业学校',
  178. 'company' => '公司',
  179. 'education' => '学历',
  180. 'occupation' => '职业',
  181. 'position' => '职位',
  182. 'revenue' => '年收入',
  183. 'affectivestatus' => '情感状态',
  184. 'lookingfor' => ' 交友目的',
  185. 'bloodtype' => '血型',
  186. 'height' => '身高',
  187. 'weight' => '体重',
  188. 'alipay' => '支付宝帐号',
  189. 'msn' => 'MSN',
  190. 'taobao' => '阿里旺旺',
  191. 'site' => '主页',
  192. 'bio' => '自我介绍',
  193. 'interest' => '兴趣爱好',
  194. 'password' => '密码',
  195. 'pay_password' => '支付密码',
  196. );
  197. cache_write(cache_system_key('userbasefields'), $base_fields);
  198. $fields = table('core_profile_fields')->getall('field');
  199. if (!empty($fields)) {
  200. foreach ($fields as &$field) {
  201. $field = $field['title'];
  202. }
  203. $fields['uniacid'] = '同一公众号id';
  204. $fields['groupid'] = '分组id';
  205. $fields['credit1'] ='积分';
  206. $fields['credit2'] = '余额';
  207. $fields['credit3'] = '预留积分类型3';
  208. $fields['credit4'] = '预留积分类型4';
  209. $fields['credit5'] = '预留积分类型5';
  210. $fields['credit6'] = '预留积分类型6';
  211. $fields['createtime'] = '加入时间';
  212. $fields['password'] = '用户密码';
  213. $fields['pay_password'] = '支付密码';
  214. cache_write(cache_system_key('usersfields'), $fields);
  215. } else {
  216. cache_write(cache_system_key('usersfields'), $base_fields);
  217. }
  218. }
  219. function cache_build_frame_menu() {
  220. global $_W;
  221. load()->model('system');
  222. $table_name = table('menu');
  223. $system_menu_db = $table_name->getCoreMenuFillPermissionName();
  224. $account = pdo_get('account', array('uniacid' => $_W['uniacid']));
  225. $system_menu = system_menu();
  226. if (!empty($system_menu) && is_array($system_menu)) {
  227. $system_displayoder = 1;
  228. foreach ($system_menu as $menu_name => $menu) {
  229. $system_menu[$menu_name]['is_system'] = true;
  230. $system_menu[$menu_name]['is_display'] = !empty($system_menu_db[$menu_name]['is_display']) ? true : ((isset($system_menu[$menu_name]['is_display']) && empty($system_menu[$menu_name]['is_display']) || !empty($system_menu_db[$menu_name])) ? false : true);
  231. $system_menu[$menu_name]['displayorder'] = !empty($system_menu_db[$menu_name]) ? intval($system_menu_db[$menu_name]['displayorder']) : ++$system_displayoder;
  232. if ($_W['role'] == ACCOUNT_MANAGE_NAME_EXPIRED && $menu_name != 'store' && $menu_name != 'system') {
  233. $system_menu[$menu_name]['is_display'] = false;
  234. }
  235. if ($menu_name == 'appmarket') {
  236. $system_menu[$menu_name]['is_display'] = true;
  237. }
  238. foreach ($menu['section'] as $section_name => $section) {
  239. $displayorder = max(count($section['menu']), 1);
  240. if (empty($section['menu'])) {
  241. $section['menu'] = array();
  242. }
  243. $table_name->searchWithGroupName($section_name);
  244. $table_name->coreMenuOrderByDisplayorder('DESC');
  245. $add_menu = $table_name->getCoreMenuList();
  246. if (!empty($add_menu)) {
  247. foreach ($add_menu as $permission_name => $menu) {
  248. $menu['icon'] = !empty($menu['icon']) ? $menu['icon'] : 'wi wi-appsetting';
  249. $section['menu'][$permission_name] = $menu;
  250. }
  251. }
  252. $section_hidden_menu_count = 0;
  253. foreach ($section['menu'] as $permission_name => $sub_menu) {
  254. $sub_menu['permission_name'] = !empty($sub_menu['permission_name']) ? $sub_menu['permission_name'] : $permission_name;
  255. $sub_menu_db = $system_menu_db[$sub_menu['permission_name']];
  256. $is_display = 1;
  257. if (isset($sub_menu_db['is_display']) && empty($sub_menu_db['is_display'])) {
  258. $is_display = 0;
  259. }
  260. if ($is_display && isset($sub_menu['is_display'])) {
  261. if (empty($sub_menu['is_display'])) {
  262. unset($system_menu[$menu_name]['section'][$section_name]['menu'][$permission_name]);
  263. continue;
  264. }
  265. if (is_array($sub_menu['is_display']) && !in_array($account['type'], $sub_menu['is_display'])) {
  266. $is_display = 0;
  267. }
  268. }
  269. $system_menu[$menu_name]['section'][$section_name]['menu'][$permission_name] = array(
  270. 'is_system' => isset($sub_menu['is_system']) ? $sub_menu['is_system'] : 1,
  271. 'permission_display' => $sub_menu['is_display'],
  272. 'is_display' => $is_display,
  273. 'title' => !empty($sub_menu_db['title']) ? $sub_menu_db['title'] : $sub_menu['title'],
  274. 'url' => $sub_menu['url'],
  275. 'permission_name' => $sub_menu['permission_name'],
  276. 'icon' => $sub_menu['icon'],
  277. 'displayorder' => !empty($sub_menu_db['displayorder']) ? $sub_menu_db['displayorder'] : $displayorder,
  278. 'id' => $sub_menu['id'],
  279. 'sub_permission' => $sub_menu['sub_permission'],
  280. );
  281. $displayorder--;
  282. $displayorder = max($displayorder, 0);
  283. if (empty($system_menu[$menu_name]['section'][$section_name]['menu'][$permission_name]['is_display'])) {
  284. $section_hidden_menu_count++;
  285. }
  286. }
  287. if (empty($section['is_display']) && $section_hidden_menu_count == count($section['menu']) && $section_name != 'platform_module') {
  288. $system_menu[$menu_name]['section'][$section_name]['is_display'] = 0;
  289. }
  290. $system_menu[$menu_name]['section'][$section_name]['menu'] = iarray_sort($system_menu[$menu_name]['section'][$section_name]['menu'], 'displayorder', 'desc');
  291. }
  292. }
  293. $add_top_nav = $table_name->searchWithGroupName('frame')->getTopMenu();
  294. if (!empty($add_top_nav)) {
  295. foreach ($add_top_nav as $menu) {
  296. $system_menu[$menu['permission_name']] = $menu;
  297. if (!empty($menu['url'])) {
  298. $system_menu[$menu['permission_name']]['url'] = strexists($menu['url'], 'http') ? $menu['url'] : $_W['siteroot'] . $menu['url'];
  299. }
  300. $menu['blank'] = true;
  301. $system_menu[$menu['permission_name']]['is_display'] = $menu['is_display'] == 0 ? false : true;
  302. }
  303. }
  304. $system_menu = iarray_sort($system_menu, 'displayorder', 'asc');
  305. cache_delete(cache_system_key('system_frame', array('uniacid' => $_W['uniacid'])));
  306. cache_write(cache_system_key('system_frame', array('uniacid' => $_W['uniacid'])), $system_menu);
  307. return $system_menu;
  308. }
  309. }
  310. function cache_build_module_subscribe_type() {
  311. global $_W;
  312. $modules = table('modules')->getByHasSubscribes();
  313. if (empty($modules)) {
  314. return array();
  315. }
  316. $subscribe = array();
  317. foreach ($modules as $module) {
  318. $module['subscribes'] = iunserializer($module['subscribes']);
  319. if (!empty($module['subscribes'])) {
  320. foreach ($module['subscribes'] as $event) {
  321. if ($event == 'text') {
  322. continue;
  323. }
  324. $subscribe[$event][] = $module['name'];
  325. }
  326. }
  327. }
  328. $module_ban = $_W['setting']['module_receive_ban'];
  329. foreach ($subscribe as $event => $module_group) {
  330. if (!empty($module_group)) {
  331. foreach ($module_group as $index => $module) {
  332. if (!empty($module_ban[$module])) {
  333. unset($subscribe[$event][$index]);
  334. }
  335. }
  336. }
  337. }
  338. cache_write(cache_system_key('module_receive_enable'), $subscribe);
  339. return $subscribe;
  340. }
  341. function cache_build_cloud_ad() {
  342. global $_W;
  343. $uniacid_arr = table('account')->getUniAccountList();
  344. foreach($uniacid_arr as $account){
  345. cache_delete(cache_system_key('stat_todaylock', array('uniacid' => $account['uniacid'])));
  346. cache_delete(cache_system_key('cloud_ad_uniaccount', array('uniacid' => $account['uniacid'])));
  347. cache_delete(cache_system_key('cloud_ad_app_list', array('uniacid' => $account['uniacid'])));
  348. }
  349. cache_delete(cache_system_key('cloud_flow_master'));
  350. cache_delete(cache_system_key('cloud_ad_uniaccount_list'));
  351. cache_delete(cache_system_key('cloud_ad_tags'));
  352. cache_delete(cache_system_key('cloud_ad_type_list'));
  353. cache_delete(cache_system_key('cloud_ad_app_support_list'));
  354. cache_delete(cache_system_key('cloud_ad_site_finance'));
  355. }
  356. function cache_build_uninstalled_module() {
  357. $modulelist = table('modules')->getall('name');
  358. $module_root = IA_ROOT . '/addons/';
  359. $module_path_list = glob($module_root . '/*');
  360. if (empty($module_path_list)) {
  361. return true;
  362. }
  363. $module_support_type = module_support_type();
  364. foreach ($module_path_list as $path) {
  365. $modulename = pathinfo($path, PATHINFO_BASENAME);
  366. $module_recycle_info = table('modules_recycle')->searchWithNameType($modulename, MODULE_RECYCLE_UNINSTALL_IGNORE)->get();
  367. if (!empty($modulelist[$modulename])) {
  368. $module_cloud_upgrade = table('modules_cloud')->getByName($modulename);
  369. if (!empty($module_cloud_upgrade)) {
  370. $has_new_support = false;
  371. $installed_support = array();
  372. foreach (module_support_type() as $support => $value) {
  373. if (!empty($module_recycle_info) && $module_recycle_info[$support] == 1) {
  374. $installed_support[$support] = $value['not_support'];
  375. }
  376. if ($module_cloud_upgrade[$support] == $value['support'] && $modulelist[$modulename][$support] != $value['support']) {
  377. if ($has_new_support == false) {
  378. $has_new_support = true;
  379. }
  380. } else {
  381. $installed_support[$support] = $value['not_support'];
  382. }
  383. }
  384. if (empty($has_new_support)) {
  385. //table('modules_cloud')->deleteByName($modulename);
  386. } else {
  387. $installed_support['install_status'] = MODULE_CLOUD_UNINSTALL;
  388. table('modules_cloud')->fill($installed_support)->where('id', $module_cloud_upgrade['id'])->save();
  389. }
  390. }
  391. }
  392. if (!is_dir($path) || !file_exists($path . '/manifest.xml')) {
  393. continue;
  394. }
  395. $manifest = ext_module_manifest($modulename);
  396. $module_upgrade_data = array(
  397. 'name' => $modulename,
  398. 'has_new_version' => 0,
  399. 'has_new_branch' => 0,
  400. 'install_status' => MODULE_LOCAL_UNINSTALL,
  401. 'logo' => $manifest['application']['logo'],
  402. 'version' => $manifest['application']['version'],
  403. 'title' => $manifest['application']['name'],
  404. 'title_initial' => get_first_pinyin($manifest['application']['name']),
  405. );
  406. if (!empty($manifest['platform']['supports'])) {
  407. foreach (array('app', 'wxapp', 'webapp', 'android', 'ios', 'system_welcome', 'xzapp', 'aliapp', 'baiduapp', 'toutiaoapp') as $support) {
  408. if (in_array($support, $manifest['platform']['supports'])) {
  409. if ($support == 'app') {
  410. $support = 'account';
  411. }
  412. if ($support == 'system_welcome') {
  413. $support = 'welcome';
  414. }
  415. if ($support == 'android' || $support == 'ios') {
  416. $support = 'phoneapp';
  417. }
  418. $module_upgrade_data["{$support}_support"] = MODULE_SUPPORT_ACCOUNT;
  419. }
  420. }
  421. }
  422. if (!empty($modulelist[$modulename])) {
  423. $new_support = module_check_notinstalled_support($modulelist[$modulename], $manifest['platform']['supports']);
  424. if (!empty($new_support)) {
  425. $module_upgrade_data = array_merge($module_upgrade_data, $new_support);
  426. } else {
  427. //table('modules_cloud')->deleteByName($modulename);
  428. continue;
  429. }
  430. }
  431. if (!empty($module_recycle_info)) {
  432. foreach ($module_support_type as $support => $value) {
  433. if ($module_recycle_info[$support] == 1) {
  434. $module_upgrade_data[$support] = $value['not_support'];
  435. }
  436. }
  437. }
  438. $module_cloud_upgrade = table('modules_cloud')->getByName($modulename);
  439. if (empty($module_cloud_upgrade)) {
  440. table('modules_cloud')->fill($module_upgrade_data)->save();
  441. } else {
  442. table('modules_cloud')->fill($module_upgrade_data)->where('name', $modulename)->save();
  443. }
  444. }
  445. return true;
  446. }
  447. function cache_build_proxy_wechatpay_account() {
  448. global $_W;
  449. load()->model('account');
  450. $account_table = table('account');
  451. if (user_is_founder($_W['uid'], true)) {
  452. $uniaccounts = pdo_getall('account', array('type IN ' => array(ACCOUNT_TYPE_OFFCIAL_NORMAL, ACCOUNT_TYPE_OFFCIAL_AUTH)));
  453. } else {
  454. $uniaccounts = $account_table->userOwnedAccount($_W['uid']);
  455. }
  456. $service = array();
  457. $borrow = array();
  458. if (!empty($uniaccounts)) {
  459. foreach ($uniaccounts as $uniaccount) {
  460. if (!in_array($uniaccount['type'], array(ACCOUNT_TYPE_OFFCIAL_NORMAL, ACCOUNT_TYPE_OFFCIAL_AUTH))) {
  461. continue;
  462. }
  463. $account = uni_fetch($uniaccount['uniacid']);
  464. $payment = (array)$account['setting']['payment'];
  465. if (!empty($account['key']) && !empty($account['secret']) && in_array($account['level'], array (4)) &&
  466. is_array($payment) && !empty($payment) && intval($payment['wechat']['switch']) == 1) {
  467. if ((!is_bool ($payment['wechat']['switch']) && $payment['wechat']['switch'] != 4) || (is_bool ($payment['wechat']['switch']) && !empty($payment['wechat']['switch']))) {
  468. $borrow[$account['uniacid']] = $account['name'];
  469. }
  470. }
  471. if (!empty($payment['wechat_facilitator']['switch'])) {
  472. $service[$account['uniacid']] = $account['name'];
  473. }
  474. }
  475. }
  476. $cache = array(
  477. 'service' => $service,
  478. 'borrow' => $borrow
  479. );
  480. cache_write(cache_system_key('proxy_wechatpay_account'), $cache);
  481. return $cache;
  482. }
  483. function cache_build_module_info($module_name) {
  484. global $_W;
  485. table('modules_cloud')->deleteByName($module_name);
  486. cache_delete(cache_system_key('module_info', array('module_name' => $module_name)));
  487. }
  488. function cache_build_uni_group() {
  489. cache_delete(cache_system_key('uni_groups'));
  490. }
  491. function cache_updatecache() {
  492. $account_ticket_cache = cache_read(cache_system_key('account_ticket'));
  493. pdo_delete('core_cache');
  494. cache_clean();
  495. cache_write(cache_system_key('account_ticket'), $account_ticket_cache);
  496. setting_save(array(), 'cloudip');
  497. cache_build_template();
  498. cache_build_users_struct();
  499. cache_build_setting();
  500. cache_build_module_subscribe_type();
  501. rmdirs(IA_ROOT . '/data/patch/');
  502. rmdirs(IA_ROOT . '/data/tpl/web/');
  503. rmdirs(IA_ROOT . '/data/tpl/app/');
  504. pdo_delete('modules_cloud');
  505. return true;
  506. }