index.php 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. <?php
  2. // ShowDoc安装脚本
  3. // install Showdoc
  4. //
  5. // --------
  6. // 如果你能在浏览器中看到本句话,则证明你没有安装好PHP运行环境。请先安装好PHP运行环境
  7. // --------
  8. include("common.php");
  9. // 检测PHP环境
  10. if(version_compare(PHP_VERSION,'5.3.0','<')) die(L('require_php_version'));
  11. $go = 1 ;
  12. //检测文件权限
  13. if(!new_is_writeable("./")){
  14. //本安装目录需要写入lock文件
  15. echo L("not_writable_install").'<br>';
  16. $go = 0;
  17. }
  18. if(!new_is_writeable("../Public/Uploads")){
  19. echo L("not_writable_upload").'<br>';
  20. $go = 0;
  21. }
  22. if(!new_is_writeable("../server/Application/Runtime")){
  23. echo L("not_writable_server_runtime").'<br>';
  24. $go = 0;
  25. }
  26. //检查扩展
  27. if(!extension_loaded("gd")){
  28. echo '请安装php-gd<br>';
  29. $go = 0;
  30. }
  31. /*
  32. if(!extension_loaded("mcrypt")){
  33. echo '请安装php-mcrypt<br>';
  34. $go = 0;
  35. }
  36. */
  37. if(!extension_loaded("mbstring")){
  38. echo '请安装php-mbstring<br>';
  39. $go = 0;
  40. }
  41. if(!extension_loaded("zlib")){
  42. echo '请安装php-zlib<br>';
  43. $go = 0;
  44. }
  45. if(!extension_loaded("PDO") && !extension_loaded("pdo") ){
  46. echo '请安装php-pdo<br>';
  47. $go = 0;
  48. }
  49. /*if(extension_loaded("sqlite") || extension_loaded("sqlite3")){
  50. echo '请安装php-sqlite<br>';
  51. $go = 0;
  52. }
  53. */
  54. if (!$go) {
  55. exit();
  56. }
  57. ?>
  58. <!DOCTYPE html>
  59. <html lang="en">
  60. <head>
  61. <meta charset="utf-8">
  62. <title> ShowDoc</title>
  63. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  64. <meta name="description" content="">
  65. <meta name="author" content="">
  66. <style type="text/css">
  67. html,body{
  68. margin:0 0 ;
  69. padding:0 0 ;
  70. }
  71. .container{
  72. display: -webkit-flex; /* Safari */
  73. display: flex;
  74. height:100%;
  75. width:100%;
  76. position: absolute;
  77. }
  78. .flex-item{
  79. display: -webkit-inline-flex;
  80. display: inline-flex;
  81. justify-content:center; /*水平居中*/
  82. align-items: center; /*垂直居中*/
  83. }
  84. .left{
  85. width: 50%;
  86. background-color:#fff;
  87. /* background-image: linear-gradient(to right, red, white); */
  88. height:100%;
  89. }
  90. .right{
  91. width: 50%;
  92. background-color:#24292e;
  93. /* background-image: linear-gradient(to left, black , white); */
  94. height:100% ;
  95. color:#fff;
  96. }
  97. .lang-text{
  98. font-size:30px;
  99. cursor:pointer ;
  100. }
  101. .left a{
  102. color:#000;
  103. }
  104. .right a{
  105. color:#fff;
  106. }
  107. .en-tips , .zh-tips{
  108. display:none ;
  109. font-size:20px;
  110. }
  111. </style>
  112. </head>
  113. <body>
  114. <div class="container">
  115. <div class="flex-item left">
  116. <div class="lang-text" id="en">
  117. Choose language: English &nbsp; →
  118. </div>
  119. <div class="en-tips">
  120. Initialization successful. The default administrator account password is showdoc / 123456.<br>After logging in, you can see the management background entrance in the upper right corner.<br><a href="../web/">Click to enter the home page</a>
  121. </div>
  122. </div>
  123. <div class="flex-item right">
  124. <div class="lang-text" id="zh">
  125. 选择语言 :中文 &nbsp; →
  126. </div>
  127. <div class="zh-tips">
  128. 初始化成功。默认管理员账户密码是showdoc/123456。<br>登录后,在右上角可以看到管理后台入口。<a href="../web/">点击进入首页</a>
  129. </div>
  130. </div>
  131. </div> <!-- /container -->
  132. </body>
  133. </html>
  134. <script src=../web/static/jquery.min.js></script>
  135. <script>
  136. $("#en").click(function(){
  137. toInstall("en");
  138. });
  139. $("#zh").click(function(){
  140. toInstall("zh");
  141. });
  142. function toInstall (lang){
  143. $.get("ajax.php?lang="+lang,function(data){
  144. if(data.error_code === 0){
  145. if(lang == 'en'){
  146. showEnTips()
  147. }else{
  148. showZhTips()
  149. }
  150. }else{
  151. alert(data.error_message)
  152. }
  153. },'json');
  154. }
  155. function showEnTips(){
  156. $(".right").hide();
  157. $(".left").css("width",'100%');
  158. $(".left .lang-text").hide();
  159. $(".en-tips").show();
  160. }
  161. function showZhTips(){
  162. $(".left").hide();
  163. $(".right").css("width",'100%');
  164. $(".right .lang-text").hide();
  165. $(".zh-tips").show();
  166. }
  167. </script>