|
|
|
|
|
|
|
|
function get_config_from_content($string) { |
|
|
function get_config_from_content($string) { |
|
|
$f3 = \Base::instance(); |
|
|
$f3 = \Base::instance(); |
|
|
$f = 0; |
|
|
$f = 0; |
|
|
|
|
|
|
|
|
|
|
|
$tmp = null; |
|
|
|
|
|
|
|
|
$pattern = "/#\+(\w+):\s?(.*)/"; |
|
|
$pattern = "/#\+(\w+):\s?(.*)/"; |
|
|
$f = preg_match_all($pattern, $string,$matches,PREG_PATTERN_ORDER); |
|
|
$f = preg_match_all($pattern, $string,$matches,PREG_PATTERN_ORDER); |
|
|
for ($i=0;$i<$f;$i++) { |
|
|
for ($i=0;$i<$f;$i++) { |
|
|
|
|
|
|
|
|
$this->config[$key]=$value; |
|
|
$this->config[$key]=$value; |
|
|
} |
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
$this->config[$key]=$value; |
|
|
|
|
|
|
|
|
if (array_key_exists($key, $this->config)) { |
|
|
|
|
|
if (is_array($this->config[$key])) { |
|
|
|
|
|
$this->config[$key][]=$value; |
|
|
|
|
|
} else { |
|
|
|
|
|
$tmp = $this->config[$key]; |
|
|
|
|
|
$this->config[$key] = [$tmp,$value]; |
|
|
|
|
|
$tmp=null; |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
$this->config[$key]=$value; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|