人人商城

install.php 54KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043
  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. error_reporting(E_ALL ^ E_NOTICE);
  7. @set_time_limit(0);
  8. ob_start();
  9. define('IA_ROOT', str_replace("\\",'/', dirname(__FILE__)));
  10. define('APP_URL', 'http://v2.addons.we7.cc/web/');
  11. define('APP_STORE_URL', 'http://v2.addons.we7.cc/web');
  12. define('APP_STORE_API', 'http://v2.addons.we7.cc/api.php');
  13. if($_GET['res']) {
  14. $res = $_GET['res'];
  15. $reses = tpl_resources();
  16. if(array_key_exists($res, $reses)) {
  17. if($res == 'css') {
  18. header('content-type:text/css');
  19. } else {
  20. header('content-type:image/png');
  21. }
  22. echo base64_decode($reses[$res]);
  23. exit();
  24. }
  25. }
  26. $actions = array('license', 'env', 'db', 'finish');
  27. $action = $_COOKIE['action'];
  28. $action = in_array($action, $actions) ? $action : 'license';
  29. $ispost = strtolower($_SERVER['REQUEST_METHOD']) == 'post';
  30. if(file_exists(IA_ROOT . '/data/install.lock') && $action != 'finish') {
  31. header('location: ./index.php');
  32. exit;
  33. }
  34. header('content-type: text/html; charset=utf-8');
  35. if($action == 'license') {
  36. if($ispost) {
  37. setcookie('action', 'env');
  38. header('location: ?refresh');
  39. exit;
  40. }
  41. tpl_install_license();
  42. }
  43. if($action == 'env') {
  44. if($ispost) {
  45. setcookie('action', $_POST['do'] == 'continue' ? 'db' : 'license');
  46. header('location: ?refresh');
  47. exit;
  48. }
  49. $ret = array();
  50. $ret['server']['os']['value'] = php_uname();
  51. if(PHP_SHLIB_SUFFIX == 'dll') {
  52. $ret['server']['os']['remark'] = '建议使用 Linux 系统以提升程序性能';
  53. $ret['server']['os']['class'] = 'warning';
  54. }
  55. $ret['server']['sapi']['value'] = $_SERVER['SERVER_SOFTWARE'];
  56. if(PHP_SAPI == 'isapi') {
  57. $ret['server']['sapi']['remark'] = '建议使用 Apache 或 Nginx 以提升程序性能';
  58. $ret['server']['sapi']['class'] = 'warning';
  59. }
  60. $ret['server']['php']['value'] = PHP_VERSION;
  61. $ret['server']['dir']['value'] = IA_ROOT;
  62. if(function_exists('disk_free_space')) {
  63. $ret['server']['disk']['value'] = floor(disk_free_space(IA_ROOT) / (1024*1024)).'M';
  64. } else {
  65. $ret['server']['disk']['value'] = 'unknow';
  66. }
  67. $ret['server']['upload']['value'] = @ini_get('file_uploads') ? ini_get('upload_max_filesize') : 'unknow';
  68. $ret['php']['version']['value'] = PHP_VERSION;
  69. $ret['php']['version']['class'] = 'success';
  70. if(version_compare(PHP_VERSION, '5.3.0') == -1) {
  71. $ret['php']['version']['class'] = 'danger';
  72. $ret['php']['version']['failed'] = true;
  73. $ret['php']['version']['remark'] = 'PHP版本必须为 5.3.0 以上. <a href="http://bbs.we7.cc/forum.php?mod=redirect&goto=findpost&ptid=3564&pid=58062">详情</a>';
  74. }
  75. $ret['php']['pdo']['ok'] = extension_loaded('pdo') && extension_loaded('pdo_mysql');
  76. if($ret['php']['pdo']['ok']) {
  77. $ret['php']['pdo']['value'] = '<span class="glyphicon glyphicon-ok text-success"></span>';
  78. $ret['php']['pdo']['class'] = 'success';
  79. } else {
  80. $ret['php']['pdo']['failed'] = true;
  81. $ret['php']['pdo']['value'] = '<span class="glyphicon glyphicon-remove text-warning"></span>';
  82. $ret['php']['pdo']['class'] = 'warning';
  83. $ret['php']['pdo']['remark'] = '您的PHP环境不支持PDO, 请开启此扩展. <a target="_blank" href="http://bbs.we7.cc/forum.php?mod=redirect&goto=findpost&ptid=3564&pid=58074">详情</a>';
  84. }
  85. $ret['php']['fopen']['ok'] = @ini_get('allow_url_fopen') && function_exists('fsockopen');
  86. if($ret['php']['fopen']['ok']) {
  87. $ret['php']['fopen']['value'] = '<span class="glyphicon glyphicon-ok text-success"></span>';
  88. } else {
  89. $ret['php']['fopen']['value'] = '<span class="glyphicon glyphicon-remove text-danger"></span>';
  90. }
  91. $ret['php']['curl']['ok'] = extension_loaded('curl') && function_exists('curl_init');
  92. if($ret['php']['curl']['ok']) {
  93. $ret['php']['curl']['value'] = '<span class="glyphicon glyphicon-ok text-success"></span>';
  94. $ret['php']['curl']['class'] = 'success';
  95. } else {
  96. $ret['php']['curl']['value'] = '<span class="glyphicon glyphicon-remove text-danger"></span>';
  97. $ret['php']['curl']['class'] = 'danger';
  98. $ret['php']['curl']['remark'] = '您的PHP环境不支持cURL, 也不支持 allow_url_fopen, 系统无法正常运行. <a target="_blank" href="http://bbs.we7.cc/forum.php?mod=redirect&goto=findpost&ptid=3564&pid=58086">详情</a>';
  99. $ret['php']['curl']['failed'] = true;
  100. }
  101. $ret['php']['ssl']['ok'] = extension_loaded('openssl');
  102. if($ret['php']['ssl']['ok']) {
  103. $ret['php']['ssl']['value'] = '<span class="glyphicon glyphicon-ok text-success"></span>';
  104. $ret['php']['ssl']['class'] = 'success';
  105. } else {
  106. $ret['php']['ssl']['value'] = '<span class="glyphicon glyphicon-remove text-danger"></span>';
  107. $ret['php']['ssl']['class'] = 'danger';
  108. $ret['php']['ssl']['failed'] = true;
  109. $ret['php']['ssl']['remark'] = '没有启用OpenSSL, 将无法访问公众平台的接口, 系统无法正常运行. <a target="_blank" href="http://bbs.we7.cc/forum.php?mod=redirect&goto=findpost&ptid=3564&pid=58109">详情</a>';
  110. }
  111. $ret['php']['gd']['ok'] = extension_loaded('gd');
  112. if($ret['php']['gd']['ok']) {
  113. $ret['php']['gd']['value'] = '<span class="glyphicon glyphicon-ok text-success"></span>';
  114. $ret['php']['gd']['class'] = 'success';
  115. } else {
  116. $ret['php']['gd']['value'] = '<span class="glyphicon glyphicon-remove text-danger"></span>';
  117. $ret['php']['gd']['class'] = 'danger';
  118. $ret['php']['gd']['failed'] = true;
  119. $ret['php']['gd']['remark'] = '没有启用GD, 将无法正常上传和压缩图片, 系统无法正常运行. <a target="_blank" href="http://bbs.we7.cc/forum.php?mod=redirect&goto=findpost&ptid=3564&pid=58110">详情</a>';
  120. }
  121. $ret['php']['dom']['ok'] = class_exists('DOMDocument');
  122. if($ret['php']['dom']['ok']) {
  123. $ret['php']['dom']['value'] = '<span class="glyphicon glyphicon-ok text-success"></span>';
  124. $ret['php']['dom']['class'] = 'success';
  125. } else {
  126. $ret['php']['dom']['value'] = '<span class="glyphicon glyphicon-remove text-danger"></span>';
  127. $ret['php']['dom']['class'] = 'danger';
  128. $ret['php']['dom']['failed'] = true;
  129. $ret['php']['dom']['remark'] = '没有启用DOMDocument, 将无法正常安装使用模块, 系统无法正常运行. <a target="_blank" href="http://bbs.we7.cc/forum.php?mod=redirect&goto=findpost&ptid=3564&pid=58111">详情</a>';
  130. }
  131. $ret['php']['session']['ok'] = ini_get('session.auto_start');
  132. if($ret['php']['session']['ok'] == 0 || strtolower($ret['php']['session']['ok']) == 'off') {
  133. $ret['php']['session']['value'] = '<span class="glyphicon glyphicon-ok text-success"></span>';
  134. $ret['php']['session']['class'] = 'success';
  135. } else {
  136. $ret['php']['session']['value'] = '<span class="glyphicon glyphicon-remove text-danger"></span>';
  137. $ret['php']['session']['class'] = 'danger';
  138. $ret['php']['session']['failed'] = true;
  139. $ret['php']['session']['remark'] = '系统session.auto_start开启, 将无法正常注册会员, 系统无法正常运行. <a target="_blank" href="http://bbs.we7.cc/forum.php?mod=redirect&goto=findpost&ptid=3564&pid=58111">详情</a>';
  140. }
  141. $ret['php']['asp_tags']['ok'] = ini_get('asp_tags');
  142. if(empty($ret['php']['asp_tags']['ok']) || strtolower($ret['php']['asp_tags']['ok']) == 'off') {
  143. $ret['php']['asp_tags']['value'] = '<span class="glyphicon glyphicon-ok text-success"></span>';
  144. $ret['php']['asp_tags']['class'] = 'success';
  145. } else {
  146. $ret['php']['asp_tags']['value'] = '<span class="glyphicon glyphicon-remove text-danger"></span>';
  147. $ret['php']['asp_tags']['class'] = 'danger';
  148. $ret['php']['asp_tags']['failed'] = true;
  149. $ret['php']['asp_tags']['remark'] = '请禁用可以使用ASP 风格的标志,配置php.ini中asp_tags = Off';
  150. }
  151. $ret['write']['root']['ok'] = local_writeable(IA_ROOT . '/');
  152. if($ret['write']['root']['ok']) {
  153. $ret['write']['root']['value'] = '<span class="glyphicon glyphicon-ok text-success"></span>';
  154. $ret['write']['root']['class'] = 'success';
  155. } else {
  156. $ret['write']['root']['value'] = '<span class="glyphicon glyphicon-remove text-danger"></span>';
  157. $ret['write']['root']['class'] = 'danger';
  158. $ret['write']['root']['failed'] = true;
  159. $ret['write']['root']['remark'] = '本地目录无法写入, 将无法使用自动更新功能, 系统无法正常运行. <a href="http://bbs.we7.cc/">详情</a>';
  160. }
  161. $ret['write']['data']['ok'] = local_writeable(IA_ROOT . '/data');
  162. if($ret['write']['data']['ok']) {
  163. $ret['write']['data']['value'] = '<span class="glyphicon glyphicon-ok text-success"></span>';
  164. $ret['write']['data']['class'] = 'success';
  165. } else {
  166. $ret['write']['data']['value'] = '<span class="glyphicon glyphicon-remove text-danger"></span>';
  167. $ret['write']['data']['class'] = 'danger';
  168. $ret['write']['data']['failed'] = true;
  169. $ret['write']['data']['remark'] = 'data目录无法写入, 将无法写入配置文件, 系统无法正常安装. ';
  170. }
  171. $ret['continue'] = true;
  172. foreach($ret['php'] as $opt) {
  173. if($opt['failed']) {
  174. $ret['continue'] = false;
  175. break;
  176. }
  177. }
  178. if($ret['write']['failed']) {
  179. $ret['continue'] = false;
  180. }
  181. tpl_install_env($ret);
  182. }
  183. if($action == 'db') {
  184. if($ispost) {
  185. if($_POST['do'] != 'continue') {
  186. setcookie('action', 'env');
  187. header('location: ?refresh');
  188. exit();
  189. }
  190. $family = $_POST['family'] == 'x' ? 'x' : 'v';
  191. $db = $_POST['db'];
  192. $user = $_POST['user'];
  193. try {
  194. $pieces = explode(':', $db['server']);
  195. $db['server'] = $pieces[0];
  196. $db['port'] = !empty($pieces[1]) ? $pieces[1] : '3306';
  197. $link = new PDO("mysql:host={$db['server']};port={$db['port']}", $db['username'], $db['password']); // dns可以没有dbname
  198. $link->exec("SET character_set_connection=utf8, character_set_results=utf8, character_set_client=binary");
  199. $link->exec("SET sql_mode=''");
  200. if ($link->errorCode() != '00000') {
  201. $errorInfo = $link->errorInfo();
  202. $error = $errorInfo[2];
  203. } else {
  204. $statement = $link->query("SHOW DATABASES LIKE '{$db['name']}';");
  205. $fetch = $statement->fetch();
  206. if (empty($fetch)){
  207. if (substr($link->getAttribute(PDO::ATTR_SERVER_VERSION), 0, 3) > '4.1') {
  208. $link->query("CREATE DATABASE IF NOT EXISTS `{$db['name']}` DEFAULT CHARACTER SET utf8");
  209. } else {
  210. $link->query("CREATE DATABASE IF NOT EXISTS `{$db['name']}`");
  211. }
  212. }
  213. $statement = $link->query("SHOW DATABASES LIKE '{$db['name']}';");
  214. $fetch = $statement->fetch();
  215. if (empty($fetch)) {
  216. $error .= "数据库不存在且创建数据库失败. <br />";
  217. }
  218. if ($link->errorCode() != '00000') {
  219. $errorInfo = $link->errorInfo();
  220. $error .= $errorInfo[2];
  221. }
  222. }
  223. } catch (PDOException $e) {
  224. $error = $e->getMessage();
  225. if (strpos($error, 'Access denied for user') !== false) {
  226. $error = '您的数据库访问用户名或是密码错误. <br />';
  227. } else {
  228. $error = iconv('gbk', 'utf8', $error);
  229. }
  230. }
  231. if(empty($error)) {
  232. $link->exec("USE {$db['name']}");
  233. $statement = $link->query("SHOW TABLES LIKE '{$db['prefix']}%';");
  234. if ($statement->fetch()) {
  235. $error = '您的数据库不为空,请重新建立数据库或是清空该数据库或更改表前缀!';
  236. }
  237. }
  238. if(empty($error)) {
  239. $config = local_config();
  240. $cookiepre = local_salt(4) . '_';
  241. $authkey = local_salt(8);
  242. $config = str_replace(array(
  243. '{db-server}', '{db-username}', '{db-password}', '{db-port}', '{db-name}', '{db-tablepre}', '{cookiepre}', '{authkey}', '{attachdir}'
  244. ), array(
  245. $db['server'], $db['username'], $db['password'], $db['port'], $db['name'], $db['prefix'], $cookiepre, $authkey, 'attachment'
  246. ), $config);
  247. $verfile = IA_ROOT . '/framework/version.inc.php';
  248. $dbfile = IA_ROOT . '/data/db.php';
  249. if($_POST['type'] == 'remote') {
  250. $link = NULL;
  251. $ins = remote_install();
  252. if(empty($ins)) {
  253. die('<script type="text/javascript">alert("连接不到服务器, 请稍后重试!");history.back();</script>');
  254. }
  255. if($ins == 'error') {
  256. die('<script type="text/javascript">alert("版本错误,请确认是否为微擎最新版安装文件!");history.back();</script>');
  257. }
  258. $link = new PDO("mysql:dbname={$db['name']};host={$db['server']};port={$db['port']}", $db['username'], $db['password']);
  259. $link->exec("SET character_set_connection=utf8, character_set_results=utf8, character_set_client=binary");
  260. $link->exec("SET sql_mode=''");
  261. $tmpfile = IA_ROOT . '/we7source.tmp';
  262. file_put_contents($tmpfile, $ins);
  263. $zip = new ZipArchive;
  264. $res = $zip->open($tmpfile);
  265. if ($res === TRUE) {
  266. $zip->extractTo(IA_ROOT);
  267. $zip->close();
  268. } else {
  269. die('<script type="text/javascript">alert("安装失败,请确认当前目录是否有写入权限!");history.back();</script>');
  270. }
  271. unlink($tmpfile);
  272. }
  273. if(file_exists(IA_ROOT . '/index.php') && is_dir(IA_ROOT . '/web') && file_exists($verfile) && file_exists($dbfile)) {
  274. $dat = require $dbfile;
  275. if(empty($dat) || !is_array($dat)) {
  276. die('<script type="text/javascript">alert("安装包不正确, 数据安装脚本缺失.");history.back();</script>');
  277. }
  278. foreach($dat['schemas'] as $schema) {
  279. $sql = local_create_sql($schema);
  280. local_run($sql);
  281. }
  282. foreach($dat['datas'] as $data) {
  283. local_run($data);
  284. }
  285. } else {
  286. die('<script type="text/javascript">alert("你正在使用本地安装, 但未下载完整安装包, 请从微擎官网下载完整安装包后重试.");history.back();</script>');
  287. }
  288. $salt = local_salt(8);
  289. $password = sha1("{$user['password']}-{$salt}-{$authkey}");
  290. $link->exec("INSERT INTO {$db['prefix']}users (username, password, salt, joindate, groupid) VALUES('{$user['username']}', '{$password}', '{$salt}', '" . time() . "', 1)");
  291. local_mkdirs(IA_ROOT . '/data');
  292. file_put_contents(IA_ROOT . '/data/config.php', $config);
  293. touch(IA_ROOT . '/data/install.lock');
  294. setcookie('action', 'finish');
  295. header('location: ?refresh');
  296. exit();
  297. }
  298. }
  299. tpl_install_db($error);
  300. }
  301. if($action == 'finish') {
  302. setcookie('action', '', -10);
  303. $dbfile = IA_ROOT . '/data/db.php';
  304. @unlink($dbfile);
  305. define('IN_SYS', true);
  306. require IA_ROOT . '/framework/bootstrap.inc.php';
  307. require IA_ROOT . '/web/common/bootstrap.sys.inc.php';
  308. $_W['uid'] = $_W['isfounder'] = 1;
  309. load()->web('common');
  310. load()->web('template');
  311. load()->model('setting');
  312. load()->model('cache');
  313. cache_build_frame_menu();
  314. cache_build_setting();
  315. cache_build_users_struct();
  316. cache_build_module_subscribe_type();
  317. tpl_install_finish();
  318. }
  319. function local_writeable($dir) {
  320. $writeable = 0;
  321. if(!is_dir($dir)) {
  322. @mkdir($dir, 0777);
  323. }
  324. if(is_dir($dir)) {
  325. if($fp = fopen("$dir/test.txt", 'w')) {
  326. fclose($fp);
  327. unlink("$dir/test.txt");
  328. $writeable = 1;
  329. } else {
  330. $writeable = 0;
  331. }
  332. }
  333. return $writeable;
  334. }
  335. function local_salt($length = 8) {
  336. $result = '';
  337. while(strlen($result) < $length) {
  338. $result .= sha1(uniqid('', true));
  339. }
  340. return substr($result, 0, $length);
  341. }
  342. function local_config() {
  343. $cfg = <<<EOF
  344. <?php
  345. defined('IN_IA') or exit('Access Denied');
  346. \$config = array();
  347. \$config['db']['master']['host'] = '{db-server}';
  348. \$config['db']['master']['username'] = '{db-username}';
  349. \$config['db']['master']['password'] = '{db-password}';
  350. \$config['db']['master']['port'] = '{db-port}';
  351. \$config['db']['master']['database'] = '{db-name}';
  352. \$config['db']['master']['charset'] = 'utf8';
  353. \$config['db']['master']['pconnect'] = 0;
  354. \$config['db']['master']['tablepre'] = '{db-tablepre}';
  355. \$config['db']['slave_status'] = false;
  356. \$config['db']['slave']['1']['host'] = '';
  357. \$config['db']['slave']['1']['username'] = '';
  358. \$config['db']['slave']['1']['password'] = '';
  359. \$config['db']['slave']['1']['port'] = '3307';
  360. \$config['db']['slave']['1']['database'] = '';
  361. \$config['db']['slave']['1']['charset'] = 'utf8';
  362. \$config['db']['slave']['1']['pconnect'] = 0;
  363. \$config['db']['slave']['1']['tablepre'] = 'ims_';
  364. \$config['db']['slave']['1']['weight'] = 0;
  365. \$config['db']['common']['slave_except_table'] = array('core_sessions');
  366. // -------------------------- CONFIG COOKIE --------------------------- //
  367. \$config['cookie']['pre'] = '{cookiepre}';
  368. \$config['cookie']['domain'] = '';
  369. \$config['cookie']['path'] = '/';
  370. // -------------------------- CONFIG SETTING --------------------------- //
  371. \$config['setting']['charset'] = 'utf-8';
  372. \$config['setting']['cache'] = 'mysql';
  373. \$config['setting']['timezone'] = 'Asia/Shanghai';
  374. \$config['setting']['memory_limit'] = '256M';
  375. \$config['setting']['filemode'] = 0644;
  376. \$config['setting']['authkey'] = '{authkey}';
  377. \$config['setting']['founder'] = '1';
  378. \$config['setting']['development'] = 0;
  379. \$config['setting']['referrer'] = 0;
  380. // -------------------------- CONFIG UPLOAD --------------------------- //
  381. \$config['upload']['image']['extentions'] = array('gif', 'jpg', 'jpeg', 'png');
  382. \$config['upload']['image']['limit'] = 5000;
  383. \$config['upload']['attachdir'] = '{attachdir}';
  384. \$config['upload']['audio']['extentions'] = array('mp3');
  385. \$config['upload']['audio']['limit'] = 5000;
  386. // -------------------------- CONFIG MEMCACHE --------------------------- //
  387. \$config['setting']['memcache']['server'] = '';
  388. \$config['setting']['memcache']['port'] = 11211;
  389. \$config['setting']['memcache']['pconnect'] = 1;
  390. \$config['setting']['memcache']['timeout'] = 30;
  391. \$config['setting']['memcache']['session'] = 1;
  392. // -------------------------- CONFIG PROXY --------------------------- //
  393. \$config['setting']['proxy']['host'] = '';
  394. \$config['setting']['proxy']['auth'] = '';
  395. EOF;
  396. return trim($cfg);
  397. }
  398. function local_mkdirs($path) {
  399. if(!is_dir($path)) {
  400. local_mkdirs(dirname($path));
  401. mkdir($path);
  402. }
  403. return is_dir($path);
  404. }
  405. function local_run($sql) {
  406. global $link, $db;
  407. if(!isset($sql) || empty($sql)) return;
  408. $sql = str_replace("\r", "\n", str_replace(' ims_', ' '.$db['prefix'], $sql));
  409. $sql = str_replace("\r", "\n", str_replace(' `ims_', ' `'.$db['prefix'], $sql));
  410. $ret = array();
  411. $num = 0;
  412. foreach(explode(";\n", trim($sql)) as $query) {
  413. $ret[$num] = '';
  414. $queries = explode("\n", trim($query));
  415. foreach($queries as $query) {
  416. $ret[$num] .= (isset($query[0]) && $query[0] == '#') || (isset($query[1]) && isset($query[1]) && $query[0].$query[1] == '--') ? '' : $query;
  417. }
  418. $num++;
  419. }
  420. unset($sql);
  421. foreach($ret as $query) {
  422. $query = trim($query);
  423. if($query) {
  424. $link->exec($query);
  425. if($link->errorCode() != '00000') {
  426. $errorInfo = $link->errorInfo();
  427. echo $errorInfo[0] . ": " . $errorInfo[2] . "<br />";
  428. exit($query);
  429. }
  430. }
  431. }
  432. }
  433. function local_create_sql($schema) {
  434. $pieces = explode('_', $schema['charset']);
  435. $charset = $pieces[0];
  436. $engine = $schema['engine'];
  437. $sql = "CREATE TABLE IF NOT EXISTS `{$schema['tablename']}` (\n";
  438. foreach ($schema['fields'] as $value) {
  439. if(!empty($value['length'])) {
  440. $length = "({$value['length']})";
  441. } else {
  442. $length = '';
  443. }
  444. $signed = empty($value['signed']) ? ' unsigned' : '';
  445. if(empty($value['null'])) {
  446. $null = ' NOT NULL';
  447. } else {
  448. $null = '';
  449. }
  450. if(isset($value['default'])) {
  451. $default = " DEFAULT '" . $value['default'] . "'";
  452. } else {
  453. $default = '';
  454. }
  455. if($value['increment']) {
  456. $increment = ' AUTO_INCREMENT';
  457. } else {
  458. $increment = '';
  459. }
  460. $sql .= "`{$value['name']}` {$value['type']}{$length}{$signed}{$null}{$default}{$increment},\n";
  461. }
  462. foreach ($schema['indexes'] as $value) {
  463. $fields = implode('`,`', $value['fields']);
  464. if($value['type'] == 'index') {
  465. $sql .= "KEY `{$value['name']}` (`{$fields}`),\n";
  466. }
  467. if($value['type'] == 'unique') {
  468. $sql .= "UNIQUE KEY `{$value['name']}` (`{$fields}`),\n";
  469. }
  470. if($value['type'] == 'primary') {
  471. $sql .= "PRIMARY KEY (`{$fields}`),\n";
  472. }
  473. }
  474. $sql = rtrim($sql);
  475. $sql = rtrim($sql, ',');
  476. $sql .= "\n) ENGINE=$engine DEFAULT CHARSET=$charset;\n\n";
  477. return $sql;
  478. }
  479. function remote_install() {
  480. global $family;
  481. $token = '';
  482. $pars = array();
  483. $pars['host'] = $_SERVER['http_HOST'];
  484. $pars['version'] = '1.0';
  485. $pars['type'] = 'install';
  486. $pars['method'] = 'application.install';
  487. $url = 'http://v2.addons.we7.cc/gateway.php';
  488. $urlset = parse_url($url);
  489. $cloudip = gethostbyname($urlset['host']);
  490. $headers[] = "Host: {$urlset['host']}";
  491. $ch = curl_init();
  492. curl_setopt($ch, CURLOPT_URL, $urlset['scheme'] . '://' . $cloudip . $urlset['path']);
  493. curl_setopt($ch, CURLOPT_POST, 1);
  494. curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($pars, '', '&'));
  495. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  496. curl_setopt($ch, CURLOPT_httpHEADER, $headers);
  497. $content = curl_exec($ch);
  498. curl_close($ch);
  499. if (empty($content)) {
  500. return showerror(-1, '获取安装信息失败,可能是由于网络不稳定,请重试。');
  501. }
  502. return $content;
  503. }
  504. function tpl_frame() {
  505. global $action, $actions;
  506. $action = $_COOKIE['action'];
  507. $step = array_search($action, $actions);
  508. $steps = array();
  509. for($i = 0; $i <= $step; $i++) {
  510. if($i == $step) {
  511. $steps[$i] = ' list-group-item-info';
  512. } else {
  513. $steps[$i] = ' list-group-item-success';
  514. }
  515. }
  516. $progress = $step * 25 + 25;
  517. $content = ob_get_contents();
  518. ob_clean();
  519. $tpl = <<<EOF
  520. <!DOCTYPE html>
  521. <html lang="zh-cn">
  522. <head>
  523. <meta charset="utf-8">
  524. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  525. <meta name="viewport" content="width=device-width, initial-scale=1">
  526. <title>安装系统 - 微擎 - 公众平台自助开源引擎</title>
  527. <link rel="stylesheet" href="//cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css">
  528. <style>
  529. html,body{font-size:13px;font-family:"Microsoft YaHei UI", "微软雅黑", "宋体";}
  530. .pager li.previous a{margin-right:10px;}
  531. .header a{color:#FFF;}
  532. .header a:hover{color:#428bca;}
  533. .footer{padding:10px;}
  534. .footer a,.footer{color:#eee;font-size:14px;line-height:25px;}
  535. </style>
  536. <!--[if lt IE 9]>
  537. <script src="http://cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
  538. <script src="http://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
  539. <![endif]-->
  540. </head>
  541. <body style="background-color:#28b0e4;">
  542. <div class="container">
  543. <div class="header" style="margin:15px auto;">
  544. <ul class="nav nav-pills pull-right" role="tablist">
  545. <li role="presentation" class="active"><a href="javascript:;">安装微擎系统</a></li>
  546. <li role="presentation"><a href="http://www.we7.cc">微擎官网</a></li>
  547. <li role="presentation"><a href="http://bbs.we7.cc">访问论坛</a></li>
  548. </ul>
  549. <img src="?res=logo" />
  550. </div>
  551. <div class="row well" style="margin:auto 0;">
  552. <div class="col-xs-3">
  553. <div class="progress" title="安装进度">
  554. <div class="progress-bar progress-bar-info progress-bar-striped active" role="progressbar" aria-valuenow="{$progress}" aria-valuemin="0" aria-valuemax="100" style="width: {$progress}%;">
  555. {$progress}%
  556. </div>
  557. </div>
  558. <div class="panel panel-default">
  559. <div class="panel-heading">
  560. 安装步骤
  561. </div>
  562. <ul class="list-group">
  563. <a href="javascript:;" class="list-group-item{$steps[0]}"><span class="glyphicon glyphicon-copyright-mark"></span> &nbsp; 许可协议</a>
  564. <a href="javascript:;" class="list-group-item{$steps[1]}"><span class="glyphicon glyphicon-eye-open"></span> &nbsp; 环境监测</a>
  565. <a href="javascript:;" class="list-group-item{$steps[2]}"><span class="glyphicon glyphicon-cog"></span> &nbsp; 参数配置</a>
  566. <a href="javascript:;" class="list-group-item{$steps[3]}"><span class="glyphicon glyphicon-ok"></span> &nbsp; 成功</a>
  567. </ul>
  568. </div>
  569. </div>
  570. <div class="col-xs-9">
  571. {$content}
  572. </div>
  573. </div>
  574. <div class="footer" style="margin:15px auto;">
  575. <div class="text-center">
  576. <a href="http://www.we7.cc">关于微擎</a> &nbsp; &nbsp; <a href="http://bbs.we7.cc">微擎帮助</a> &nbsp; &nbsp; <a href="http://www.we7.cc">购买授权</a>
  577. </div>
  578. <div class="text-center">
  579. Powered by <a href="http://www.we7.cc"><b>微擎</b></a> v1.82 &copy; 2014 <a href="http://www.we7.cc">www.we7.cc</a>
  580. </div>
  581. </div>
  582. </div>
  583. <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
  584. <script src="//cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js"></script>
  585. </body>
  586. </html>
  587. EOF;
  588. echo trim($tpl);
  589. }
  590. function tpl_install_license() {
  591. echo <<<EOF
  592. <div class="panel panel-default">
  593. <div class="panel-heading">阅读许可协议</div>
  594. <div class="panel-body" style="overflow-y:scroll;max-height:400px;line-height:20px;">
  595. <h3>版权所有 (c)2014,-保留所有权利。 </h3>
  596. <p>
  597. 感谢您选择微擎 - 微信公众平台自助开源引擎(以下简称WE7,WE7基于 PHP + MySQL的技术开发,全部源码开放。 <br />
  598. 为了使你正确并合法的使用本软件,请你在使用前务必阅读清楚下面的协议条款:
  599. </p>
  600. <p>
  601. <strong>一、本授权协议适用且仅适用于微擎系统(We7, MicroEngine. 以下简称微擎)任何版本,微擎官方对本授权协议的最终解释权。</strong>
  602. </p>
  603. <p>
  604. <strong>二、协议许可的权利 </strong>
  605. <ol>
  606. <li>您可以在完全遵守本最终用户授权协议的基础上,将本软件应用于非商业用途,而不必支付软件版权授权费用。</li>
  607. <li>您可以在协议规定的约束和限制范围内修改微擎源代码或界面风格以适应您的网站要求。</li>
  608. <li>您拥有使用本软件构建的网站全部内容所有权,并独立承担与这些内容的相关法律义务。</li>
  609. <li>获得商业授权之后,您可以将本软件应用于商业用途,同时依据所购买的授权类型中确定的技术支持内容,自购买时刻起,在技术支持期限内拥有通过指定的方式获得指定范围内的技术支持服务。商业授权用户享有反映和提出意见的权力,相关意见将被作为首要考虑,但没有一定被采纳的承诺或保证。</li>
  610. </ol>
  611. </p>
  612. <p>
  613. <strong>三、协议规定的约束和限制 </strong>
  614. <ol>
  615. <li>未获商业授权之前,不得将本软件用于商业用途(包括但不限于企业网站、经营性网站、以营利为目的或实现盈利的网站)。</li>
  616. <li>未经官方许可,不得对本软件或与之关联的商业授权进行出租、出售、抵押或发放子许可证。</li>
  617. <li>未经官方许可,禁止在微擎的整体或任何部分基础上以发展任何派生版本、修改版本或第三方版本用于重新分发。</li>
  618. <li>如果您未能遵守本协议的条款,您的授权将被终止,所被许可的权利将被收回,并承担相应法律责任。</li>
  619. </ol>
  620. </p>
  621. <p>
  622. <strong>四、有限担保和免责声明 </strong>
  623. <ol>
  624. <li>本软件及所附带的文件是作为不提供任何明确的或隐含的赔偿或担保的形式提供的。</li>
  625. <li>用户出于自愿而使用本软件,您必须了解使用本软件的风险,在尚未购买产品技术服务之前,我们不承诺对免费用户提供任何形式的技术支持、使用担保,也不承担任何因使用本软件而产生问题的相关责任。</li>
  626. <li>电子文本形式的授权协议如同双方书面签署的协议一样,具有完全的和等同的法律效力。您一旦开始确认本协议并安装 WE7,即被视为完全理解并接受本协议的各项条款,在享有上述条款授予的权力的同时,受到相关的约束和限制。协议许可范围以外的行为,将直接违反本授权协议并构成侵权,我们有权随时终止授权,责令停止损害,并保留追究相关责任的权力。</li>
  627. <li>如果本软件带有其它软件的整合API示范例子包,这些文件版权不属于本软件官方,并且这些文件是没经过授权发布的,请参考相关软件的使用许可合法的使用。</li>
  628. </ol>
  629. </p>
  630. </div>
  631. </div>
  632. <form class="form-inline" role="form" method="post">
  633. <ul class="pager">
  634. <li class="pull-left" style="display:block;padding:5px 10px 5px 0;">
  635. <div class="checkbox">
  636. <label>
  637. <input type="checkbox"> 我已经阅读并同意此协议
  638. </label>
  639. </div>
  640. </li>
  641. <li class="previous"><a href="javascript:;" onclick="if(jQuery(':checkbox:checked').length == 1){jQuery('form')[0].submit();}else{alert('您必须同意软件许可协议才能安装!')};">继续 <span class="glyphicon glyphicon-chevron-right"></span></a></li>
  642. </ul>
  643. </form>
  644. EOF;
  645. tpl_frame();
  646. }
  647. function tpl_install_env($ret = array()) {
  648. if(empty($ret['continue'])) {
  649. $continue = '<li class="previous disabled"><a href="javascript:;">请先解决环境问题后继续</a></li>';
  650. } else {
  651. $continue = '<li class="previous"><a href="javascript:;" onclick="$(\'#do\').val(\'continue\');$(\'form\')[0].submit();">继续 <span class="glyphicon glyphicon-chevron-right"></span></a></li>';
  652. }
  653. echo <<<EOF
  654. <div class="panel panel-default">
  655. <div class="panel-heading">服务器信息</div>
  656. <table class="table table-striped">
  657. <tr>
  658. <th style="width:150px;">参数</th>
  659. <th>值</th>
  660. <th></th>
  661. </tr>
  662. <tr class="{$ret['server']['os']['class']}">
  663. <td>服务器操作系统</td>
  664. <td>{$ret['server']['os']['value']}</td>
  665. <td>{$ret['server']['os']['remark']}</td>
  666. </tr>
  667. <tr class="{$ret['server']['sapi']['class']}">
  668. <td>Web服务器环境</td>
  669. <td>{$ret['server']['sapi']['value']}</td>
  670. <td>{$ret['server']['sapi']['remark']}</td>
  671. </tr>
  672. <tr class="{$ret['server']['php']['class']}">
  673. <td>PHP版本</td>
  674. <td>{$ret['server']['php']['value']}</td>
  675. <td>{$ret['server']['php']['remark']}</td>
  676. </tr>
  677. <tr class="{$ret['server']['dir']['class']}">
  678. <td>程序安装目录</td>
  679. <td>{$ret['server']['dir']['value']}</td>
  680. <td>{$ret['server']['dir']['remark']}</td>
  681. </tr>
  682. <tr class="{$ret['server']['disk']['class']}">
  683. <td>磁盘空间</td>
  684. <td>{$ret['server']['disk']['value']}</td>
  685. <td>{$ret['server']['disk']['remark']}</td>
  686. </tr>
  687. <tr class="{$ret['server']['upload']['class']}">
  688. <td>上传限制</td>
  689. <td>{$ret['server']['upload']['value']}</td>
  690. <td>{$ret['server']['upload']['remark']}</td>
  691. </tr>
  692. </table>
  693. </div>
  694. <div class="alert alert-info">PHP环境要求必须满足下列所有条件,否则系统或系统部份功能将无法使用。</div>
  695. <div class="panel panel-default">
  696. <div class="panel-heading">PHP环境要求</div>
  697. <table class="table table-striped">
  698. <tr>
  699. <th style="width:150px;">选项</th>
  700. <th style="width:180px;">要求</th>
  701. <th style="width:50px;">状态</th>
  702. <th>说明及帮助</th>
  703. </tr>
  704. <tr class="{$ret['php']['version']['class']}">
  705. <td>PHP版本</td>
  706. <td>5.3或者5.3以上</td>
  707. <td>{$ret['php']['version']['value']}</td>
  708. <td>{$ret['php']['version']['remark']}</td>
  709. </tr>
  710. <tr class="{$ret['php']['curl']['class']}">
  711. <td>cURL</td>
  712. <td>支持</td>
  713. <td>{$ret['php']['curl']['value']}</td>
  714. <td>{$ret['php']['curl']['remark']}</td>
  715. </tr>
  716. <tr class="{$ret['php']['pdo']['class']}">
  717. <td>PDO</td>
  718. <td>支持</td>
  719. <td>{$ret['php']['pdo']['value']}</td>
  720. <td>{$ret['php']['pdo']['remark']}</td>
  721. </tr>
  722. <tr class="{$ret['php']['ssl']['class']}">
  723. <td>openSSL</td>
  724. <td>支持</td>
  725. <td>{$ret['php']['ssl']['value']}</td>
  726. <td>{$ret['php']['ssl']['remark']}</td>
  727. </tr>
  728. <tr class="{$ret['php']['gd']['class']}">
  729. <td>GD2</td>
  730. <td>支持</td>
  731. <td>{$ret['php']['gd']['value']}</td>
  732. <td>{$ret['php']['gd']['remark']}</td>
  733. </tr>
  734. <tr class="{$ret['php']['dom']['class']}">
  735. <td>DOM</td>
  736. <td>支持</td>
  737. <td>{$ret['php']['dom']['value']}</td>
  738. <td>{$ret['php']['dom']['remark']}</td>
  739. </tr>
  740. <tr class="{$ret['php']['session']['class']}">
  741. <td>session.auto_start</td>
  742. <td>关闭</td>
  743. <td>{$ret['php']['session']['value']}</td>
  744. <td>{$ret['php']['session']['remark']}</td>
  745. </tr>
  746. <tr class="{$ret['php']['asp_tags']['class']}">
  747. <td>asp_tags</td>
  748. <td>关闭</td>
  749. <td>{$ret['php']['asp_tags']['value']}</td>
  750. <td>{$ret['php']['asp_tags']['remark']}</td>
  751. </tr>
  752. </table>
  753. </div>
  754. <div class="alert alert-info">系统要求微擎整个安装目录必须可写, 才能使用微擎所有功能。</div>
  755. <div class="panel panel-default">
  756. <div class="panel-heading">目录权限监测</div>
  757. <table class="table table-striped">
  758. <tr>
  759. <th style="width:150px;">目录</th>
  760. <th style="width:180px;">要求</th>
  761. <th style="width:50px;">状态</th>
  762. <th>说明及帮助</th>
  763. </tr>
  764. <tr class="{$ret['write']['root']['class']}">
  765. <td>/</td>
  766. <td>整目录可写</td>
  767. <td>{$ret['write']['root']['value']}</td>
  768. <td>{$ret['write']['root']['remark']}</td>
  769. </tr>
  770. <tr class="{$ret['write']['data']['class']}">
  771. <td>/</td>
  772. <td>data目录可写</td>
  773. <td>{$ret['write']['data']['value']}</td>
  774. <td>{$ret['write']['data']['remark']}</td>
  775. </tr>
  776. </table>
  777. </div>
  778. <form class="form-inline" role="form" method="post">
  779. <input type="hidden" name="do" id="do" />
  780. <ul class="pager">
  781. <li class="previous"><a href="javascript:;" onclick="$('#do').val('back');$('form')[0].submit();"><span class="glyphicon glyphicon-chevron-left"></span> 返回</a></li>
  782. {$continue}
  783. </ul>
  784. </form>
  785. EOF;
  786. tpl_frame();
  787. }
  788. function tpl_install_db($error = '') {
  789. if(!empty($error)) {
  790. $message = '<div class="alert alert-danger">发生错误: ' . $error . '</div>';
  791. }
  792. $insTypes = array();
  793. if(file_exists(IA_ROOT . '/index.php') && is_dir(IA_ROOT . '/app') && is_dir(IA_ROOT . '/web')) {
  794. $insTypes['local'] = ' checked="checked"';
  795. } else {
  796. $insTypes['remote'] = ' checked="checked"';
  797. }
  798. if (!empty($_POST['type'])) {
  799. $insTypes = array();
  800. $insTypes[$_POST['type']] = ' checked="checked"';
  801. }
  802. $disabled = empty($insTypes['local']) ? ' disabled="disabled"' : '';
  803. echo <<<EOF
  804. {$message}
  805. <form class="form-horizontal" method="post" role="form">
  806. <div class="panel panel-default">
  807. <div class="panel-heading">安装选项</div>
  808. <div class="panel-body">
  809. <div class="form-group">
  810. <label class="col-sm-2 control-label">安装方式</label>
  811. <div class="col-sm-10">
  812. <label class="radio-inline">
  813. <input type="radio" name="type" value="local"{$insTypes['local']}{$disabled}> 离线安装
  814. </label>
  815. </div>
  816. </div>
  817. </div>
  818. </div>
  819. <div class="panel panel-default">
  820. <div class="panel-heading">数据库选项</div>
  821. <div class="panel-body">
  822. <div class="form-group">
  823. <label class="col-sm-2 control-label">数据库主机</label>
  824. <div class="col-sm-4">
  825. <input class="form-control" type="text" name="db[server]" value="127.0.0.1">
  826. </div>
  827. </div>
  828. <div class="form-group">
  829. <label class="col-sm-2 control-label">数据库用户</label>
  830. <div class="col-sm-4">
  831. <input class="form-control" type="text" name="db[username]" value="root">
  832. </div>
  833. </div>
  834. <div class="form-group">
  835. <label class="col-sm-2 control-label">数据库密码</label>
  836. <div class="col-sm-4">
  837. <input class="form-control" type="text" name="db[password]">
  838. </div>
  839. </div>
  840. <div class="form-group">
  841. <label class="col-sm-2 control-label">表前缀</label>
  842. <div class="col-sm-4">
  843. <input class="form-control" type="text" name="db[prefix]" value="ims_">
  844. </div>
  845. </div>
  846. <div class="form-group">
  847. <label class="col-sm-2 control-label">数据库名称</label>
  848. <div class="col-sm-4">
  849. <input class="form-control" type="text" name="db[name]" value="we7">
  850. </div>
  851. </div>
  852. </div>
  853. </div>
  854. <div class="panel panel-default">
  855. <div class="panel-heading">管理选项</div>
  856. <div class="panel-body">
  857. <div class="form-group">
  858. <label class="col-sm-2 control-label">管理员账号</label>
  859. <div class="col-sm-4">
  860. <input class="form-control" type="username" name="user[username]">
  861. </div>
  862. </div>
  863. <div class="form-group">
  864. <label class="col-sm-2 control-label">管理员密码</label>
  865. <div class="col-sm-4">
  866. <input class="form-control" type="password" name="user[password]">
  867. </div>
  868. </div>
  869. <div class="form-group">
  870. <label class="col-sm-2 control-label">确认密码</label>
  871. <div class="col-sm-4">
  872. <input class="form-control" type="password"">
  873. </div>
  874. </div>
  875. </div>
  876. </div>
  877. <input type="hidden" name="do" id="do" />
  878. <ul class="pager">
  879. <li class="previous"><a href="javascript:;" onclick="$('#do').val('back');$('form')[0].submit();"><span class="glyphicon glyphicon-chevron-left"></span> 返回</a></li>
  880. <li class="previous"><a href="javascript:;" onclick="if(check(this)){jQuery('#do').val('continue');if($('input[name=type]:checked').val() == 'remote'){alert('在线安装时,安装程序会下载精简版快速完成安装,完成后请务必注册云服务更新到完整版。')}$('form')[0].submit();}">继续 <span class="glyphicon glyphicon-chevron-right"></span></a></li>
  881. </ul>
  882. </form>
  883. <script>
  884. var lock = false;
  885. function check(obj) {
  886. if(lock) {
  887. return;
  888. }
  889. $('.form-control').parent().parent().removeClass('has-error');
  890. var error = false;
  891. $('.form-control').each(function(){
  892. if($(this).val() == '') {
  893. $(this).parent().parent().addClass('has-error');
  894. this.focus();
  895. error = true;
  896. }
  897. });
  898. if(error) {
  899. alert('请检查未填项');
  900. return false;
  901. }
  902. if($(':password').eq(0).val() != $(':password').eq(1).val()) {
  903. $(':password').parent().parent().addClass('has-error');
  904. alert('确认密码不正确.');
  905. return false;
  906. }
  907. lock = true;
  908. $(obj).parent().addClass('disabled');
  909. $(obj).html('正在执行安装');
  910. return true;
  911. }
  912. </script>
  913. EOF;
  914. tpl_frame();
  915. }
  916. function tpl_install_finish() {
  917. $modules = get_store_module();
  918. $themes = get_store_theme();
  919. echo <<<EOF
  920. <div class="page-header"><h3>安装完成</h3></div>
  921. <div class="alert alert-success">
  922. 恭喜您!已成功安装“微擎 - 公众平台自助开源引擎”系统,您现在可以: <a target="_blank" class="btn btn-success" href="./web/index.php">访问网站首页</a>
  923. </div>
  924. EOF;
  925. tpl_frame();
  926. }
  927. function tpl_resources() {
  928. static $res = array(
  929. 'logo' => 'iVBORw0KGgoAAAANSUhEUgAAAaQAAABfCAYAAACnbrNbAAAACXBIWXMAAC4jAAAuIwF4pT92AAAKTWlDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVN3WJP3Fj7f92UPVkLY8LGXbIEAIiOsCMgQWaIQkgBhhBASQMWFiApWFBURnEhVxILVCkidiOKgKLhnQYqIWotVXDjuH9yntX167+3t+9f7vOec5/zOec8PgBESJpHmomoAOVKFPDrYH49PSMTJvYACFUjgBCAQ5svCZwXFAADwA3l4fnSwP/wBr28AAgBw1S4kEsfh/4O6UCZXACCRAOAiEucLAZBSAMguVMgUAMgYALBTs2QKAJQAAGx5fEIiAKoNAOz0ST4FANipk9wXANiiHKkIAI0BAJkoRyQCQLsAYFWBUiwCwMIAoKxAIi4EwK4BgFm2MkcCgL0FAHaOWJAPQGAAgJlCLMwAIDgCAEMeE80DIEwDoDDSv+CpX3CFuEgBAMDLlc2XS9IzFLiV0Bp38vDg4iHiwmyxQmEXKRBmCeQinJebIxNI5wNMzgwAABr50cH+OD+Q5+bk4eZm52zv9MWi/mvwbyI+IfHf/ryMAgQAEE7P79pf5eXWA3DHAbB1v2upWwDaVgBo3/ldM9sJoFoK0Hr5i3k4/EAenqFQyDwdHAoLC+0lYqG9MOOLPv8z4W/gi372/EAe/tt68ABxmkCZrcCjg/1xYW52rlKO58sEQjFu9+cj/seFf/2OKdHiNLFcLBWK8ViJuFAiTcd5uVKRRCHJleIS6X8y8R+W/QmTdw0ArIZPwE62B7XLbMB+7gECiw5Y0nYAQH7zLYwaC5EAEGc0Mnn3AACTv/mPQCsBAM2XpOMAALzoGFyolBdMxggAAESggSqwQQcMwRSswA6cwR28wBcCYQZEQAwkwDwQQgbkgBwKoRiWQRlUwDrYBLWwAxqgE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APWZmYl4PfNQtmgrcpa49n8Puow9ph5QzfR1pDnBBoXysCbphKiJcfTxJIy/m9kNVnXkN0dypgFnimM0CfATNZ3YQHnsqOPloJxlVsZ8UOto/1gfbRMlAmxX/bymU9ob4+zPD3SDRjQU1WfVVCaWbsqHzORyuYebFT2EopQtmIWcqgj21CZvOKM1Aa+fsVj0cbA4rcL2DmiM5mhXhK4HdeB3l+0EUvmGCtFLfhwTgMSRERFEVRFOVQk6dVoCiKoqhAUhRFURQVSIqiKIoKJEVRFEVRgaQoiqKoQFIURVEUFUiKoiiKCiRFURRFUYGkKIqiqEBSFEVRFBVIiqIoigokRVEURVGBpCiKoqhAUhRFURQVSIqiKIoKJEVRFEVRgaQoiqIcDvzfAOi6dmYBSbinAAAAAElFTkSuQmCC',
  930. );
  931. return $res;
  932. }
  933. function showerror($errno, $message = '') {
  934. return array(
  935. 'errno' => $errno,
  936. 'error' => $message,
  937. );
  938. }
  939. function get_store_module() {
  940. load()->func('communication');
  941. $response = ihttp_request(APP_STORE_API, array('controller' => 'store', 'action' => 'api', 'do' => 'module'));
  942. $response = json_decode($response['content'], true);
  943. $modules = '';
  944. foreach ($response['message'] as $key => $module) {
  945. if ($key % 3 < 1) {
  946. $modules .= '</tr><tr>';
  947. }
  948. $module['detail_link'] = APP_STORE_URL . trim($module['detail_link'], '.');
  949. $modules .= '<td>';
  950. $modules .= '<div class="col-sm-4">';
  951. $modules .= '<a href="' . $module['detail_link'] . '" title="查看详情" target="_blank">';
  952. $modules .= '<img src="' . $module['logo']. '"' . ' width="50" height="50" ' . $module['title'] . '" /></a>';
  953. $modules .= '</div>';
  954. $modules .= '<div class="col-sm-8">';
  955. $modules .= '<p><a href="' . $module['detail_link'] .'" title="查看详情" target="_blank">' . $module['title'] . '</a></p>';
  956. $modules .= '<p>安装量:<span class="text-danger">' . $module['purchases'] . '</span></p>';
  957. $modules .= '</div>';
  958. $modules .= '</td>';
  959. }
  960. $modules = substr($modules, 5) . '</tr>';
  961. return $modules;
  962. }
  963. function get_store_theme() {
  964. load()->func('communication');
  965. $response = ihttp_request(APP_STORE_API, array('controller' => 'store', 'action' => 'api', 'do' => 'theme'));
  966. $response = json_decode($response['content'], true);
  967. $themes = '<tr><td colspan="' . count($response['message']) . '">';
  968. $themes .= '<div class="form-group">';
  969. foreach ($response['message'] as $key => $theme) {
  970. $theme['detail_link'] = APP_STORE_URL . trim($theme['detail_link'], '.');
  971. $themes .= '<div class="col-sm-2" style="padding-left: 7px;margin-right: 25px;">';
  972. $themes .= '<a href="' . $theme['detail_link'] .'" title="查看详情" target="_blank" /><img src="' . $theme['logo']. '" /></a>';
  973. $themes .= '<p></p><p class="text-right">';
  974. $themes .= '<a href="' . $theme['detail_link']. '" title="查看详情" target="_blank">' . $theme['title'] . '</a></p>';
  975. $themes .= '</div>';
  976. }
  977. $themes .= '</div>';
  978. return $themes;
  979. }