CStatePersister
Name | statePersister |
---|---|
Class | CStatePersister |
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:
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.
Options
Displaying 1-3 of 3 results.
Name | Value | Description | Type |
---|---|---|---|
stateFile | null | The 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 |
behaviors | array() | 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 |