for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Sleepness\UberTranslationBundle\Storage;
use Symfony\Component\Config\Resource\ResourceInterface;
/**
* Wrapper under standard MongoClient
*
* @author Viktor Novikov <[email protected]>
*/
class UberMongo implements ResourceInterface, UberStorageInterface
{
* @var \MongoDB|null
private $mongoDB = null;
* {@inheritdoc}
public function setConnection($host = 'localhost', $port = '27017')
try {
$client = new \MongoClient("mongodb://$host:$port");
$this->mongoDB = new \MongoDB($client, 'uber_translations');
return true;
} catch (\Exception $exception) {
return false;
}
public function addItem($key, $value, $expiration = null)
// TODO: Implement addItem() method.
public function getItem($key)
// TODO: Implement getItem() method.
public function getAllKeys()
// TODO: Implement getAllKeys() method.
public function deleteItem($key)
// TODO: Implement deleteItem() method.
public function dropCache()
// TODO: Implement dropCache() method.
public function isFresh($timestamp)
// TODO: Implement isFresh() method.
public function getResource()
// TODO: Implement getResource() method.
public function __toString()
return 'uberMongo';