Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions codebase/base_connector.php
Original file line number Diff line number Diff line change
Expand Up @@ -700,6 +700,9 @@ protected function end_run(){
*/
public function set_encoding($encoding){
$this->encoding=$encoding;
if ($this->live_update !== false) {
$this->live_update->set_encoding($this->encoding);
}
}

/*! enable or disable dynamic loading mode
Expand Down Expand Up @@ -855,8 +858,9 @@ public function update($data) {
url used for update notifications
*/
public function enable_live_update($table, $url=false){
$this->live_update = new $this->live_update_data_type($this->sql, $this->config, $this->request, $table,$url, array("connector" => $this));
$this->live_update->set_event($this->event,$this->names["item_class"]);
$this->live_update = new $this->live_update_data_type($this->sql, $this->config, $this->request, $table,$url, array("connector" => $this));
$this->live_update->set_event($this->event,$this->names["item_class"]);
$this->live_update->set_encoding($this->encoding);
$this->event->attach("beforeOutput", Array($this->live_update, "version_output"));
$this->event->attach("beforeFiltering", Array($this->live_update, "get_updates"));
$this->event->attach("beforeProcessing", Array($this->live_update, "check_collision"));
Expand Down
23 changes: 14 additions & 9 deletions codebase/update.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,13 @@ class DataUpdate{

protected $table; //!< table , where actions are stored
protected $url; //!< url for notification service, optional
protected $sql; //!< DB wrapper object
protected $config; //!< DBConfig object
protected $request; //!< DBRequestConfig object
protected $event;
protected $item_class;
protected $demu;
protected $sql; //!< DB wrapper object
protected $config; //!< DBConfig object
protected $request; //!< DBRequestConfig object
protected $encoding="utf-8";
protected $event;
protected $item_class;
protected $demu;

//protected $config;//!< DataConfig instance
//protected $request;//!< DataRequestConfig instance
Expand Down Expand Up @@ -141,6 +142,10 @@ public function set_event($master, $name){
$this->event = $master;
$this->item_class = $name;
}

public function set_encoding($encoding){
$this->encoding = $encoding;
}

protected function select_update($actions_table, $join_table, $id_field_name, $version, $user) {
$sql = "SELECT $join_table.*, {$actions_table}.id, {$actions_table}.dataId, {$actions_table}.type as action_table_type, {$actions_table}.user FROM {$actions_table}";
Expand Down Expand Up @@ -218,8 +223,8 @@ public function get_updates() {
$output = $this->render_set($this->sql->select($sub_request), $this->item_class);

ob_clean();
header("Content-type:text/xml");
header("Content-type:text/xml; charset=".$this->encoding);

echo $this->updates_start();
echo $this->get_version();
echo $output;
Expand Down Expand Up @@ -342,4 +347,4 @@ protected function output($res){

}

?>
?>