Back to FileStorage class

Method unlock

public bool
unlock
(mixed $id, mixed $group = null)
Unlock cached item
Parameters
  • string $id The cache data ID
  • string $group The cache data group
Returns
  • bool
Since
  • 1.7.0
Class: FileStorage
Project: Joomla

Method unlock - Source code

/**
 * Unlock cached item
 *
 * @param   string  $id     The cache data ID
 * @param   string  $group  The cache data group
 *
 * @return  boolean
 *
 * @since   1.7.0
 */
public function unlock($id, $group = null)
{
    $path = $this->_getFilePath($id, $group);
    if (isset($this->_locked_files[$path])) {
        $ret = (bool) @flock($this->_locked_files[$path], LOCK_UN);
        @fclose($this->_locked_files[$path]);
        unset($this->_locked_files[$path]);
        return $ret;
    }
    return true;
}