data_read( array( "table_name" => "config", "index_name" => "key", "index_value" => $key ) ) ) === false ) return false; if(isset($config["value"])) $value = $config["value"]; } else{ $value = array(); if( ( $config_list = $this->data_list( array( "table_name" => "config", "index_name" => "key" ) ) ) === false ) return false; foreach($config_list["list"] as $config) $value[$config["key"]] = $config["value"]; } return $value; } public function config_exists($key){ if( ( $config = $this->data_read( array( "table_name" => "config", "index_name" => "key", "index_value" => $key ) ) ) === false ) return false; return $config ? 1 : 0; } public function set_config($key, $value){ if( ( $config = $this->data_read( array( "table_name" => "config", "index_name" => "key", "index_value" => $key ) ) ) === false ) return false; if($config){ return $this->data_update( array( "table_name" => "config", "index_name" => "key", "index_value" => $key, "values" => array( "value" => $value ) ) ); } else{ return $this->data_insert( array( "table_name" => "config", "values" => array( "key" => $key, "value" => $value ) ) ); } } public function del_config($key){ return $this->data_delete( array( "table_name" => "config", "index_name" => "key", "index_value" => $key ) ); } }