includes/sessions.php
changeset 156 edbff85d43e8
parent 142 ca9118d9c0f2
child 166 d53cc29308f4
child 174 4c5c2b66a34d
equal deleted inserted replaced
155:87bffacdfb92 156:edbff85d43e8
  2115     {
  2115     {
  2116       // Permissions table not yet initialized
  2116       // Permissions table not yet initialized
  2117       return false;
  2117       return false;
  2118     }
  2118     }
  2119     
  2119     
       
  2120     // cache of permission objects (to save RAM and SQL queries)
       
  2121     static $objcache = array();
       
  2122     
       
  2123     if ( count($objcache) == 0 )
       
  2124     {
       
  2125       foreach ( $paths->nslist as $key => $_ )
       
  2126       {
       
  2127         $objcache[$key] = array();
       
  2128       }
       
  2129     }
       
  2130     
       
  2131     if ( isset($objcache[$namespace][$page_id]) )
       
  2132     {
       
  2133       return $objcache[$namespace][$page_id];
       
  2134     }
       
  2135     
  2120     //if ( !isset( $paths->pages[$paths->nslist[$namespace] . $page_id] ) )
  2136     //if ( !isset( $paths->pages[$paths->nslist[$namespace] . $page_id] ) )
  2121     //{
  2137     //{
  2122     //  // Page does not exist
  2138     //  // Page does not exist
  2123     //  return false;
  2139     //  return false;
  2124     //}
  2140     //}
  2125     
  2141     
  2126     $object = new Session_ACLPageInfo( $page_id, $namespace, $this->acl_types, $this->acl_descs, $this->acl_deps, $this->acl_base_cache );
  2142     $objcache[$namespace][$page_id] = new Session_ACLPageInfo( $page_id, $namespace, $this->acl_types, $this->acl_descs, $this->acl_deps, $this->acl_base_cache );
       
  2143     $object =& $objcache[$namespace][$page_id];
  2127     
  2144     
  2128     return $object;
  2145     return $object;
  2129     
  2146     
  2130   }
  2147   }
  2131   
  2148