CStatePersister

NamestatePersister
ClassCStatePersister
Location/home/vhosts/app-manager.eu5.org/framework/base/CStatePersister.php
CStatePersister implements a file-based persistent data storage.

It can be used to keep data available through multiple requests and sessions. By default, CStatePersister stores data in a file named 'state.bin' that is located under the application {@link CApplication::getRuntimePath runtime path}. You may change the location by setting the {@link stateFile} property. To retrieve the data from CStatePersister, call {@link load()}. To save the data, call {@link save()}. Comparison among state persister, session and cache is as follows:
  • session: data persisting within a single user session.
  • state persister: data persisting through all requests/sessions (e.g. hit counter).
  • cache: volatile and fast storage. It may be used as storage medium for session or state persister.
Since server resource is often limited, be cautious if you plan to use CStatePersister to store large amount of data. You should also consider using database-based persister to improve the throughput. CStatePersister is a core application component used to store global application state. It may be accessed via {@link CApplication::getStatePersister()}. page state persistent method based on cache.

Options

Displaying 1-3 of 3 results.
NameValueDescriptionType
stateFilenullThe file path storing the state data. Make sure the directory containing the file exists and is writable by the Web server process. If using relative path, also make sure the path is correct.string
cacheID'cache'The ID of the cache application component that is used to cache the state values. Defaults to 'cache' which refers to the primary cache application component. Set this property to false if you want to disable caching state values.string
behaviorsarray()The behaviors that should be attached to this component. The behaviors will be attached to the component when {@link init} is called. Please refer to {@link CModel::behaviors} on how to specify the value of this property.array
Free Web Hosting