b2evolution

Multilingual multiuser multiblog engine

b2evolution Technical Documentation (CVS HEAD) [ class tree: evocore ] [ index: evocore ] [ all elements ]

Class: BlockCache

Source Location: /blogs/inc/_core/model/_blockcache.class.php

Class BlockCache

Property Summary
mixed   $cached_page_content   Progressively caching the content of the current page:
mixed   $is_collecting   Are we currently recording cache contents
mixed   $keys  
mixed   $output_chunk_size   After how many bytes should we output sth live while collecting cache content:
mixed   $serialized_keys  
mixed   $type  

[ Top ]
Method Summary
BlockCache   BlockCache()   Constructor
void   abort_collect()   We are going to output personal data and we want to abort collecting the data for the cache.
void   cacheproviderretrieve()   put your comment there...
void   cacheproviderstore()   put your comment there...
true   check()   Check if cache contents are available, otherwise start collecting output to be cached
void   end_collect()   End collecting output to be cached
void   invalidate_key()   Invalidate a special key
void   output_handler()   This is called every x bytes to provide real time output
boolean   retrieve()   Retrieve and output cache

[ Top ]
Properties
mixed   $cached_page_content = '' [line 50]

Progressively caching the content of the current page:


[ Top ]
mixed   $is_collecting = false [line 54]

Are we currently recording cache contents


[ Top ]
mixed   $keys [line 39]

[ Top ]
mixed   $output_chunk_size = 2000 [line 45]

After how many bytes should we output sth live while collecting cache content:


[ Top ]
mixed   $serialized_keys = '' [line 40]

[ Top ]
mixed   $type [line 38]

[ Top ]
Methods
Constructor BlockCache  [line 60]

  BlockCache BlockCache( $type, $keys  )

Constructor

Parameters:
   $type: 
   $keys: 


[ Top ]
abort_collect  [line 218]

  void abort_collect( )

We are going to output personal data and we want to abort collecting the data for the cache.



[ Top ]
cacheproviderretrieve  [line 289]

  void cacheproviderretrieve( mixed $key, &$success, mixed $success  )

put your comment there...

Parameters:
mixed   $key: 
mixed   $success: 
   &$success: 

Information Tags:
Todo:  dh> This method should get removed from here, it's not limited to BlockCache.

[ Top ]
cacheproviderstore  [line 265]

  void cacheproviderstore( mixed $key, mixed $payload  )

put your comment there...

Parameters:
mixed   $key: 
mixed   $payload: 

Information Tags:
Todo:  dh> This method should get removed from here, it's not limited to BlockCache.

[ Top ]
check  [line 110]

  true check( )

Check if cache contents are available, otherwise start collecting output to be cached

Basically we get all the invalidation dates we need, then we get the data and then we check if some invalidation occured after the data was cached. If an invalidation date is missing we consider the cache to be obsolete but we generate a new invalidation date for next time we try to retrieve.


API Tags:
Return:  if we found and have echoed content from the cache


[ Top ]
end_collect  [line 242]

  void end_collect( )

End collecting output to be cached

We just concatenate all the individual keys to have a single one Then we store with the current timestamp



[ Top ]
invalidate_key  [line 85]

  void invalidate_key( $key, $val  )

Invalidate a special key

All we do is store the timestamp of teh invalidation

Parameters:
   $key: 
   $val: 


[ Top ]
output_handler  [line 208]

  void output_handler( $buffer  )

This is called every x bytes to provide real time output

Parameters:
   $buffer: 


[ Top ]
retrieve  [line 158]

  boolean retrieve( [integer $oldest_acceptable_ts = NULL], [ $most_recent_invaliating_key = '']  )

Retrieve and output cache

Parameters:
integer   $oldest_acceptable_ts:  oldest acceptable timestamp
   $most_recent_invaliating_key: 

API Tags:
Return:  true if we could retrieve


[ Top ]

Documentation generated on Sat, 06 Mar 2010 04:01:30 +0100 by phpDocumentor 1.4.2. This site is hosted and maintained by Daniel HAHLER (Contact).