Skip to content

Commit

Permalink
Fix for phpfiwa phpfina & phptimestore data file ownership bug
Browse files Browse the repository at this point in the history
  • Loading branch information
TrystanLea committed Mar 27, 2014
1 parent be26c22 commit 55d2419
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
5 changes: 5 additions & 0 deletions Modules/feed/engine/PHPFina.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@ public function create($id,$options)

// Save meta data
$this->set_meta($id,$meta);

$fh = fopen($this->dir.$meta->id.".dat", 'c+');
fclose($fh);
}



$feedname = "$id.meta";
if (file_exists($this->dir.$feedname)) return true;
Expand Down
14 changes: 10 additions & 4 deletions Modules/feed/engine/PHPFiwa.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@ public function create($id,$options)
{
$interval = (int) $options['interval'];
if ($interval<5) $interval = 5;





// Check to ensure we dont overwrite an existing feed
if (!$meta = $this->get_meta($id))
{
Expand Down Expand Up @@ -74,6 +71,15 @@ public function create($id,$options)

// Save meta data
$this->set_meta($id,$meta);

$fh = fopen($this->dir.$meta->id."_0.dat", 'c+');
fclose($fh);
$fh = fopen($this->dir.$meta->id."_1.dat", 'c+');
fclose($fh);
$fh = fopen($this->dir.$meta->id."_2.dat", 'c+');
fclose($fh);
$fh = fopen($this->dir.$meta->id."_3.dat", 'c+');
fclose($fh);
}

$feedname = "$id.meta";
Expand Down
5 changes: 5 additions & 0 deletions Modules/feed/engine/PHPTimestore.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ public function create($feedid,$options)

// Save meta data
$this->save_meta($feedid,$meta);

for ($l=0; $l<6; $l++) {
$fh = fopen($this->dir.str_pad($meta->feedid, 16, '0', STR_PAD_LEFT)."_".$l."_.dat", 'c+');
fclose($fh);
}
}

if (file_exists($this->dir.str_pad($feedid, 16, '0', STR_PAD_LEFT).".tsdb")) return true;
Expand Down

0 comments on commit 55d2419

Please sign in to comment.