FastAdmin框架学习-安装后的注意事项

FastAdmin框架学习-安装后的注意事项

删除判断是否安装FastAdmin的代码

public目录下,index.php文件中删除掉判断是否安装的代码块。

// 判断是否安装FastAdmin
if (!is_file(APP_PATH . 'admin/command/Install/install.lock'))
{
    header("location:./install.php");
    exit;
}

删掉后index.php文件只剩下如下内容。

<?php

// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006-2016 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <[email protected]>
// +----------------------------------------------------------------------
// [ 应用入口文件 ]
// 定义应用目录
define('APP_PATH', __DIR__ . '/../application/');


// 加载框架引导文件
require __DIR__ . '/../thinkphp/start.php';

同时删除install.php文件。

不删掉这些安装代码存在的问题

在根目录下的.gitignore文件中,判断是否安装fastAdmin的*.lock文件是被忽略掉的。那么会存在一个问题就是如果代码需要部署到阿里云之类的服务器上,而部署方式又是采用git,并且这个.gitignore文件又没有被删掉的话。那么又要跳转到安装目录让你去安装一次,所以当安装完成后,这些代码应该被删掉。

.gitignore中的部分行删除

如果需要部署到服务器上,并且采用git的方式部署,则需要把一些行删掉防止提交到服务器的代码不全。

/nbproject/
/runtime/*
.idea
composer.lock
*.log
*.css.map
!.gitkeep
.env
.svn
.vscode

剩下这些行就可以了。

发布了11 篇原创文章 · 获赞 1 · 访问量 185

猜你喜欢

转载自blog.csdn.net/xuancuocui1413/article/details/103909792