<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>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                ~~~ <?php /** * Created by PhpStorm. * User: 小灰灰 * Date: 2022-04-26 * Time: 21:53:40 * Info: */ namespace support\lib; Env::load(); class Env { /** * 環境變量數據 * @var array */ protected static $data = []; /** * 讀取環境變量定義文件 * @access public * * @param string $file 環境變量定義文件 * * @return void */ public static function load($file = '.env') { if ( ! is_file($file)) { return; } $env = parse_ini_file($file, true); self::set($env); } /** * 獲取環境變量值 * @access public * * @param string $name 環境變量名 * @param mixed $default 默認值 */ public static function get($name = null, $default = null) { if ($name == null) { return self::$data; } $name = strtoupper($name); $name = strtoupper(str_replace('.', '_', $name)); if (isset(self::$data[$name])) { return self::$data[$name]; } return $default; } /** * 設置環境變量值 * @access public * * @param string|array $env 環境變量 * @param mixed $value 值 * * @return void */ public static function set($env, $value = null) { if (is_array($env)) { $env = array_change_key_case($env, CASE_UPPER); foreach ($env as $key => $val) { if (is_array($val)) { foreach ($val as $k => $v) { self::$data[$key.'_'.strtoupper($k)] = $v; } } else { self::$data[$key] = $val; } } } else { $name = strtoupper(str_replace('.', '_', $env)); self::$data[$name] = $value; } } } ~~~ 使用方法: ~~~ use support\lib\Env; Env::get('SQL.DB_DEFAULT', 'mysql') ~~~ .env文件: ~~~ [SQL] DB_DEFAULT = mysql HOSTNAME = 127.0.0.1 DATABASE = database DBNAME = root DBPASS = 123456 HOSTPOINT = 3306 PREFIX = cmf_ ~~~
                  <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>

                              哎呀哎呀视频在线观看