本文整理匯總了PHP中session::getInstance方法的典型用法代碼示例。如果您正苦於以下問題:PHP session::getInstance方法的具體用法?PHP session::getInstance怎麽用?PHP session::getInstance使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類session
的用法示例。
在下文中一共展示了session::getInstance方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: execute
public function execute()
{
try {
if (request::getInstance()->isMethod('POST')) {
$id = request::getInstance()->getPost(usuarioTableClass::getNameField(usuarioTableClass::ID, true));
$password = request::getInstance()->getPost(usuarioTableClass::getNameField(usuarioTableClass::PASSWORD, true));
$rePassword = request::getInstance()->getPost(usuarioTableClass::getNameField(usuarioTableClass::SECOND_PASSWORD, true));
$idPregunta = request::getInstance()->getPost(usuarioTableClass::getNameField(usuarioTableClass::RESTAURAR_ID, true));
$respuesta = request::getInstance()->getPost(usuarioTableClass::getNameField(usuarioTableClass::RESPUESTA_SECRETA, true));
$flag = true;
if ($flag == true) {
request::getInstance()->setMethod('GET');
}
$ids = array(usuarioTableClass::ID => $id);
$data = array(usuarioTableClass::PASSWORD => md5($password), usuarioTableClass::RESTAURAR_ID => $idPregunta, usuarioTableClass::RESPUESTA_SECRETA => $respuesta);
usuarioTableClass::update($ids, $data);
routing::getInstance()->getUrlObj('shfSecurity', 'index');
} else {
routing::getInstance()->forward('recuperar', 'consultar');
}
} catch (PDOException $exc) {
session::getInstance()->setFlash('exc', $exc);
routing::getInstance()->forward('shfSecurity', 'exception');
}
}
示例2: validatCreate
public static function validatCreate($nombre, $apellidos, $cedula, $direccion, $telefono)
{
$flag = FALSE;
$patron = "^[a-zA-Z0-9]{3,20}\$";
if (!ereg($patron, $nombre)) {
session::getInstance()->setError('campo nombre no permite carateres especiales');
$flag = true;
session::getInstance()->setFirstCall(datosUsuarioTableClass::getNameField(datosUsuarioTableClass::NOMBRE, true), true);
}
if ($flag == true) {
request::getInstance()->setMethod('GET');
routing::getInstance()->forward('datos', 'insert');
}
if (!ereg($patron, $apellidos)) {
session::getInstance()->setError('campo apellidos no permite carateres especiales');
$flag = true;
session::getInstance()->setFirstCall(datosUsuarioTableClass::getNameField(datosUsuarioTableClass::APELLIDOS, true), true);
}
if (!ereg($patron, $cedula)) {
session::getInstance()->setError('campo cedula no permite carateres especiales');
$flag = true;
session::getInstance()->setFirstCall(datosUsuarioTableClass::getNameField(datosUsuarioTableClass::CEDULA, true), true);
}
if (!ereg($patron, $direccion)) {
session::getInstance()->setError('campo direccion no permite carateres especiales');
$flag = true;
session::getInstance()->setFirstCall(datosUsuarioTableClass::getNameField(datosUsuarioTableClass::DIRECCION, true), true);
}
if (!ereg($patron, $telefono)) {
session::getInstance()->setError('campo telefono no permite carateres especiales');
$flag = true;
session::getInstance()->setFirstCall(datosUsuarioTableClass::getNameField(datosUsuarioTableClass::TELEFONO, true), true);
}
}
示例3: prepare
protected function prepare() {
$htVars = http_vars::getInstance();
$this->type = $htVars->post('type', $htVars->get('type'));
$this->config = $htVars->post('config', $htVars->get('config', 'default'));
$this->myCfg = $this->cfg->default;
if ($this->config != 'default' && is_array($this->cfg->get($this->config)))
factory::mergeCfg($this->myCfg, $this->cfg->get($this->config));
$this->dir = $this->myCfg['dir'];
if ($this->myCfg['subdir'])
$this->dir.= DS.$this->myCfg['subdir'];
$this->dir.= DS.$this->type;
$resp = response::getInstance();
/* @var $resp response_http_html */
$resp->setLayout($this->myCfg['layout']);
$resp->setTitle($this->myCfg['title']);
$resp->initIncFiles(false);
foreach($this->myCfg['incFiles'] as $ic)
$resp->add($ic);
$this->uri = request::uriDef(array('module')).'?'.session::getInstance()->getSessIdForce().'='.urlencode(session_id()).'&type='.$this->type.'&config='.$this->config.'&';
}
示例4: afterInit
protected function afterInit() {
parent::afterInit();
$this->session = session::getInstance(array(
'nameSpace'=>$this->cfg->sessionNameSpace
));
$this->table = db::get('table', $this->cfg->table);
$this->autoLogin();
}
示例5: __construct
function __construct()
{
$this->session = session::getInstance();
$this->post = post::getInstance();
$this->get = get::getInstance();
$this->http = http::getInstance();
$this->file = new file();
$this->cookie = new cookie(config('cookie'));
}
示例6: __construct
function __construct()
{
$this->session = session::getInstance();
$this->post = post::getInstance();
$this->get = get::getInstance();
$this->http = http::getInstance();
$this->file = file::getInstance();
$this->cookie = cookie::getInstance();
}
示例7: initialize
public function initialize()
{
$this->template = template::getInstance();
$this->session = session::getInstance();
$this->album = album::getInstance();
$this->template->add(array('album'));
$this->id = $this->session->getData('album', 'id');
$this->page = $this->session->getData('album', 'page');
}
示例8: __construct
public function __construct()
{
$this->registry = registry::getInstance();
$this->path = $this->registry["path"];
$this->html = html::getInstance();
$this->ajax = new ajax();
$this->session = session::getInstance();
$this->cookie = session::getInstance();
$this->l10n = l10n::getInstance();
}
示例9: toHtml
public function toHtml()
{
if ($this->cfg->mode == 'view') {
return $this->getValue();
}
$options = $this->tinyMce;
if (is_array($this->cfg->tinyBrowser) && $this->cfg->getInArray('tinyBrowser', 'active')) {
$tinyBrowser = $this->cfg->tinyBrowser;
$options['file_browser_callback'] = 'function(field_name, url, type, win) {
tinyMCE.activeEditor.windowManager.open({
file : "' . $tinyBrowser['url'] . '?' . session::getInstance()->getSessIdForce() . '=' . urlencode(session_id()) . '&type=" + type' . ($tinyBrowser['subdir'] ? '+"&subdir=' . $tinyBrowser['subdir'] . '"' : '') . ',
title : "' . $tinyBrowser['title'] . '",
width : ' . $tinyBrowser['width'] . ',
height : ' . $tinyBrowser['height'] . ',
resizable : "yes",
scrollbars : "yes",
inline : "yes", // This parameter only has an effect if you use the inlinepopups plugin!
close_previous : "no"
}, {
window : win,
input : field_name
});
return false;
}';
} else {
if (is_array($this->cfg->nyroBrowser) && $this->cfg->getInArray('nyroBrowser', 'active')) {
$nyroBrowser = $this->cfg->nyroBrowser;
$options['file_browser_callback'] = 'function(field_name, url, type, win) {
tinyMCE.activeEditor.windowManager.open({
file : "' . $nyroBrowser['url'] . '?' . session::getInstance()->getSessIdForce() . '=' . urlencode(session_id()) . '&type="+type+"&config=' . $nyroBrowser['config'] . '&",
title : "' . $nyroBrowser['title'] . '",
width : ' . $nyroBrowser['width'] . ',
height : ' . $nyroBrowser['height'] . ',
resizable : "yes",
scrollbars : "yes",
inline : "yes", // This parameter only has an effect if you use the inlinepopups plugin!
close_previous : "no"
}, {
window : win,
input : field_name
});
return false;
}';
}
}
if (array_key_exists('content_css', $options) && $options['content_css']) {
$contentCss = $options['content_css'];
$options['setup'] = 'function(ed) {ed.onInit.add(function(ed) {setTimeout(function() {ed.dom.add(ed.dom.select("head"), "link", {rel : "stylesheet", href : "' . $contentCss . '"});}, 5);});}';
}
unset($options['content_css']);
$resp = response::getInstance()->getProxy();
$resp->addJs('jquery.tinymce');
$resp->blockjQuery('$("#' . $this->id . '").tinymce(' . utils::jsEncode($options) . ');');
return utils::htmlTag($this->htmlTagName, array_merge($this->html, array('name' => $this->name, 'id' => $this->id)), utils::htmlOut($this->getValue()));
}
示例10: afterInit
protected function afterInit()
{
$this->table = $this->cfg->table;
if (!$this->cfg->sessionName) {
$this->cfg->sessionName = $this->table->getName();
}
$this->session = session::getInstance(array('nameSpace' => 'filterTable_' . $this->cfg->sessionName));
if (!$this->cfg->check('clearPrm')) {
$this->cfg->clearPrm = 'clearFilter' . ucfirst($this->table->getName());
}
$this->cfg->setinArray('actionPrmClear', $this->cfg->clearPrm, true);
$this->initForm();
}
示例11: __construct
public function __construct()
{
parent::__construct();
$session = session::getInstance();
$isSV = $session->get("user_is_sv");
if ($isSV && $session->isValid()) {
$session->setValid();
} elseif ($isSV) {
session::recreateInstance(true);
}
$this->checkHTTPAuth();
$mainConfigs = mainConfiguration::getInstance();
$this->sendEventEnable = (bool) $mainConfigs->get('kernel', 'buffer-send-event-enable');
}
示例12: validateCreate
public static function validateCreate($descripcion)
{
$flag = false;
$patternC = "^[a-zA-Z0-9]{3,20}\$";
if (ereg($patternC, $descripcion) == false) {
session::getInstance()->setError('nop');
$flag = true;
session::getInstance()->setFlash(cargoTableClass::getNameField(cargoTableClass::DESCRIPCION, true), true);
}
if ($flag == true) {
request::getInstance()->setMethod('GET');
routing::getInstance()->forward('personal', 'insertCargo');
}
}
示例13: getMenu
function getMenu()
{
//global $page;
$page = basename($_SERVER['SCRIPT_NAME']);
$menu = array('index.php' => array('txt' => session::getInstance()->getLabel('lang.text.menu.index'), 'icon' => 'glyphicon glyphicon-dashboard', 'logged' => false), 'histo.php' => array('txt' => session::getInstance()->getLabel('lang.text.menu.historic'), 'icon' => 'glyphicon glyphicon-stats', 'logged' => false), 'rt.php' => array('txt' => session::getInstance()->getLabel('lang.text.menu.rt'), 'icon' => 'glyphicon glyphicon-signal', 'logged' => true));
foreach ($menu as $url => $title) {
if ($title['logged'] && !session::getInstance()->getVar('logged')) {
continue;
}
$active = '';
if ($page == $url) {
$active = ' class="active"';
}
echo '<li' . $active . '> <a href=' . $url . '><span class="' . $title['icon'] . '" aria-hidden="true"></span> ' . $title['txt'] . '</a></li>';
}
}
示例14: execute
public function execute()
{
try {
if (request::getInstance()->isMethod('POST')) {
$id = request::getInstance()->getPost(cargoTableClass::getNameField(cargoTableClass::ID, true));
$descripcion = request::getInstance()->getPost(cargoTableClass::getNameField(cargoTableClass::DESCRIPCION, true));
$ids = array(cargoTableClass::ID => $id);
$data = array(cargoTableClass::DESCRIPCION => $descripcion);
cargoTableClass::update($ids, $data);
}
routing::getInstance()->redirect('personal', 'indexCargo');
} catch (PDOException $exc) {
session::getInstance()->setFlash('exc', $exc);
routing::getInstance()->forward('shfSecurity', 'exception');
}
}
示例15: __construct
function __construct($auto = true)
{
$this->session = session::getInstance();
$this->path = LOCAL_PATH . LOCAL_DIR . 'data/';
$this->cache_path = LOCAL_PATH . LOCAL_DIR . 'cache/';
if ($auto) {
if (isset($_GET['p'])) {
$param = unserialize(base64_decode($_GET['p']));
foreach ($param as $pname => $pvalue) {
$_GET[$pname] = $pvalue;
}
}
if (isset($_GET['w'])) {
$this->width = $_GET['w'];
}
if (isset($_GET['h'])) {
$this->height = $_GET['h'];
}
if (isset($_GET['m'])) {
$this->mask = $_GET['m'];
}
if (isset($_GET['t']) && $_GET['t']) {
$this->trans = true;
}
if (isset($_GET['archive'])) {
$this->archive = $_GET['archive'];
}
if (isset($_GET['video'])) {
$this->video = $_GET['video'];
}
if (isset($_GET['id'])) {
$this->id = $_GET['id'];
$this->getCacheName();
}
if (isset($_GET['file']) && isset($_GET['album'])) {
$this->file = $_GET['file'];
$this->album = $_GET['album'];
}
if (!$this->cached && ($this->album && $this->file || $this->id) && !$this->archive) {
$this->getInfo();
} else {
if (!$this->cached && !$this->archive && !$this->video) {
$this->error = true;
}
}
}
}