main.php 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494
  1. <?php !defined('install') && exit(); ?>
  2. <!DOCTYPE html>
  3. <html lang="en">
  4. <head>
  5. <meta charset="UTF-8">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <title>likeshop单商户高级安装</title>
  8. <link rel="stylesheet" type="text/css" href="https://www.layuicdn.com/layui/css/layui.css"/>
  9. <link rel="stylesheet" type="text/css" href="./css/mounted.css"/>
  10. <link rel="shortcut icon" href="./favicon.ico"/>
  11. </head>
  12. <body>
  13. <div class="header">
  14. <div class="logo" style="width: 220px;">
  15. <img src="./images/slogn.png?v=1"/>
  16. </div>
  17. </div>
  18. <div class="mounted" id="mounted">
  19. <div class="mounted-box">
  20. <form method="post" action="#" name="main_form">
  21. <div class="mounted-title">安装步骤</div>
  22. <div class="mounted-container" id="tab">
  23. <ul class="mounted-nav" id="nav">
  24. <li <?php if ($step == "1") { ?>class="active"<?php } ?>>许可协议</li>
  25. <li <?php if ($step == "2") { ?>class="active"<?php } ?>>环境监测</li>
  26. <li <?php if ($step == "3") { ?>class="active"<?php } ?>>参数配置</li>
  27. <li <?php if ($step == "4" or $step == '5') { ?>class="active"<?php } ?>>安装</li>
  28. </ul>
  29. <!-- 阅读许可 -->
  30. <?php if ($step == '1') { ?>
  31. <div class="mounted-content-item show">
  32. <div class="content-header">
  33. likeshop100%开源免费商用电商系统授权协议
  34. </div>
  35. <div class="content">
  36. <h2>版权所有(c)2019-<?=date('Y')?>,likeshop团队保留所有权利。</h2>
  37. <p class="mt16">
  38. 感谢你信任并选择likeshop100%开源免费商用电商系统,likeshop100%开源免费商用电商系统由广州好象科技有限公司(www.likemarket.net)原创研发并取得软件著作权,100%开放源码,无加密,自主可控,方便二次开发。</p>
  39. <p class="mt6">为了正确并合法的使用本软件,请你在使用前务必阅读清楚下面的协议条款:</p>
  40. <h3 class="mt16">一、本授权协议适用且仅适用于likeshop系列开源软件产品(以下简称likeshop)任何版本,广州好象科技有限公司拥有本授权协议的最终解释权。</h3>
  41. <h3 class="mt16">二、协议许可的权利</h3>
  42. <p class="mt6">
  43. 1.开源版本可以任意免费商用,可去除界面版权logo,不能去除代码版权。付费版本需要取得商业授权方可使用,否则会被视为盗版行为并承担相应法律责任。
  44. </p>
  45. <p class="mt6">
  46. 2.请尊重likeshop开源团队劳动成果,严禁使用本系统转手、转卖、倒卖或二次开发后转手、转卖、倒卖等商业行为。
  47. </p>
  48. <p class="mt6">
  49. 3.任何企业和个人不允许对likeshop程序代码以任何形式任何目的再发布。
  50. </p>
  51. <p class="mt6">
  52. 4.你可以在协议规定的约束和限制范围内修改likeshop系列开源软件产品或界面风格以适应你的网站要求。
  53. </p>
  54. <p class="mt6">
  55. 5.你拥有使用本软件构建的系统全部内容所有权,并独立承担与这些内容的相关法律义务。
  56. </p>
  57. <p class="mt6">
  58. 6.获得商业授权之后,你可以将本软件应用于商业用途,同时依据所购买的授权类型中确定的技术支持内容,自购买时刻起,在技术支持期限内拥有通过指定的方式获得指定范围内的技术支持服务。商业授权用户享有反映和提出意见的权力,相关意见将被作为首要考虑,但没有一定被采纳的承诺或保证。
  59. </p>
  60. <h3 class="mt6">三、协议规定的约束和限制</h3>
  61. <p class="mt6">
  62. 1.开源版本可以任意免费商用,可去除界面版权logo,不能去除代码版权。付费版本需要取得商业授权方可使用,否则会被视为盗版行为并承担相应法律责任。
  63. </p>
  64. <p class="mt6">
  65. 2.未经官方许可,不得对本软件或与之关联的商业授权进行出租、出售、抵押或发放子许可证。
  66. </p>
  67. <p class="mt6">
  68. 3.未经官方许可,禁止在likeshop开源商城的整体或任何部分基础上以发展任何派生版本、修改版本或第三方版本用于重新分发。
  69. </p>
  70. <p class="mt6">
  71. 4.如果你未能遵守本协议的条款,你的授权将被终止,所被许可的权利将被收回,并承担相应法律责任。
  72. </p>
  73. <h3 class="mt6">四、有限担保和免责声明</h3>
  74. <p class="mt6">
  75. 1.本软件及所附带的文件是作为不提供任何明确的或隐含的赔偿或担保的形式提供的。
  76. </p>
  77. <p class="mt6">
  78. 2.用户出于自愿而使用本软件,你必须了解使用本软件的风险,在尚未购买产品技术服务之前,我们不承诺对免费用户提供任何形式的技术支持、使用担保,也不承担任何因使用本软件而产生问题的相关责任。
  79. </p>
  80. <p class="mt6">
  81. 3.电子文本形式的授权协议如同双方书面签署的协议一样,具有完全的和等同的法律效力。你一旦开始确认本协议并安装本软件,即被视为完全理解并接受本协议的各项条款,在享有上述条款授予的权力的同时,受到相关的约束和限制。协议许可范围以外的行为,将直接违反本授权协议并构成侵权,我们有权随时终止授权,责令停止损害,并保留追究相关责任的权力。
  82. </p>
  83. <p class="mt6">
  84. 4.如果本软件带有其它软件的整合API示范例子包,这些文件版权不属于本软件官方,并且这些文件是没经过授权发布的,请参考相关软件的使用许可合法的使用。
  85. </p>
  86. <br><br>
  87. <p class="mt6">
  88. likeshop开源地址:https://gitee.com/likeshop_gitee/likeshop
  89. </p>
  90. <p class="mt6">
  91. likeshop官方网站:https://www.likeshop.cn
  92. </p>
  93. <p class="mt6">
  94. likeshop知识社区:https://home.likeshop.cn
  95. </p>
  96. <p class="mt6">
  97. -----------------------------------------------------
  98. </p>
  99. <p class="mt6">
  100. 电话: 400-8489-315 18925185700 钟先生
  101. </p>
  102. <p class="mt6">
  103. 广州好象科技有限公司
  104. </p>
  105. </div>
  106. </div>
  107. <?php } ?>
  108. <!-- 检查信息 -->
  109. <?php if ($step == '2') { ?>
  110. <div class="mounted-content-item show">
  111. <div class="mounted-env-container">
  112. <div class="mounted-item">
  113. <div class="content-header">
  114. 服务器信息
  115. </div>
  116. <div class="content-table">
  117. <table class="layui-table" lay-skin="line">
  118. <colgroup>
  119. <col width="210">
  120. <col width="730">
  121. </colgroup>
  122. <thead>
  123. <tr>
  124. <th>参数</th>
  125. <th>值</th>
  126. </tr>
  127. </thead>
  128. <tbody>
  129. <tr>
  130. <td>服务器操作系统</td>
  131. <td><?php echo PHP_OS ?></td>
  132. </tr>
  133. <tr>
  134. <td>web服务器环境</td>
  135. <td><?php echo $_SERVER['SERVER_SOFTWARE']; ?></td>
  136. </tr>
  137. <tr>
  138. <td>PHP版本</td>
  139. <td><?php echo @phpversion(); ?></td>
  140. </tr>
  141. <tr>
  142. <td>程序安装目录</td>
  143. <td><?php echo realpath(__DIR__ . '../../../'); ?></td>
  144. </tr>
  145. <tr>
  146. <td>磁盘空间</td>
  147. <td><?php echo $modelInstall->freeDiskSpace(realpath(__DIR__ . '../../../')) ?></td>
  148. </tr>
  149. <tr>
  150. <td>上传限制</td>
  151. <?php if (ini_get('file_uploads')): ?>
  152. <td><?php echo ini_get('upload_max_filesize'); ?></td>
  153. <?php else: ?>
  154. <td>禁止上传</td>
  155. <?php endif; ?>
  156. </tr>
  157. </tbody>
  158. </table>
  159. </div>
  160. </div>
  161. <div class="mounted-tips mt16">PHP环境要求必须满足下列所有条件,否则系统或系统部分功能将无法使用。</div>
  162. <div class="mounted-item mt16">
  163. <div class="content-header">
  164. PHP环境要求
  165. </div>
  166. <div class="content-table">
  167. <table class="layui-table" lay-skin="line">
  168. <colgroup>
  169. <col width="210">
  170. <col width="210">
  171. <col width="120">
  172. <col width="400">
  173. </colgroup>
  174. <thead>
  175. <tr>
  176. <th>选项</th>
  177. <th>要求</th>
  178. <th>状态</th>
  179. <th>说明及帮助</th>
  180. </tr>
  181. </thead>
  182. <tbody>
  183. <tr>
  184. <td>PHP版本</td>
  185. <td>大于8.0</td>
  186. <?php echo $modelInstall->correctOrFail($modelInstall->checkPHP()) ?>
  187. <td>建议使用PHP8.0.8版本</td>
  188. </tr>
  189. <tr>
  190. <td>PDO_MYSQL</td>
  191. <td>支持 (强烈建议支持)</td>
  192. <?php echo $modelInstall->correctOrFail($modelInstall->checkPDOMySQL()) ?>
  193. <td></td>
  194. </tr>
  195. <tr>
  196. <td>allow_url_fopen</td>
  197. <td>支持 (建议支持cURL)</td>
  198. <?php echo $modelInstall->correctOrFail($modelInstall->checkCurl()) ?>
  199. <td></td>
  200. </tr>
  201. <tr>
  202. <td>GD2</td>
  203. <td>支持</td>
  204. <?php echo $modelInstall->correctOrFail($modelInstall->checkGd2()) ?>
  205. <td></td>
  206. </tr>
  207. <tr>
  208. <td>DOM</td>
  209. <td>支持</td>
  210. <?php echo $modelInstall->correctOrFail($modelInstall->checkDom()) ?>
  211. <td></td>
  212. </tr>
  213. <tr>
  214. <td>fileinfo</td>
  215. <td>支持</td>
  216. <?php echo $modelInstall->correctOrFail($modelInstall->checkFileInfo()) ?>
  217. <td></td>
  218. </tr>
  219. <tr>
  220. <td>session.auto_start</td>
  221. <td>关闭</td>
  222. <?php echo $modelInstall->correctOrFail($modelInstall->checkSessionAutoStart()) ?>
  223. <td></td>
  224. </tr>
  225. </tbody>
  226. </table>
  227. </div>
  228. </div>
  229. <div class="mounted-tips mt16">
  230. 系统要求likeshop开源商城安装目录下的runtime和upload必须可写,才能使用likeshop开源商城的所有功能。
  231. </div>
  232. <div class="mounted-item mt16">
  233. <div class="content-header">
  234. 目录权限监测
  235. </div>
  236. <div class="content-table">
  237. <table class="layui-table" lay-skin="line">
  238. <colgroup>
  239. <col width="210">
  240. <col width="210">
  241. <col width="120">
  242. <col width="400">
  243. </colgroup>
  244. <thead>
  245. <tr>
  246. <th>目录</th>
  247. <th>要求</th>
  248. <th>状态</th>
  249. <th>说明及帮助</th>
  250. </tr>
  251. </thead>
  252. <tbody>
  253. <tr>
  254. <td>/server/runtime</td>
  255. <td>runtime目录可写</td>
  256. <?php echo $modelInstall->correctOrFail($modelInstall->checkDirWrite('runtime')) ?>
  257. <td><?php if($modelInstall->checkDirWrite('runtime') =='fail') echo'请给runtime目录权限,若目录不存在先新建';?></td>
  258. </tr>
  259. <tr>
  260. <td>/server/public/uploads</td>
  261. <td>uploads目录可写</td>
  262. <?php echo $modelInstall->correctOrFail($modelInstall->checkDirWrite('public/uploads')) ?>
  263. <td><?php if($modelInstall->checkDirWrite('public/uploads')=='fail') echo'请给public/uploads目录权限,若目录不存在先新建';?></td>
  264. </tr>
  265. <tr>
  266. <td>/server/public/admin</td>
  267. <td>admin目录可写</td>
  268. <?php echo $modelInstall->correctOrFail($modelInstall->checkDirWrite('public/admin')) ?>
  269. <td><?php if($modelInstall->checkDirWrite('public/uploads')=='fail') echo'请给public/admin目录权限,若目录不存在先新建';?></td>
  270. </tr>
  271. <tr>
  272. <td>/server/public/mobile</td>
  273. <td>mobile目录可写</td>
  274. <?php echo $modelInstall->correctOrFail($modelInstall->checkDirWrite('public/mobile')) ?>
  275. <td><?php if($modelInstall->checkDirWrite('public/uploads')=='fail') echo'请给public/mobile目录权限,若目录不存在先新建';?></td>
  276. </tr>
  277. <tr>
  278. <td>/server/config</td>
  279. <td>config目录可写</td>
  280. <?php echo $modelInstall->correctOrFail($modelInstall->checkDirWrite('config')) ?>
  281. <td><?php if($modelInstall->checkDirWrite('config')=='fail') echo'请给config目录权限,若目录不存在先新建';?></td>
  282. </tr>
  283. <tr>
  284. <td>/server/.env</td>
  285. <td>.env文件可写</td>
  286. <?php echo $modelInstall->correctOrFail($modelInstall->checkDirWrite('.env')) ?>
  287. <td><?php if($modelInstall->checkDirWrite('.env')=='fail') echo'请给.env文件权限,若文件不存在,注意文件名第1字符是" . "';?></td>
  288. </tr>
  289. </tbody>
  290. </table>
  291. </div>
  292. </div>
  293. </div>
  294. </div>
  295. <?php } ?>
  296. <!-- 数据库设置 -->
  297. <?php if ($step == '3') { ?>
  298. <div class="mounted-content-item show">
  299. <div class="mounted-item">
  300. <div class="content-header">
  301. 数据库选项
  302. </div>
  303. <div class="content-form">
  304. <div class="form-box-item">
  305. <div class="form-desc">
  306. 数据库主机
  307. </div>
  308. <div>
  309. <input type="text" name="host" value="<?= $post['host'] ?>"/>
  310. </div>
  311. </div>
  312. <div class="form-box-item">
  313. <div class="form-desc">
  314. 端口号
  315. </div>
  316. <div>
  317. <input type="text" name="port" value="<?= $post['port'] ?>"/>
  318. </div>
  319. </div>
  320. <div class="form-box-item">
  321. <div class="form-desc">
  322. 数据库用户
  323. </div>
  324. <div>
  325. <input type="text" name="user" value="<?= $post['user'] ?>"/>
  326. </div>
  327. </div>
  328. <div class="form-box-item">
  329. <div class="form-desc">
  330. 数据库密码
  331. </div>
  332. <div>
  333. <input type="text" name="password" value="<?= $post['password'] ?>"/>
  334. </div>
  335. </div>
  336. <div class="form-box-item">
  337. <div class="form-desc">
  338. 数据库名称
  339. </div>
  340. <div>
  341. <input type="text" name="name" value="<?= $post['name'] ?>"/>
  342. </div>
  343. </div>
  344. <div class="form-box-item">
  345. <div class="form-desc">
  346. 数据表前缀
  347. </div>
  348. <div>
  349. <input type="text" name="prefix" value="<?= $post['prefix'] ?>"/>
  350. </div>
  351. </div>
  352. </div>
  353. </div>
  354. <div class="mounted-item">
  355. <div class="content-header mt16">
  356. 管理选项
  357. </div>
  358. <div class="content-form">
  359. <div class="form-box-item">
  360. <div class="form-desc">
  361. 管理员账号
  362. </div>
  363. <div>
  364. <input type="text" name="admin_user" value="<?= $post['admin_user'] ?>"/>
  365. </div>
  366. </div>
  367. <div class="form-box-item">
  368. <div class="form-desc">
  369. 管理员密码
  370. </div>
  371. <div>
  372. <input type="password" name="admin_password"
  373. value="<?= $post['admin_password'] ?>"/>
  374. </div>
  375. </div>
  376. <div class="form-box-item">
  377. <div class="form-desc">
  378. 确认密码
  379. </div>
  380. <div>
  381. <input type="password" name="admin_confirm_password"
  382. value="<?= $post['admin_confirm_password'] ?>"/>
  383. </div>
  384. </div>
  385. <div class="form-box-check">
  386. <div class="form-desc"></div>
  387. <div style="display: flex;align-items: center;">
  388. <input type="checkbox" name="import_test_data"
  389. <?php if ($post['import_test_data'] == 'on'): ?>checked<?php endif; ?>
  390. title="导入测试数据"/>
  391. <div style="color: #666666;">&nbsp;导入测试数据</div>
  392. </div>
  393. </div>
  394. <div class="form-box-check">
  395. <div class="form-desc"></div>
  396. <div style="display: flex;align-items: center;">
  397. <input type="checkbox" name="clear_db"
  398. <?php if ($post['clear_db'] == 'on'): ?>checked<?php endif; ?>
  399. title="清空现有数据"/>
  400. <div style="color: #666666;">&nbsp;清空现有数据</div>
  401. </div>
  402. </div>
  403. </div>
  404. </div>
  405. </div>
  406. <?php } ?>
  407. <!-- 安装中 -->
  408. <?php if ($step == '4' or $step == '5') { ?>
  409. <div class="mounted-content-item show">
  410. <?php if ($step == '4') { ?>
  411. <div id="mounting">
  412. <div class="content-header">
  413. 正在安装中
  414. </div>
  415. <div class="mounting-container " id="install_message">
  416. <?php if (count($successTables) > 0): ?>
  417. <p style="margin-bottom: 4px;">成功创建数据库:<?= $post['name'] ?></p>
  418. <?php endif; ?>
  419. </div>
  420. </div>
  421. <?php } ?>
  422. <?php if ($step == '5') { ?>
  423. <div class="show" id="mounting-success">
  424. <div class="content-header">
  425. 安装成功
  426. </div>
  427. <div class="success-content">
  428. <div style="width: 48px;height: 48px;">
  429. <img src="./images/icon_mountSuccess.png"/>
  430. </div>
  431. <div class="mt16 result">安装完成,进入管理后台</div>
  432. <div style="margin-top: 5px;font-size:14px;">版本号:3.3.2</div>
  433. <div class="tips">
  434. 为了您站点的安全,安装完成后即可将网站根目录下的“install”文件夹删除,或者config/install.lock/目录下创建install.lock文件防止重复安装。
  435. </div>
  436. <div class="btn-group">
  437. <a class="btn" href="/admin" style="margin-left: 20px;">进入管理平台</a>
  438. </div>
  439. </div>
  440. </div>
  441. <?php } ?>
  442. </div>
  443. <?php } ?>
  444. </div>
  445. </form>
  446. <?php if ($step == '1') { ?>
  447. <div class="item-btn-group show">
  448. <button class="accept-btn" onclick="goStep(<?php echo $nextStep ?>)">我已阅读并同意</button>
  449. </div>
  450. <?php } elseif (in_array($step, ['2', "3"])) { ?>
  451. <div class="item-btn-group show">
  452. <button class="cancel-btn" onclick="cancel()" style="padding: 7px 63px;margin-right: 16px">返回
  453. </button>
  454. <?php if ($modelInstall->getAllowNext()): ?>
  455. <button class="accept-btn" onclick="goStep(<?php echo $nextStep ?>)" style="padding: 7px 63px;">
  456. 继续
  457. </button>
  458. <?php else: ?>
  459. <button class="accept-btn" onclick="goStep(<?php echo $step ?>)" style="padding: 7px 63px;">重新检查
  460. </button>
  461. <?php endif; ?>
  462. </div>
  463. <?php } elseif ($step == "4") { ?>
  464. <div class="item-btn-group show">
  465. <button class="disabled-btn" disabled="disabled">
  466. <div class="layui-icon layui-icon-loading layui-anim layui-anim-rotate layui-anim-loop"></div>
  467. <div style="font-size: 14px;margin-left: 7px;">正在安装中...</div>
  468. </button>
  469. </div>
  470. <?php } ?>
  471. </div>
  472. </div>
  473. <footer>
  474. Copyright © 2019-<?=date('Y')?> 广州好象科技有限公司 粤ICP备16101670号-2
  475. </footer>
  476. <script src="https://www.layuicdn.com/layui/layui.js"></script>
  477. <?php if (count($successTables) > 0): ?>
  478. <script>var successTables = eval(<?=json_encode($successTables) ?>); </script>
  479. <?php endif; ?>
  480. <script src="./js/mounted.js"></script>
  481. </body>
  482. </html>
  483. <?php if ($message != ''): ?>
  484. <script>alert('<?=$message; ?>');</script>
  485. <?php endif; ?>