/**
  * @see   ICache::set();
  * @param string $key
  * @param string $content
  * @param null $expire
  * @return int
  */
 public function set($key, $content, $expire = 0)
 {
     $cacheFile = $this->getCacheFile($key);
     $dirname = dirname($cacheFile);
     if (!file_exists($dirname)) {
         FileUtils::makeFileDirs($dirname);
     }
     $data['expire'] = $expire;
     $data['data'] = $content;
     return file_put_contents($cacheFile, StringUtils::jsonEncode($data), LOCK_EX);
 }