skymvc开发手册之skymvc配置
查看视频教程或者获取有关《skymvc开发手册》更多信息

skymvc配置

配置文件在config目录中 可按照对应的需要配置

1.config/config.php 

<?php
 
require "database.php";
require "cache.php";
require "extends.php";
/*Session配置 1为自定义 0为系统默认*/
define("SMS_TEST",true);
define("SESSION_USER",0);
define("REWRITE_ON",0); 
define("REWRITE_TYPE","pathinfo");
define("TESTMODEL",1);//开发测试模式
define("SQL_SLOW_LOG",1);//记录慢查询
//UPLOAD_OSS--- aliyun/qiniu/upyun/0 不分离上传设为0
define("UPLOAD_OSS",0);
//http协议
$http = ((isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on") || (isset($_SERVER["HTTP_X_FORWARDED_PROTO"]) && $_SERVER["HTTP_X_FORWARDED_PROTO"] == "https")) ? "https://" : "http://";
define("IMAGES_SITE",$http.$_SERVER['HTTP_HOST']."/");
//静态文件
define("STATIC_SITE",$http.$_SERVER['HTTP_HOST']."/");

define("HTTP_HOST",$http.$_SERVER['HTTP_HOST']."/");
define("_REDIS_PRE_","deituiCMS_");  
?>

2.config/database.php 数据库配置

<?php
define("MYSQL_CHARSET", "utf8mb4");
define("TABLE_PRE", "sky_");
$dbclass="mysqli";
$dbconfig["master"]=array(
	"host"=>"localhost","user"=>"root","pwd"=>"root","database"=>"deituicmsbase","charset"=>"utf8mb4"
);
/**其他分表库**/
/*
$dbconfig["user"]=array(
	"host"=>"localhost","user"=>"root","pwd"=>"123","database"=>"skyshop"
);

$dbconfig["article"]=array(
	"host"=>"localhost","user"=>"root","pwd"=>"123","database"=>"skycms"
);
*/ 

/*分库配置*/
/* 
$VMDBS=array(
	"article"=>"article",
	"forum"=>"article"
);
*/

3.config/cache.php 缓存配置

<?php
/*缓存配置*/
$cacheconfig=array(
	"redis"=>true,
	"memcache"=>true,
	"mysql"=>true,
	"file"=>true
	
);
require_once "extends/cache/ex_cache_redis.php";
require_once "extends/cache/ex_cache_memcache.php";
require_once "extends/cache/ex_cache_mysql.php";

4.config/extends.php 扩展加载配置

<?php
/*用户自定义函数文件*/
$user_extends=array(
 	"ex_fun.php",
 	"ex_weixin.php",
 	//"session/ex_sess_redis.php",
 	//"session/ex_sess_mysql.php",
 	//"session/ex_sess_memcache.php"
  
);