本文整理汇总了PHP中fSession::setLength方法的典型用法代码示例。如果您正苦于以下问题:PHP fSession::setLength方法的具体用法?PHP fSession::setLength怎么用?PHP fSession::setLength使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fSession
的用法示例。
在下文中一共展示了fSession::setLength方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: error_reporting
<?php
error_reporting(E_ALL & ~E_NOTICE);
include __DIR__ . '/load_flourish.php';
include __DIR__ . '/load_plugins.php';
require __DIR__ . '/config.php';
require __DIR__ . '/core.php';
fSession::setPath(SESSIONS_PATH);
fSession::setLength('1 day 2 hours');
$db = new fDatabase('mysql', DB_NAME, DB_USER, DB_PASS, DB_HOST);
fAuthorization::setLoginPage(LOGIN_BASE);
示例2: ob_start
<?php
ob_start();
require_once 'config.php';
require_once 'user.php';
require_once 'transaction.php';
require_once 'card.php';
$db = new fDatabase('sqlite', dirname(__FILE__) . '/../var/database.db');
fORMDatabase::attach($db);
fSession::setLength('30 minutes', '1 week');
fSession::setPath(dirname(__FILE__) . '/../var/session');
if ($uid = fSession::get('user')) {
$user = new User($uid);
} else {
$user = null;
}
示例3: array
$tpl->set('footer', 'footer.php');
$tpl->set('menu', 'menu.php');
// @TODO remove these when the thresholds become configurable.
global $status;
$status[3] = array('OK', '73D216');
// 3+ OK
$status[2] = array('Low', 'EDD400');
// 2+ Warning
$status[0] = array('Critical', 'CC0000');
// 0: Empty - bad.
// Set up database connection
$db = new fDatabase('mysql', config_item('db_name'), config_item('db_user'), config_item('db_pass'), config_item('db_host'), config_item('db_port'));
fORMDatabase::attach($db);
// Configure session
fSession::setPath(config_item('session_path'));
fSession::setLength(config_item('session_length', '1 hour'));
fSession::open();
}
/**
* Automatically includes classes
*
* @throws Exception
*
* @param string $class_name Name of the class to load
* @return void
*/
function printmaster_autoload($class)
{
$flourish_file = DOC_ROOT . '/inc/flourish/' . $class . '.php';
if (file_exists($flourish_file)) {
return require $flourish_file;
示例4: dirname
$root = dirname(__FILE__);
require_once "{$root}/../etc/config.php";
require_once "{$root}/config.php";
require_once "{$root}/user.php";
require_once "{$root}/transaction.php";
require_once "{$root}/card.php";
require_once "{$root}/usersprofile.php";
require_once "{$root}/learning.php";
require_once "{$root}/alias.php";
require_once "{$root}/interest.php";
require_once "{$root}/calendar.php";
require_once "{$root}/project.php";
require_once "{$root}/gocardless-php/lib/GoCardless.php";
$db = new fDatabase('postgresql', $DB_NAME, $DB_USER, $DB_PASSWORD);
fORMDatabase::attach($db);
fSession::setLength('30 minutes', '10 weeks');
fSession::setPath(dirname(__FILE__) . '/../var/session');
if (isset($GOCARDLESS_CREDENTIALS)) {
GoCardless::set_account_details($GOCARDLESS_CREDENTIALS);
}
if ($uid = fSession::get('user')) {
$user = new User($uid);
} else {
$user = null;
}
function ensureLogin()
{
global $user;
if (!isset($user)) {
fURL::redirect("/login.php?forward={$_SERVER['REQUEST_URI']}");
}
示例5: dirname
<?php
include dirname(__FILE__) . '/config.php';
// Set page template
$tpl = new fTemplating(DOC_ROOT . '/views/template');
$tpl->set('header', 'header.php');
$tpl->set('footer', 'footer.php');
$tpl->set('menu', 'menu.php');
// Configure database
$db = new fDatabase('mysql', 'printmaster', 'root', '', 'localhost');
fORMDatabase::attach($db);
// Configure session
fSession::setPath(DOC_ROOT . '/session');
fSession::setLength('1 hour');
fSession::open();
示例6: fDatabase
<?php
require __DIR__ . '/translate.php';
fText::registerComposeCallback('pre', 'translate');
fSession::setBackend($cache, 'OJSESS');
fSession::setLength('1 day');
fSession::open();
// it clears all headers and will be destroyed if not necessary
fORMDatabase::attach(new fDatabase(DB_TYPE, DB_NAME, DB_USER, DB_PASS, DB_HOST));
if (ENABLE_SCHEMA_CACHING) {
fORM::enableSchemaCaching($cache);
}
fORMDatabase::retrieve()->registerHookCallback('run', 'profiler_log_sql');
fAuthorization::setLoginPage(SITE_BASE . '/login');