NUMBER_OF_BINS
NUMBER_OF_BINS
Total number of bins to cycle between
Library of functions used to implement a simple file cache
fileGetContents(string $filename, boolean $force_read = false) : string
Either a wrapper for file_get_contents, or if a WebSite object is being used to serve pages, it reads it in using blocking I/O file_get_contents() and caches it before return its string contents.
Note this function assumes that only the web server is performing I/O with this file. filemtime() can be used to see if a file on disk has been changed and then you can use $force_read = true below to force re- reading the file into the cache
string | $filename | name of file to get contents of |
boolean | $force_read | whether to force the file to be read from presistent storage rather than the cache |
contents of the file given by $filename
filePutContents(string $filename, string $data)
Either a wrapper for file_put_contents, or if a WebSite object is being used to serve pages, writes $data to the persistent file with name $filename. Saves a copy in the RAM cache if there is a copy already there.
string | $filename | name of file to write to persistent storages |
string | $data | string of data to store in file |
updateCache(string $key)
Used to mark a cache item, and keep track of rounds according to the marker algorith. This function determine if the cache is too full and if so eject an item.
string | $key | that was just read from or written to. Might need to be marked according to Marker algorithm |