*/
class ReferenceLinkDB
{
- private $links = array();
- private $publicCount = 0;
- private $privateCount = 0;
+ private $_links = array();
+ private $_publicCount = 0;
+ private $_privateCount = 0;
/**
* Populates the test DB with reference data
'Richard Stallman and the Free Software Revolution',
0,
'20150310_114633',
- 'free gnu software stallman'
+ 'free gnu software stallman -exclude'
);
$this->addLink(
'linkdate' => $date,
'tags' => $tags,
);
- $this->links[$date] = $link;
+ $this->_links[$date] = $link;
if ($private) {
- $this->privateCount++;
+ $this->_privateCount++;
return;
}
- $this->publicCount++;
+ $this->_publicCount++;
}
/**
* Writes data to the datastore
*/
- public function write($filename, $prefix, $suffix)
+ public function write($filename)
{
file_put_contents(
$filename,
- $prefix.base64_encode(gzdeflate(serialize($this->links))).$suffix
+ '<?php /* '.base64_encode(gzdeflate(serialize($this->_links))).' */ ?>'
);
}
*/
public function countLinks()
{
- return $this->publicCount + $this->privateCount;
+ return $this->_publicCount + $this->_privateCount;
}
/**
*/
public function countPublicLinks()
{
- return $this->publicCount;
+ return $this->_publicCount;
}
/**
*/
public function countPrivateLinks()
{
- return $this->privateCount;
+ return $this->_privateCount;
+ }
+
+ public function getLinks()
+ {
+ return $this->_links;
}
}
-?>