1. <?php
  2.  
  3. $params = require(__DIR__ . '/params.php');
  4.  
  5. $config = [
    'id' => 'basic',
    'basePath' => dirname(__DIR__),
    'bootstrap' => ['log'],
    'components' => [
    'request' => [
    // !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
    'cookieValidationKey' => 'NtpWRYAeSMA71cUiMP3inzMup5oFdiYt',
    'parsers' => [
    'application/json' => 'yii\web\JsonParser',
    ]
    ],
    'cache' => [
    'class' => 'yii\caching\FileCache',
    ],
    'user' => [
    'identityClass' => 'app\models\User',
    'enableAutoLogin' => true,
    ],
    'errorHandler' => [
    'errorAction' => 'site/error',
    ],
    'mailer' => [
    'class' => 'yii\swiftmailer\Mailer',
    // send all mails to a file by default. You have to set
    // 'useFileTransport' to false and configure a transport
    // for the mailer to send real emails.
    'useFileTransport' => true,
    ],
    'log' => [
    'traceLevel' => YII_DEBUG ? 3 : 0,
    'targets' => [
    [
    'class' => 'yii\log\FileTarget',
    'levels' => ['error', 'warning'],
    ],
    ],
    ],
    'db' => require(__DIR__ . '/db.php'),
    'urlManager' => [
    'enablePrettyUrl' => true,
    'enableStrictParsing' => false, // 不能设置为true
    'showScriptName' => false,
    'rules' => [
    ['class' => 'yii\rest\UrlRule', 'controller' => ['user', 'post']],
    ],
    ],
    ],
    'params' => $params,
    'language' => 'zh-CN',
    ];
  6.  
  7. if (YII_ENV_DEV) {
    // configuration adjustments for 'dev' environment
    $config['bootstrap'][] = 'debug';
    $config['modules']['debug'] = 'yii\debug\Module';
  8.  
  9. $config['bootstrap'][] = 'gii';
    // $config['modules']['gii'] = 'yii\gii\Module';
    $config['modules']['gii'] = [
    'class' => 'yii\gii\Module',
    'allowedIPs' => ['127.0.0.1', '::1', '192.168.0.*', '192.168.31.134'] // 按需调整这里
    ];
    }
  10.  
  11. return $config;

yii-basic-app-2.0.5/basic/config/web.php的更多相关文章

  1. 【Yii系列】Yii2.0基础框架

    缘起 因为一个月的短暂停留,我在给朋友搞事情,所以Yii系列的文章耽搁了很长时间,现在又重拾当时的知识,给大伙好好撸下这一系列的博客 提起Yii,虽然是国外的开发者搞的,但是它的作者是华人,这才是让我 ...

  2. 【系统Configmachine.config与自己的应用程序的App.config/Web.Config配置节点重复】解决方法

    自己的应用程序的App.config或Web.Config文件中与系统的C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Configmachine.co ...

  3. C:\Windows\system32\config\systemprofile\AppData\Local\Microsoft\Team Foundation\4.0\Cache\VersionControl.config is not valid and cannot be loaded.

    Recently, we experienced a strange problem with TFS 2010. We spent a few days before we figured it o ...

  4. asp.net 2.0中新增的web.config的默认namespace功能 (转)

    看上去这个题目比较长,但实际上,我在看资料时发现,这就是说,在asp.net 2.0中,只需要在web.config里定义你要用的那些namespace,则在aspx页面中就不需要再象1.1那样,用 ...

  5. peomethues 参数设置 监控网站 /usr/local/prometheus-2.13.0.linux-amd64/prometheus --config.file=/usr/local/prometheus-2.13.0.linux-amd64/prometheus.yml --web.listen-address=:9999 --web.enable-lifecycle

    probe_http_status_code{instance="xxxx",job="web_status"} probe_http_status_code{ ...

  6. ASP.NET SignalR 与 LayIM2.0 配合轻松实现Web聊天室(二) 之 ChatServer搭建,连接服务器,以及注意事项。

    上篇:ASP.NET SignalR 与 LayIM2.0 配合轻松实现Web聊天室(一) 之 基层数据搭建,让数据活起来(数据获取) 上一篇我们已经完成了初步界面的搭建工作,本篇将介绍IM的核心内容 ...

  7. ASP.NET SignalR 与 LayIM2.0 配合轻松实现Web聊天室(十二) 代码重构使用反射工厂解耦(一)缓存切换

    前言 上一篇中,我们用了反射工厂来解除BLL和UI层耦合的问题.当然那是最简单的解决方法,再复杂一点的程序可能思路相同,但是在编程细节中需要考虑的就更多了,比如今天我在重构过程中遇到的问题.也是接下来 ...

  8. ASP.NET SignalR 与 LayIM2.0 配合轻松实现Web聊天室(三) 之 实现单聊,群聊,发送图片,文件。

    上篇讲解了如何搭建聊天服务器,以及客户端js怎么和layui的语法配合.服务器已经连接上了,那么聊天还会远吗? 进入正题,正如上一篇提到的我们用 Client.Group(groupId)的方法向客户 ...

  9. ASP.NET SignalR 与 LayIM2.0 配合轻松实现Web聊天室(五) 之 加好友,加群流程,消息管理和即时消息提示的实现

    前言 前前一篇留了个小问题,在上一篇中忘了写了,就是关于LayIM已经封装好的上传文件或者图片的问题.对接好接口之后,如果上传速度慢,界面就会出现假死情况,虽然文件正在上传.于是我就简单做了个图标替代 ...

  10. 在OneThink(ThinkPHP3.2.3)中整合阿里云OSS的PHP-SDK2.0.4,实现Web端直传,服务端签名直传并设置上传回调的实现流程

    在OneThink(ThinkPHP3.2.3)中整合阿里云OSS的PHP-SDK2.0.4,实现本地文件上传流程 by shuijingwan · 2016/01/13 1.SDK安装 github ...

随机推荐

  1. HomeBrew安装和卸载

    HomeBrew——OS X 不可或缺的套件管理器 1.安装,一行代码即可. /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercon ...

  2. RMQ算法模板

    分别写了下标从0和1开始的两种 #include<stdio.h> #include<string.h> #include<algorithm> #include& ...

  3. 结对编程--基于android平台的黄金点游戏(2.0版本)

    在昨天上传完博客之后发现一个重大的bug...故在此推出2.0版本. 博文详情见:http://www.cnblogs.com/RayShea/p/5372398.html coding地址:http ...

  4. [BZOJ 3637]Query on a tree VI

    偶然看见了这题,觉得自己 QTREE.COT 什么的都没有刷过的真是弱爆了…… 一道思路很巧妙的题,终于是在约大爷的耐心教导下会了,真是太感谢约大爷了. 这题显然是树链剖分,但是链上维护的东西很恶心. ...

  5. 更改localhost默认打开的index.html的地址三步曲

    首先说明,我的Apache安装路径是F:\software installing\Apache2.2 解释一下,localhost默认打开的是安装路径下index.html 也就是路径F:\softw ...

  6. c#选择文件文件夹

    C#选择文件 OpenFileDialog fileDialog = new OpenFileDialog(); fileDialog.InitialDirectory = "C://&qu ...

  7. 关于post请求超出最大长度

    这是因为asp.net默认限制最大上传文件大小为4096kb,而我上传了6000kb+所以超出了限制,需要修改项目的web.config文件即可解决,可以将最大文件长度设置为你需要的长度,我这里设置为 ...

  8. WebService 不依赖配置文件直接在构造函数配置地址

    研究了下 ClientBase(Binding binding, EndpointAddress remoteAddress) 这个重载更好用,都不用填名称比如 new PAS.WebService. ...

  9. C# 更新SQL Server数据库备注信息从另一数据库

    using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; usin ...

  10. javascript标识符

    标识符,就是指变量.函数.属性的名字,或者函数的参数. 规则 1.第一个字符必须是一个字母.下划线或是美元符号($) 2.其他字符可以是字母.下划线.美元符号或数字 3.不能是关键字和保留字 4.区分 ...