Init.php 677 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: 中闽 < 1464674022@qq.com >
  5. * Date: 2020/2/4
  6. * Time: 12:47
  7. */
  8. namespace app\install\controller;
  9. use file\DirHelper;
  10. use think\Controller;
  11. class Init extends Controller
  12. {
  13. protected function _initialize()
  14. {
  15. if (!is_installed()) {
  16. $this->error('未找到安裝文件,请重新安装!', '/');
  17. }
  18. }
  19. public function delete()
  20. {
  21. $install_path = APP_PATH . 'install' . DS;
  22. DirHelper::delDir($install_path);
  23. if (file_exists($install_path)) {
  24. $this->error("删除失败,请检查目录权限");
  25. }
  26. $this->success("删除成功");
  27. }
  28. }