REDROOM
PHP 8.1.33
Path:
Logout
Edit File
Size: 3.73 KB
Close
/home/jambtst2015/www/framework/base/CStatePersister.php
Text
Base64
<?php /** * This file contains classes implementing security manager feature. * * @author Qiang Xue <qiang.xue@gmail.com> * @link http://www.yiiframework.com/ * @copyright 2008-2013 Yii Software LLC * @license http://www.yiiframework.com/license/ */ /** * 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: * <ul> * <li>session: data persisting within a single user session.</li> * <li>state persister: data persisting through all requests/sessions (e.g. hit counter).</li> * <li>cache: volatile and fast storage. It may be used as storage medium for session or state persister.</li> * </ul> * * 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. * * @author Qiang Xue <qiang.xue@gmail.com> * @package system.base * @since 1.0 */ class CStatePersister extends CApplicationComponent implements IStatePersister { /** * @var string 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. */ public $stateFile; /** * @var string 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. */ public $cacheID='cache'; /** * Initializes the component. * This method overrides the parent implementation by making sure {@link stateFile} * contains valid value. */ public function init() { parent::init(); if($this->stateFile===null) $this->stateFile=Yii::app()->getRuntimePath().DIRECTORY_SEPARATOR.'state.bin'; $dir=dirname($this->stateFile); if(!is_dir($dir) || !is_writable($dir)) throw new CException(Yii::t('yii','Unable to create application state file "{file}". Make sure the directory containing the file exists and is writable by the Web server process.', array('{file}'=>$this->stateFile))); } /** * Loads state data from persistent storage. * @return mixed state data. Null if no state data available. */ public function load() { $stateFile=$this->stateFile; if($this->cacheID!==false && ($cache=Yii::app()->getComponent($this->cacheID))!==null) { $cacheKey='Yii.CStatePersister.'.$stateFile; if(($value=$cache->get($cacheKey))!==false) return unserialize($value); elseif(($content=@file_get_contents($stateFile))!==false) { $cache->set($cacheKey,$content,0,new CFileCacheDependency($stateFile)); return unserialize($content); } else return null; } elseif(($content=@file_get_contents($stateFile))!==false) return unserialize($content); else return null; } /** * Saves application state in persistent storage. * @param mixed $state state data (must be serializable). */ public function save($state) { file_put_contents($this->stateFile,serialize($state),LOCK_EX); } }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 17
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
CApplication.php
31.03 KB
lrw-r--r--
2024-11-22 17:53:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
CApplicationComponent.php
1.93 KB
lrw-r--r--
2024-11-22 17:53:15
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
CBehavior.php
3.24 KB
lrw-r--r--
2024-11-22 17:53:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
CComponent.php
21.98 KB
lrw-r--r--
2024-11-22 17:53:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
CErrorEvent.php
1.04 KB
lrw-r--r--
2024-11-22 17:53:15
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
CErrorHandler.php
16.49 KB
lrw-r--r--
2024-11-22 17:53:15
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
CException.php
410 B
lrw-r--r--
2024-11-22 17:53:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
CExceptionEvent.php
785 B
lrw-r--r--
2024-11-22 17:53:15
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
CHttpException.php
990 B
lrw-r--r--
2024-11-22 17:53:15
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
CModel.php
20.01 KB
lrw-r--r--
2024-11-22 17:53:15
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
CModelBehavior.php
2.04 KB
lrw-r--r--
2024-11-22 17:53:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
CModelEvent.php
1013 B
lrw-r--r--
2024-11-22 17:53:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
CModule.php
16.65 KB
lrw-r--r--
2024-11-22 17:53:15
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
CSecurityManager.php
17.32 KB
lrw-r--r--
2024-11-22 17:53:15
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
CStatePersister.php
3.73 KB
lrw-r--r--
2024-11-22 17:53:15
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
error_log
134.43 KB
lrw-r--r--
2025-11-05 01:03:20
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
interfaces.php
22.32 KB
lrw-r--r--
2024-11-22 17:53:15
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).