main.php 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479
  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.likeshop.cn)原创研发并取得软件著作权,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. 广州好象科技有限公司
  101. </p>
  102. </div>
  103. </div>
  104. <?php } ?>
  105. <!-- 检查信息 -->
  106. <?php if ($step == '2') { ?>
  107. <div class="mounted-content-item show">
  108. <div class="mounted-env-container">
  109. <div class="mounted-item">
  110. <div class="content-header">
  111. 服务器信息
  112. </div>
  113. <div class="content-table">
  114. <table class="layui-table" lay-skin="line">
  115. <colgroup>
  116. <col width="210">
  117. <col width="730">
  118. </colgroup>
  119. <thead>
  120. <tr>
  121. <th>参数</th>
  122. <th>值</th>
  123. </tr>
  124. </thead>
  125. <tbody>
  126. <tr>
  127. <td>服务器操作系统</td>
  128. <td><?php echo PHP_OS ?></td>
  129. </tr>
  130. <tr>
  131. <td>web服务器环境</td>
  132. <td><?php echo $_SERVER['SERVER_SOFTWARE']; ?></td>
  133. </tr>
  134. <tr>
  135. <td>PHP版本</td>
  136. <td><?php echo @phpversion(); ?></td>
  137. </tr>
  138. <tr>
  139. <td>程序安装目录</td>
  140. <td><?php echo realpath(__DIR__ . '../../../'); ?></td>
  141. </tr>
  142. <tr>
  143. <td>磁盘空间</td>
  144. <td><?php echo $modelInstall->freeDiskSpace(realpath(__DIR__ . '../../../')) ?></td>
  145. </tr>
  146. <tr>
  147. <td>上传限制</td>
  148. <?php if (ini_get('file_uploads')): ?>
  149. <td><?php echo ini_get('upload_max_filesize'); ?></td>
  150. <?php else: ?>
  151. <td>禁止上传</td>
  152. <?php endif; ?>
  153. </tr>
  154. </tbody>
  155. </table>
  156. </div>
  157. </div>
  158. <div class="mounted-tips mt16">PHP环境要求必须满足下列所有条件,否则系统或系统部分功能将无法使用。</div>
  159. <div class="mounted-item mt16">
  160. <div class="content-header">
  161. PHP环境要求
  162. </div>
  163. <div class="content-table">
  164. <table class="layui-table" lay-skin="line">
  165. <colgroup>
  166. <col width="210">
  167. <col width="210">
  168. <col width="120">
  169. <col width="400">
  170. </colgroup>
  171. <thead>
  172. <tr>
  173. <th>选项</th>
  174. <th>要求</th>
  175. <th>状态</th>
  176. <th>说明及帮助</th>
  177. </tr>
  178. </thead>
  179. <tbody>
  180. <tr>
  181. <td>PHP版本</td>
  182. <td>大于7.2</td>
  183. <?php echo $modelInstall->correctOrFail($modelInstall->checkPHP()) ?>
  184. <td>建议使用PHP7.2.4版本</td>
  185. </tr>
  186. <tr>
  187. <td>PDO_MYSQL</td>
  188. <td>支持 (强烈建议支持)</td>
  189. <?php echo $modelInstall->correctOrFail($modelInstall->checkPDOMySQL()) ?>
  190. <td></td>
  191. </tr>
  192. <tr>
  193. <td>allow_url_fopen</td>
  194. <td>支持 (建议支持cURL)</td>
  195. <?php echo $modelInstall->correctOrFail($modelInstall->checkCurl()) ?>
  196. <td></td>
  197. </tr>
  198. <tr>
  199. <td>GD2</td>
  200. <td>支持</td>
  201. <?php echo $modelInstall->correctOrFail($modelInstall->checkGd2()) ?>
  202. <td></td>
  203. </tr>
  204. <tr>
  205. <td>DOM</td>
  206. <td>支持</td>
  207. <?php echo $modelInstall->correctOrFail($modelInstall->checkDom()) ?>
  208. <td></td>
  209. </tr>
  210. <tr>
  211. <td>fileinfo</td>
  212. <td>支持</td>
  213. <?php echo $modelInstall->correctOrFail($modelInstall->checkFileInfo()) ?>
  214. <td></td>
  215. </tr>
  216. <tr>
  217. <td>session.auto_start</td>
  218. <td>关闭</td>
  219. <?php echo $modelInstall->correctOrFail($modelInstall->checkSessionAutoStart()) ?>
  220. <td></td>
  221. </tr>
  222. </tbody>
  223. </table>
  224. </div>
  225. </div>
  226. <div class="mounted-tips mt16">
  227. 系统要求likeshop开源商城安装目录下的runtime和upload必须可写,才能使用likeshop开源商城的所有功能。
  228. </div>
  229. <div class="mounted-item mt16">
  230. <div class="content-header">
  231. 目录权限监测
  232. </div>
  233. <div class="content-table">
  234. <table class="layui-table" lay-skin="line">
  235. <colgroup>
  236. <col width="210">
  237. <col width="210">
  238. <col width="120">
  239. <col width="400">
  240. </colgroup>
  241. <thead>
  242. <tr>
  243. <th>目录</th>
  244. <th>要求</th>
  245. <th>状态</th>
  246. <th>说明及帮助</th>
  247. </tr>
  248. </thead>
  249. <tbody>
  250. <tr>
  251. <td>/server/runtime</td>
  252. <td>/runtime目录可写</td>
  253. <?php echo $modelInstall->correctOrFail($modelInstall->checkDirWrite('runtime')) ?>
  254. <td><?php if($modelInstall->checkDirWrite('runtime') =='fail') echo'请给runtime目录权限,若目录不存在先新建';?></td>
  255. </tr>
  256. <tr>
  257. <td>/server/public/uploads</td>
  258. <td>uploads目录可写</td>
  259. <?php echo $modelInstall->correctOrFail($modelInstall->checkDirWrite('public/uploads')) ?>
  260. <td><?php if($modelInstall->checkDirWrite('public/uploads')=='fail') echo'请给public/uploads目录权限,若目录不存在先新建';?></td>
  261. </tr>
  262. <tr>
  263. <td>/server/config</td>
  264. <td>config目录可写</td>
  265. <?php echo $modelInstall->correctOrFail($modelInstall->checkDirWrite('config')) ?>
  266. <td><?php if($modelInstall->checkDirWrite('config')=='fail') echo'请给config目录权限,若目录不存在先新建';?></td>
  267. </tr>
  268. <tr>
  269. <td>/server/.env</td>
  270. <td>.env文件可写</td>
  271. <?php echo $modelInstall->correctOrFail($modelInstall->checkDirWrite('.env')) ?>
  272. <td><?php if($modelInstall->checkDirWrite('.env')=='fail') echo'请给.env文件权限,若文件不存在,注意文件名第1字符是" . "';?></td>
  273. </tr>
  274. </tbody>
  275. </table>
  276. </div>
  277. </div>
  278. </div>
  279. </div>
  280. <?php } ?>
  281. <!-- 数据库设置 -->
  282. <?php if ($step == '3') { ?>
  283. <div class="mounted-content-item show">
  284. <div class="mounted-item">
  285. <div class="content-header">
  286. 数据库选项
  287. </div>
  288. <div class="content-form">
  289. <div class="form-box-item">
  290. <div class="form-desc">
  291. 数据库主机
  292. </div>
  293. <div>
  294. <input type="text" name="host" value="<?= $post['host'] ?>"/>
  295. </div>
  296. </div>
  297. <div class="form-box-item">
  298. <div class="form-desc">
  299. 端口号
  300. </div>
  301. <div>
  302. <input type="text" name="port" value="<?= $post['port'] ?>"/>
  303. </div>
  304. </div>
  305. <div class="form-box-item">
  306. <div class="form-desc">
  307. 数据库用户
  308. </div>
  309. <div>
  310. <input type="text" name="user" value="<?= $post['user'] ?>"/>
  311. </div>
  312. </div>
  313. <div class="form-box-item">
  314. <div class="form-desc">
  315. 数据库密码
  316. </div>
  317. <div>
  318. <input type="text" name="password" value="<?= $post['password'] ?>"/>
  319. </div>
  320. </div>
  321. <div class="form-box-item">
  322. <div class="form-desc">
  323. 数据库名称
  324. </div>
  325. <div>
  326. <input type="text" name="name" value="<?= $post['name'] ?>"/>
  327. </div>
  328. </div>
  329. <div class="form-box-item">
  330. <div class="form-desc">
  331. 数据表前缀
  332. </div>
  333. <div>
  334. <input type="text" name="prefix" value="<?= $post['prefix'] ?>"/>
  335. </div>
  336. </div>
  337. </div>
  338. </div>
  339. <div class="mounted-item">
  340. <div class="content-header mt16">
  341. 管理选项
  342. </div>
  343. <div class="content-form">
  344. <div class="form-box-item">
  345. <div class="form-desc">
  346. 管理员账号
  347. </div>
  348. <div>
  349. <input type="text" name="admin_user" value="<?= $post['admin_user'] ?>"/>
  350. </div>
  351. </div>
  352. <div class="form-box-item">
  353. <div class="form-desc">
  354. 管理员密码
  355. </div>
  356. <div>
  357. <input type="password" name="admin_password"
  358. value="<?= $post['admin_password'] ?>"/>
  359. </div>
  360. </div>
  361. <div class="form-box-item">
  362. <div class="form-desc">
  363. 确认密码
  364. </div>
  365. <div>
  366. <input type="password" name="admin_confirm_password"
  367. value="<?= $post['admin_confirm_password'] ?>"/>
  368. </div>
  369. </div>
  370. <div class="form-box-check">
  371. <div class="form-desc"></div>
  372. <div style="display: flex;align-items: center;">
  373. <input type="checkbox" name="import_test_data"
  374. <?php if ($post['import_test_data'] == 'on'): ?>checked<?php endif; ?>
  375. title="导入测试数据"/>
  376. <div style="color: #666666;">&nbsp;导入测试数据</div>
  377. </div>
  378. </div>
  379. <div class="form-box-check">
  380. <div class="form-desc"></div>
  381. <div style="display: flex;align-items: center;">
  382. <input type="checkbox" name="clear_db"
  383. <?php if ($post['clear_db'] == 'on'): ?>checked<?php endif; ?>
  384. title="清空现有数据"/>
  385. <div style="color: #666666;">&nbsp;清空现有数据</div>
  386. </div>
  387. </div>
  388. </div>
  389. </div>
  390. </div>
  391. <?php } ?>
  392. <!-- 安装中 -->
  393. <?php if ($step == '4' or $step == '5') { ?>
  394. <div class="mounted-content-item show">
  395. <?php if ($step == '4') { ?>
  396. <div id="mounting">
  397. <div class="content-header">
  398. 正在安装中
  399. </div>
  400. <div class="mounting-container " id="install_message">
  401. <?php if (count($successTables) > 0): ?>
  402. <p style="margin-bottom: 4px;">成功创建数据库:<?= $post['name'] ?></p>
  403. <?php endif; ?>
  404. </div>
  405. </div>
  406. <?php } ?>
  407. <?php if ($step == '5') { ?>
  408. <div class="show" id="mounting-success">
  409. <div class="content-header">
  410. 安装成功
  411. </div>
  412. <div class="success-content">
  413. <div style="width: 48px;height: 48px;">
  414. <img src="./images/icon_mountSuccess.png"/>
  415. </div>
  416. <div class="mt16 result">安装完成,进入管理后台</div>
  417. <div style="margin-top: 5px;font-size:14px;">版本号:3.0.2.20250320</div>
  418. <div class="tips">
  419. 为了您站点的安全,安装完成后即可将网站根目录下的“install”文件夹删除,或者config/install.lock/目录下创建install.lock文件防止重复安装。
  420. </div>
  421. <div class="btn-group">
  422. <a class="btn" href="/admin" style="margin-left: 20px;">进入管理平台</a>
  423. </div>
  424. </div>
  425. </div>
  426. <?php } ?>
  427. </div>
  428. <?php } ?>
  429. </div>
  430. </form>
  431. <?php if ($step == '1') { ?>
  432. <div class="item-btn-group show">
  433. <button class="accept-btn" onclick="goStep(<?php echo $nextStep ?>)">我已阅读并同意</button>
  434. </div>
  435. <?php } elseif (in_array($step, ['2', "3"])) { ?>
  436. <div class="item-btn-group show">
  437. <button class="cancel-btn" onclick="cancel()" style="padding: 7px 63px;margin-right: 16px">返回
  438. </button>
  439. <?php if ($modelInstall->getAllowNext()): ?>
  440. <button class="accept-btn" onclick="goStep(<?php echo $nextStep ?>)" style="padding: 7px 63px;">
  441. 继续
  442. </button>
  443. <?php else: ?>
  444. <button class="accept-btn" onclick="goStep(<?php echo $step ?>)" style="padding: 7px 63px;">重新检查
  445. </button>
  446. <?php endif; ?>
  447. </div>
  448. <?php } elseif ($step == "4") { ?>
  449. <div class="item-btn-group show">
  450. <button class="disabled-btn" disabled="disabled">
  451. <div class="layui-icon layui-icon-loading layui-anim layui-anim-rotate layui-anim-loop"></div>
  452. <div style="font-size: 14px;margin-left: 7px;">正在安装中...</div>
  453. </button>
  454. </div>
  455. <?php } ?>
  456. </div>
  457. </div>
  458. <footer>
  459. Copyright © 2019-<?=date('Y')?> 广州好象科技有限公司 粤ICP备16101670号-2
  460. </footer>
  461. <script src="https://www.layuicdn.com/layui/layui.js"></script>
  462. <?php if (count($successTables) > 0): ?>
  463. <script>var successTables = eval(<?=json_encode($successTables) ?>); </script>
  464. <?php endif; ?>
  465. <script src="./js/mounted.js"></script>
  466. </body>
  467. </html>
  468. <?php if ($message != ''): ?>
  469. <script>alert('<?=$message; ?>');</script>
  470. <?php endif; ?>