<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Config; abstract class MConfig { public abstract function get($m1RYi, $r3J4G = '', $p2rqb = true); public abstract function set($m1RYi, $tzAUI); public abstract function remove($m1RYi); public function getWithEnv($m1RYi, $r3J4G = null) { goto aKn2V; M0XLQ: if (null === $tzAUI) { $tzAUI = $this->get($m1RYi); } goto cxR64; aKn2V: $tzAUI = config('env.CONFIG_' . $m1RYi); goto M0XLQ; cxR64: if (empty($tzAUI)) { return $r3J4G; } goto zL6Ie; zL6Ie: return $tzAUI; goto dNerr; dNerr: } public function setArray($m1RYi, $tzAUI) { $this->set($m1RYi, json_encode($tzAUI)); } public function getArray($m1RYi, $r3J4G = array(), $p2rqb = true) { goto uKH4B; SyqEu: if (!is_array($tzAUI) || empty($tzAUI)) { $tzAUI = array(); } goto gBJMX; gBJMX: return $tzAUI; goto FiN4e; urUGa: $tzAUI = @json_decode($tzAUI, true); goto SyqEu; uKH4B: $tzAUI = $this->get($m1RYi, json_encode($r3J4G), $p2rqb); goto urUGa; FiN4e: } public function getBoolean($m1RYi, $r3J4G = false) { goto lPKwq; lPKwq: $tzAUI = $this->get($m1RYi, null); goto tVnpp; tVnpp: if (null === $tzAUI) { return $r3J4G; } goto Yax2Z; Yax2Z: return $tzAUI ? true : false; goto pjel3; pjel3: } public function getInteger($m1RYi, $r3J4G = 0) { goto aa0_w; ufCDA: if (null === $tzAUI) { return $r3J4G; } goto O5vN3; aa0_w: $tzAUI = $this->get($m1RYi, null); goto ufCDA; O5vN3: return intval($tzAUI); goto MPOni; MPOni: } public function getString($m1RYi, $r3J4G = '') { goto tSR4D; bBucX: if (null === $tzAUI) { return $r3J4G; } goto tZkvE; tSR4D: $tzAUI = $this->get($m1RYi, null); goto bBucX; tZkvE: return '' . $tzAUI; goto jCn1A; jCn1A: } }