protected function get_parent_path($path) {
        if (!isset($this->parentcache[$path])) {
            $this->parentcache[$path] = progressive_parser::dirname($path);
            $this->parentcacheavailablesize--;
            if ($this->parentcacheavailablesize < 0) {
                // Older first is cheaper than LRU.  We use 10% as items are grouped together and the large quiz
                // restore from MDL-40585 used only 600 parent paths. This is an XML heirarchy, so common paths
                // are grouped near each other. eg; /question_bank/question_category/question/element. After keeping
                // question_bank paths in the cache when we move to another area and the question_bank cache is not
                // useful any longer.
                $this->parentcache = array_slice($this->parentcache, 200, null, true);
                $this->parentcacheavailablesize += 200;
            }
        }
        return $this->parentcache[$path];
    }
protected function get_parent_path($path) {
        if (!isset($this->parentcache[$path])) {
            $this->parentcache[$path] = progressive_parser::dirname($path);
            $this->parentcacheavailablesize--;
            if ($this->parentcacheavailablesize < 0) {
                // Older first is cheaper than LRU.  We use 10% as items are grouped together and the large quiz
                // restore from MDL-40585 used only 600 parent paths. This is an XML heirarchy, so common paths
                // are grouped near each other. eg; /question_bank/question_category/question/element. After keeping
                // question_bank paths in the cache when we move to another area and the question_bank cache is not
                // useful any longer.
                $this->parentcache = array_slice($this->parentcache, 200, null, true);
                $this->parentcacheavailablesize += 200;
            }
        }
        return $this->parentcache[$path];
    }
protected function get_parent_path ( $ path ) { if ( ! isset ( $ this -> parentcache [ $ path ] ) ) { $ this -> parentcache [ $ path ] = progressive_parser :: dirname ( $ path ) ; $ this -> parentcacheavailablesize -- ; if ( $ this -> parentcacheavailablesize < 0 ) { // Older first is cheaper than LRU.  We use 10% as items are grouped together and the large quiz // restore from MDL-40585 used only 600 parent paths. This is an XML heirarchy, so common paths // are grouped near each other. eg; /question_bank/question_category/question/element. After keeping // question_bank paths in the cache when we move to another area and the question_bank cache is not // useful any longer. $ this -> parentcache = array_slice ( $ this -> parentcache , 200 , null , true ) ; $ this -> parentcacheavailablesize += 200 ; } } return $ this -> parentcache [ $ path ] ; }
Get the parent path using a local cache for performance.

@param $path string The pathname you wish to obtain the parent name for.
@return string The parent pathname.
Get the parent path using a local cache for performance .