GBContent::writeCache PHP Méthode

writeCache() public méthode

public writeCache ( )
    function writeCache()
    {
        gb::event('will-write-object-cache', $this);
        $path = gb::$site_dir . '/.git/info/gitblog/' . $this->cachename();
        $dirname = dirname($path);
        if (!is_dir($dirname)) {
            $p = gb::$site_dir . '/.git/info';
            $parts = array_merge(array('gitblog'), explode('/', trim(dirname($this->cachename()), '/')));
            foreach ($parts as $part) {
                $p .= '/' . $part;
                @mkdir($p, 0775);
                @chmod($p, 0775);
            }
        }
        $bw = file_put_contents($path, serialize($this), LOCK_EX);
        chmod($path, 0664);
        gb::event('did-write-object-cache', $this);
        return $bw;
    }