{% else-1 %}
(3 фев 2016, 01:52) (0/0) [0]
mapper, Вот всегда найдется тело, которое начнет докапыватся до ошибки *
(3 фев 2016, 01:44) (0/1) [-1]
На*

<?
class setting{

public function __construct($url){

$this -> file = $url;
$this -> content = json_decode(file_get_contents($url));
$this -> edit = false;

}

public function set($con, $new = 'none'){

if ($new != 'none' || !isset($this -> content[$con])){
$this -> content[$con] = $new;
$this -> edit = true;
}
return $this -> content[$con];

}


public function __destruct(){

if ($this -> edit){
unlinc($this->file);
file_put_contents(json_encode($this->content));
}

}
}
?>
  • 1 из 1