本文整理汇总了PHP中SessionUtil::start方法的典型用法代码示例。如果您正苦于以下问题:PHP SessionUtil::start方法的具体用法?PHP SessionUtil::start怎么用?PHP SessionUtil::start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SessionUtil
的用法示例。
在下文中一共展示了SessionUtil::start方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: restart
public static function restart()
{
SessionUtil::clear();
SessionUtil::destroy();
SessionUtil::start();
}
示例2: ini_set
<?php
ini_set('display_errors', 1);
error_reporting(E_ALL);
require_once './Config.php';
require_once './lib/DB/Database.php';
require_once './lib/Site/Page.php';
require_once './lib/Site/StandardLayout.php';
require_once './lib/Site/StandardNavigation.php';
require_once './lib/Util/Context.php';
require_once './lib/Util/SessionUtil.php';
if (!SessionUtil::start()) {
echo "Error Starting Session";
}
Database::Open();
$context = new Context();
$context->setPageID("home");
if (isset($_GET['pageid'])) {
$context->setPageID($_GET['pageid']);
} else {
if (isset($_POST['pageid'])) {
$context->setPageID($_POST['pageid']);
}
}
if (isset($_POST['action'])) {
$action = $_POST['action'];
if ($context->getPageID() == "login") {
require_once './lib/Form/LoginHandler.php';
$loginHandler = new LoginHandler();
$loginHandler->handleForm($context, $action);
} else {
示例3: SimpleImage
<?php
require_once './config.php';
require_once './lib/DB/Database.php';
require_once './lib/DB/Equipment.php';
require_once './lib/DB/EquipmentDao.php';
require_once './lib/Util/DateUtil.php';
require_once './lib/Util/SimpleImage.php';
require_once './lib/Util/SessionUtil.php';
Database::Open();
SessionUtil::start();
if (isset($_GET['equipId'])) {
$equipment = EquipmentDao::getEquipmentByID($_GET['equipId']);
if (!$equipment) {
$image = new SimpleImage();
$image->load("./images/notfound.png");
header('Content-Type: image/png');
echo $image->output();
Database::Close();
exit;
} else {
if (file_exists("./images/" . $equipment->picture)) {
$image_info = getimagesize("./images/" . $equipment->picture);
$image_type = $image_info[2];
if ($image_type == IMAGETYPE_JPEG) {
header('Content-Type: image/jpeg');
} elseif ($image_type == IMAGETYPE_GIF) {
header('Content-Type: image/gif');
} elseif ($image_type == IMAGETYPE_PNG) {
header('Content-Type: image/png');
}