<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                config:cache 后就肯定讀不到了,config:clear 后就可以了,當然這里有一個前提,調用 env 函數的地方是在業務代碼里,而非 config/* 文件中。 然后我去翻了一下文檔,發現其實在 laravel 的 5.2 升級日志中有這么一段: If you are using the config:cache command during deployment, you must make sure that you are only calling the env function from within your configuration files, and not from anywhere else in your application. If you are calling env from within your application, it is strongly recommended you add proper configuration values to your configuration files and call env from that location instead, allowing you to convert your env calls to config calls. 其實就是下面這段代碼的意思,相信聰明的你一眼就看懂了: ![](https://box.kancloud.cn/6e57493279617318fe7469391e7878db_1172x946.jpg) 這是框架核心啟動文件類 Illuminate\Foundation\Bootstrap\LoadEnvironmentVariables 的 boot 方法,從 20 行我們可以發現,一旦緩存了配置以后,就不會再從 .env 文件加載內容了,所以你在業務代碼中使用 env 函數時已經無法讀取 .env 中設定的內容了,但是其它環境變量不影響哦。那為啥配置文件的可以呢?因為配置文件緩存的時候會加載 .env 然后讀取值緩存配置內容。 那怎么辦呢?上面的官方說明已經告訴我們了:在配置文件創建對應的配置項,比如我們第三方服務可以放到 config/services.php 中,在配置里使用 env 讀取,然后把從 env 函數讀取的地方改成 config('services.juhe.app_key') 這樣來避免這個問題。 其實作者這樣做是有道理的,畢竟 .env 文件是文本內容,解析它的成本還是挺高的。所以請小心不要入這個坑哦。
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看