<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Config; use ModStart\Core\Util\SerializeUtil; abstract class MConfig { public abstract function get($oMJcb, $Z1lY2 = '', $vy0W0 = true); public abstract function set($oMJcb, $cBDsM); public abstract function remove($oMJcb); public abstract function has($oMJcb); public abstract function all($hyTx0 = null); public function getWithEnv($oMJcb, $Z1lY2 = null) { goto N4c4D; aHCyK: if (empty($cBDsM)) { return $Z1lY2; } goto E9f8G; E9f8G: return $cBDsM; goto fBqkE; N4c4D: $cBDsM = config('env.CONFIG_' . $oMJcb); goto mytVA; mytVA: if (null === $cBDsM) { $cBDsM = $this->get($oMJcb); } goto aHCyK; fBqkE: } public function setArray($oMJcb, $cBDsM) { $this->set($oMJcb, SerializeUtil::jsonEncode($cBDsM)); } public function getArray($oMJcb, $Z1lY2 = array(), $vy0W0 = true) { goto lidi_; lidi_: $cBDsM = $this->get($oMJcb, SerializeUtil::jsonEncode($Z1lY2), $vy0W0); goto Ljyh5; Ljyh5: $cBDsM = @json_decode($cBDsM, true); goto SZRnW; SZRnW: if (!is_array($cBDsM) || empty($cBDsM)) { $cBDsM = array(); } goto x77_k; x77_k: return $cBDsM; goto TRmdl; TRmdl: } public function getBoolean($oMJcb, $Z1lY2 = false) { goto DMn93; CveRu: if (null === $cBDsM) { return $Z1lY2; } goto N4MV_; DMn93: $cBDsM = $this->get($oMJcb, null); goto CveRu; N4MV_: return $cBDsM ? true : false; goto PCZgC; PCZgC: } public function getInteger($oMJcb, $Z1lY2 = 0) { goto YJkgf; joHYc: if (null === $cBDsM) { return $Z1lY2; } goto LveV8; YJkgf: $cBDsM = $this->get($oMJcb, null); goto joHYc; LveV8: return intval($cBDsM); goto xLOuS; xLOuS: } public function getString($oMJcb, $Z1lY2 = '') { goto XShmO; XShmO: $cBDsM = $this->get($oMJcb, null); goto dD7kU; dD7kU: if (null === $cBDsM) { return $Z1lY2; } goto VZzwu; VZzwu: return '' . $cBDsM; goto m5jA_; m5jA_: } }