<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Config; abstract class MConfig { public abstract function get($rvTrU, $K5eKM = '', $ewYo6 = true); public abstract function set($rvTrU, $gwXrh); public abstract function remove($rvTrU); public abstract function has($rvTrU); public function getWithEnv($rvTrU, $K5eKM = null) { goto wKr5T; wKr5T: $gwXrh = config('env.CONFIG_' . $rvTrU); goto sZltm; jniEE: return $gwXrh; goto DYxaB; P5xBx: if (empty($gwXrh)) { return $K5eKM; } goto jniEE; sZltm: if (null === $gwXrh) { $gwXrh = $this->get($rvTrU); } goto P5xBx; DYxaB: } public function setArray($rvTrU, $gwXrh) { $this->set($rvTrU, json_encode($gwXrh)); } public function getArray($rvTrU, $K5eKM = array(), $ewYo6 = true) { goto Ryibo; no1g8: if (!is_array($gwXrh) || empty($gwXrh)) { $gwXrh = array(); } goto N6KTW; Ryibo: $gwXrh = $this->get($rvTrU, json_encode($K5eKM), $ewYo6); goto VYzEk; N6KTW: return $gwXrh; goto wEfQ3; VYzEk: $gwXrh = @json_decode($gwXrh, true); goto no1g8; wEfQ3: } public function getBoolean($rvTrU, $K5eKM = false) { goto lPxFI; RtR9i: return $gwXrh ? true : false; goto bs5r0; EYwkf: if (null === $gwXrh) { return $K5eKM; } goto RtR9i; lPxFI: $gwXrh = $this->get($rvTrU, null); goto EYwkf; bs5r0: } public function getInteger($rvTrU, $K5eKM = 0) { goto LcgLM; RIsWH: if (null === $gwXrh) { return $K5eKM; } goto ncnyi; LcgLM: $gwXrh = $this->get($rvTrU, null); goto RIsWH; ncnyi: return intval($gwXrh); goto PNQvT; PNQvT: } public function getString($rvTrU, $K5eKM = '') { goto DIflc; XP1Qz: return '' . $gwXrh; goto ArMKt; DIflc: $gwXrh = $this->get($rvTrU, null); goto UAYOp; UAYOp: if (null === $gwXrh) { return $K5eKM; } goto XP1Qz; ArMKt: } }