开源 企业版 高校版 私有云 模力方舟 AI 队友
代码拉取完成,页面将自动刷新
捐赠
捐赠前请先登录
扫描微信二维码支付
取消
支付完成
支付提示
将跳转至支付宝完成支付
确定
取消
1 Star 0 Fork 70

紫花地丁/FoxCMS黔狐内容管理系统

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
已有帐号? 立即登录
文件
master
分支 (2)
标签 (1)
master
v1.21dev
v1.2
master
分支 (2)
标签 (1)
master
v1.21dev
v1.2
克隆/下载
克隆/下载
提示
下载代码请复制以下命令到终端执行
为确保你提交的代码身份被 Gitee 正确识别,请执行以下命令完成配置
初次使用 SSH 协议进行代码克隆、推送等操作时,需按下述提示完成 SSH 配置
1 生成 RSA 密钥
2 获取 RSA 公钥内容,并配置到 SSH公钥
在 Gitee 上使用 SVN,请访问 使用指南
使用 HTTPS 协议时,命令行会出现如下账号密码验证步骤。基于安全考虑,Gitee 建议 配置并使用私人令牌 替代登录密码进行克隆、推送等操作
Username for 'https://gitee.com': userName
Password for 'https://userName@gitee.com': # 私人令牌
master
分支 (2)
标签 (1)
master
v1.21dev
v1.2
foxcms
/
index.php
foxcms
/
index.php
index.php 4.58 KB
一键复制 编辑 原始数据 按行查看 历史
九尾黔狐 提交于 2024年08月26日 10:54 +08:00 . 首页还原修改
<?php
// [ 应用入口文件 ]
namespace think;
if(version_compare(PHP_VERSION,'7.1','<') || version_compare(PHP_VERSION,'8.0','>=')) {
$vinfo = require_once('./data/update/version/info.php');
$pve = require_once('./static/warn/php_version_error.html');
echo $pve;
exit();
}
define('INSTALL_PATH', str_replace('\\', '/', dirname(__FILE__)));//安装路径
if (file_exists(INSTALL_PATH."/install/") && !is_file(INSTALL_PATH . '/install/install.lock')) {//没有安装
header('Location:/install/index.php');
exit();
}
$base = require('./config/cfg/base.php');
try {
require __DIR__ . '/vendor/autoload.php';
} catch (\Throwable $e) {
if($base['frame_exception'] == '0'){
$pve = require_once('./static/warn/php_version_error.html');
echo $pve;
exit();
}
}
//检查
$seo = require('./config/cfg/seo.php');
if($seo['pseudo_status'] == 1){
$serverSoftware = strtolower($_SERVER['SERVER_SOFTWARE']);
if (strpos($serverSoftware, 'apache') !== false) {
$wFile = __DIR__."/.htaccess";
$contet = '<IfModule mod_rewrite.c>
Options +FollowSymlinks -Multiviews
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:1ドル]
</IfModule>';
config($contet, $wFile);
} elseif (strpos($serverSoftware, 'nginx') !== false) {
} elseif (strpos($serverSoftware, 'iis') !== false) {
$wFile = __DIR__."/web.config";
$contet = '<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="WPurls" enabled="true" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="index.php/{R:0}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>';
config($contet, $wFile);
}
}
if($_SERVER['REQUEST_URI'] == "/"){
if($_SERVER["SERVER_PORT"] == 80){
$domain = $_SERVER["SERVER_NAME"];
}else{
$domain = $_SERVER["SERVER_NAME"] . ":" . $_SERVER["SERVER_PORT"];
}
$prefixURL = 'http';
if ($_SERVER["HTTPS"] == "on")
{
$prefixURL .= "s";
}
$url = "{$prefixURL}://{$domain}/plus/Access/check";
$ch = curl_init();
$timeout = 1; // 设置超时的时间[单位:秒]
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
curl_setopt($ch, CURLOPT_URL, $url);
curl_exec($ch);
# 获取状态码赋值
$httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if (!($httpcode == 200)) {
header('Location:index.php');
die("访问失败");
}
}
// 执行HTTP应用并响应
$http = (new App())->http;
define("RUNTIME", __DIR__);
if(isApply()){
$response = $http->run();
}else{
if($base["status"] == 0){
$vinfo = require_once('./data/update/version/info.php');
setcookie("status_desc", $base["status_desc"]);
setcookie("version", $vinfo['version']);
require_once('./static/warn/close.php');
exit();
}
$response = $http->name('home')->run();
}
$response->send();
$http->end($response);
/**
* 判断应用
* @return bool
*/
function isApply(){
$uri = $_SERVER["REQUEST_URI"];
$adminconfig = require('./config/adminconfig.php');
$applys = require('./config/cfg/apply.php');
$isApply = false;
$uriArr = explode("/", $uri);
if(str_starts_with($uri, "/index.php")){
$app_name = $uriArr[2];
}else{
$app_name = $uriArr[1];
}
if($adminconfig["admin_path"] == $app_name){
$isApply = true;
}
if(!$isApply){
foreach ($applys as $apply){
if($apply == $app_name){
$isApply = true;
break;
}
}
}
return $isApply;
}
/**
* 配置伪静态
*/
function config($content, $file){
if(file_exists($file)){
$dh = file_get_contents($file);
if (empty($dh)){
file_put_contents($file,$content);
}
}else{
file_put_contents($file,$content);
}
}
Loading...
举报
举报成功
我们将于2个工作日内通过站内信反馈结果给你!
请认真填写举报原因,尽可能描述详细。
请选择举报类型
取消
发送
误判申诉

此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。

如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。

取消
提交

简介

🔥FoxCMS是一套可免费商用开源的内容管理系统,采用PHP+MySQL架构。内置企业常用的内容模型,如单页、文章、产品、图集、视频、反馈、下载等,并配备丰富的模板标签及强大的SEO和伪静态优化机制。无需复杂编程技能,仅需掌握HTML即可快速构建出多元化的应用场景,实现内容的高效管理。系统支持多语言、表单设计、访客统计、消息通知、云存储服务等,更多应用插件持续上架中,欢迎大家提出宝贵意见和建议。
暂无标签
GPL-3.0
使用 GPL-3.0 开源许可协议
取消

发行版

暂无发行版

贡献者

全部

近期动态

不能加载更多了
编辑仓库简介
简介内容
主页
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/newshine/foxcms.git
git@gitee.com:newshine/foxcms.git
newshine
foxcms
FoxCMS黔狐内容管理系统
master
点此查找更多帮助

搜索帮助

评论
仓库举报
回到顶部
登录提示
该操作需登录 Gitee 帐号,请先登录后再操作。
立即登录
没有帐号,去注册

AltStyle によって変換されたページ (->オリジナル) /