本文整理汇总了PHP中CHttpSession::setSavePath方法的典型用法代码示例。如果您正苦于以下问题:PHP CHttpSession::setSavePath方法的具体用法?PHP CHttpSession::setSavePath怎么用?PHP CHttpSession::setSavePath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CHttpSession
的用法示例。
在下文中一共展示了CHttpSession::setSavePath方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setSavePath
/**
* @see yii/CHttpSession::setSavePath()
*/
public function setSavePath($value)
{
if (($value = realpath($value)) === false || !is_dir($value) || !is_writable($value)) {
throw new CException(Yii::t('yii', 'Application runtime path "{path}" is not valid. Please make sure it is a directory writable by the Web server process.', array('{path}' => $value)));
}
parent::setSavePath($value);
}
示例2: defined
// change the following paths if necessary
$yii = $curr . '/yii/framework/yii.php';
$config = $curr . '/protected/config/production.php';
// specify how many levels of call stack should be shown in each log message
defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL', 3);
} else {
$config = $curr . '/protected/config/main.php';
// remove the following lines when in production mode
defined('YII_DEBUG') or define('YII_DEBUG', true);
// specify how many levels of call stack should be shown in each log message
defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL', 3);
}
require_once $yii;
Yii::createWebApplication($config);
/**
* SET WITH YOUR VALUE ------------------------
* decide your own PATH here
* for description then you need to read kcfinder manual
*/
$uploadURL = Yii::app()->baseUrl . '/..' . Yii::app()->params['fileDownloadPath'];
$uploadDir = dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . Yii::app()->params['fileDownloadPath'];
$session = new CHttpSession();
$session->setSavePath(Yii::app()->session->savePath);
$session->open();
$session['KCFINDER'] = array();
$session['KCFINDER'] = array('disabled' => !UserIdentity::canBrowseServer(), 'uploadURL' => $uploadURL, 'uploadDir' => $uploadDir);
// then back to our path
chdir($current_cwd);
spl_autoload_unregister(array('YiiBase', 'autoload'));
spl_autoload_register('__autoload');
spl_autoload_register(array('YiiBase', 'autoload'));