index.php 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  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:#F59064;
  87. /* background-image: linear-gradient(to right, red, white); */
  88. height:100%;
  89. }
  90. .right{
  91. width: 50%;
  92. background-color:#87CEEB;
  93. /* background-image: linear-gradient(to left, black , white); */
  94. height:100% ;
  95. }
  96. .lang-text{
  97. font-size:30px;
  98. cursor:pointer ;
  99. }
  100. a{
  101. color:#fff;
  102. }
  103. .en-tips , .zh-tips{
  104. display:none ;
  105. font-size:20px;
  106. }
  107. </style>
  108. </head>
  109. <body>
  110. <div class="container">
  111. <div class="flex-item left">
  112. <div class="lang-text" id="en">
  113. Language : English &nbsp; →
  114. </div>
  115. <div class="en-tips">
  116. 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>
  117. </div>
  118. </div>
  119. <div class="flex-item right">
  120. <div class="lang-text" id="zh">
  121. 语言 :中文 &nbsp; →
  122. </div>
  123. <div class="zh-tips">
  124. 初始化成功。默认管理员账户密码是showdoc/123456。<br>登录后,在右上角可以看到管理后台入口。<a href="../web/">点击进入首页</a>
  125. </div>
  126. </div>
  127. </div> <!-- /container -->
  128. </body>
  129. </html>
  130. <script src=../web/static/jquery.min.js></script>
  131. <script>
  132. $("#en").click(function(){
  133. toInstall("en");
  134. });
  135. $("#zh").click(function(){
  136. toInstall("zh");
  137. });
  138. function toInstall (lang){
  139. $.get("ajax.php?lang="+lang,function(data){
  140. if(data.error_code === 0){
  141. if(lang == 'en'){
  142. showEnTips()
  143. }else{
  144. showZhTips()
  145. }
  146. }else{
  147. alert(data.error_message)
  148. }
  149. },'json');
  150. }
  151. function showEnTips(){
  152. $(".right").hide();
  153. $(".left").css("width",'100%');
  154. $(".left .lang-text").hide();
  155. $(".en-tips").show();
  156. }
  157. function showZhTips(){
  158. $(".left").hide();
  159. $(".right").css("width",'100%');
  160. $(".right .lang-text").hide();
  161. $(".zh-tips").show();
  162. }
  163. </script>