Code Monkey home page Code Monkey logo

study-tour's Introduction

环境变量配置文件

请将.env.example文件拷贝并命名为.env

.env文件为各环境的本地配置, 用于定义环境标识符及敏感数据(数据库ip,密码...)等. 该配置文件也可能被用于其他组件(非PHP),请谨慎删除配置项. 该文件须加入.gitignore忽略名单.

以下文件根据.env文件中定义的environment变量动态加载.用于定义各环境非敏感数据的配置, 如: 开发环境设置错误邮件接收者仅为自己而生产需要设置其他接收者; 开发及测试环境需要设置debug模式而生产不需要等等. 请不要将这些文件(如有更多环境可相应增加)加入.gitignore忽略名单

  • .env.dev 开发环境
  • .env.test 测试环境(251)
  • .env.sim 仿真环境(76)
  • .env.real 准生产环境
  • .env.pro 生产环境

项目中可使用getenv()或env()函数获取配置项, env()自动根据值转换了类型, 如数值将自动转为整形,请注意. 请参阅 https://github.com/vlucas/phpdotenv

study-tour's People

Contributors

cookchen233 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.