public function codeDigest($content) { $formula = $this->getAndCheckFolder(com_wiris_plugin_api_ConfigurationKeys::$FORMULA_FOLDER); $digest = com_wiris_system_Md5Tools::encodeString($content); $store = com_wiris_util_sys_Store::newStoreWithParent(com_wiris_util_sys_Store::newStore($formula), $digest . ".ini"); $store->write($content); return $digest; }
public function decodeDigest($digest) { $formula = $this->getAndCheckFolder(com_wiris_plugin_api_ConfigurationKeys::$FORMULA_FOLDER); $store = $this->getFileStore($formula, $digest, "ini"); if (com_wiris_plugin_impl_FolderTreeStorageAndCache::$backwards_compat) { if (!$store->exists()) { $oldstore = com_wiris_util_sys_Store::newStore($formula . "/" . $digest . ".ini"); $parent = $store->getParent(); $parent->mkdirs(); $oldstore->moveTo($store); } } return $store->read(); }
static function newStoreWithParent($store, $str) { return com_wiris_util_sys_Store::newStore($store->getFile() . "/" . $str); }