Beispiel #1
0
 /**
  * @covers \Glue\Storage\Index::save
  */
 public function testSave()
 {
     $data = implode(' ', $this->faker->sentences());
     $result = $this->index->save($this->faker->uuid, $this->testData['length'], strlen($data));
     $this->assertNotEquals(false, $result);
     $this->assertInternalType('int', $result);
 }
Beispiel #2
0
 /**
  * Saves item to storage
  *
  * @param  string          $name
  * @param  string          $value
  * @param  array           $meta
  * @return boolean|integer
  */
 public function save($name, $value, array $meta = array())
 {
     $key = $this->getKey($name);
     $index = $this->blob->save($value);
     $meta['mime-type'] = $this->getMimeType($value);
     if (false !== $index && false !== $this->index->save($key, $index[0], $index[1], serialize($meta))) {
         return $index[1];
     }
     return false;
 }