mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
Update to API 12
This commit is contained in:
parent
731ada7b38
commit
c59b4776ae
149 changed files with 6850 additions and 1918 deletions
|
|
@ -55,6 +55,13 @@ class PluginAPI extends stdClass{
|
|||
return $output;
|
||||
}
|
||||
|
||||
public function __destruct(){
|
||||
foreach($this->plugins as $p){
|
||||
$p[0]->__destruct();
|
||||
}
|
||||
unset($plugins);
|
||||
}
|
||||
|
||||
public function getList(){
|
||||
$list = array();
|
||||
foreach($this->plugins as $p){
|
||||
|
|
@ -206,11 +213,11 @@ class PluginAPI extends stdClass{
|
|||
}
|
||||
|
||||
public function readYAML($file){
|
||||
return Spyc::YAMLLoad(file_get_contents($file));
|
||||
return yaml_parse(preg_replace("#^([ ]*)([a-zA-Z_]{1}[^\:]*)\:#m", "$1\"$2\":", file_get_contents($file)));
|
||||
}
|
||||
|
||||
public function writeYAML($file, $data){
|
||||
return file_put_contents($file, Spyc::YAMLDump($data));
|
||||
return file_put_contents($file, yaml_emit($data, YAML_UTF8_ENCODING));
|
||||
}
|
||||
|
||||
public function init(){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue