install.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. /*
  3. '软件名称:苹果CMS 源码库:https://github.com/magicblack
  4. '--------------------------------------------------------
  5. 'Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
  6. '遵循Apache2开源协议发布,并提供免费使用。
  7. '--------------------------------------------------------
  8. */
  9. header('Content-Type:text/html;charset=utf-8');
  10. // 检测PHP环境
  11. if(version_compare(PHP_VERSION,'5.5.0','<')) die('PHP版本需要>=5.5,请升级【PHP version requires > = 5.5,please upgrade】');
  12. //超时时间
  13. @ini_set('max_execution_time', '0');
  14. //内存限制 取消内存限制
  15. @ini_set("memory_limit",'-1');
  16. // 定义应用目录
  17. define('ROOT_PATH', __DIR__ . '/');
  18. define('APP_PATH', __DIR__ . '/application/');
  19. define('MAC_COMM', __DIR__.'/application/common/common/');
  20. define('MAC_HOME_COMM', __DIR__.'/application/index/common/');
  21. define('MAC_ADMIN_COMM', __DIR__.'/application/admin/common/');
  22. define('MAC_START_TIME', microtime(true) );
  23. define('BIND_MODULE', 'install');
  24. define('ENTRANCE', 'install');
  25. $in_file = rtrim($_SERVER['SCRIPT_NAME'],'/');
  26. if(substr($in_file,strlen($in_file)-4)!=='.php'){
  27. $in_file = substr($in_file,0,strpos($in_file,'.php')) .'.php';
  28. }
  29. define('IN_FILE',$in_file);
  30. if(is_file('./application/data/install/install.lock')) {
  31. echo '如需重新安装请删除【To re install, please remove】 >>> /application/data/install/install.lock';
  32. exit;
  33. }
  34. if(!is_writable('./runtime')) {
  35. echo '请开启[runtime]目录的读写权限【Please turn on the read and write permissions of the [runtime] folder】';
  36. exit;
  37. }
  38. // 加载框架引导文件
  39. require __DIR__ . '/thinkphp/start.php';