本文整理匯總了PHP中session_commit函數的典型用法代碼示例。如果您正苦於以下問題:PHP session_commit函數的具體用法?PHP session_commit怎麽用?PHP session_commit使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了session_commit函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: sesion_exit
public function sesion_exit()
{
session_id('uid');
session_start();
session_destroy();
session_commit();
}
示例2: listarColaFax_json
function listarColaFax_json($smarty, $module_name, $local_templates_dir)
{
//TODO: falta ahcer un filtrado de los trabajos pendientes por organizaionc
// esto se puede hacer si se identifica a que modem pertence cada trajado
// en la cola. Cada trabajo listado tiene un correspondiente archivo
// en donde se describe a que modem pertenece. Seria de ller ese archivo
// si el trbajo es de envio se encuentra en /var/spool/hylafax/sendq/
// si el trabjo es de envio se encuentra en /var/spool/hylafax/recvq/
// el nombre del archivo seria qJID donde JID ES DE ID DEL JOB
session_commit();
$oldhash = getParameter('outputhash');
$html = NULL;
$startTime = time();
do {
$listaColaFax = enumerarFaxesPendientes();
$newhash = md5(serialize($listaColaFax));
if ($oldhash == $newhash) {
usleep(2 * 1000000);
} else {
$html = listarColaFax_raw($smarty, $module_name, $local_templates_dir, $listaColaFax);
}
} while ($oldhash == $newhash && time() - $startTime < 30);
$jsonObject = new PalosantoJSON();
$jsonObject->set_status($oldhash != $newhash ? 'CHANGED' : 'NOCHANGED');
$jsonObject->set_message(array('html' => $html, 'outputhash' => $newhash));
Header('Content-Type: application/json');
return $jsonObject->createJSON();
}
示例3: actions
public function actions()
{
$return = [];
$module_token = Yii::$app->request->post('module_token');
$this_module_token = \fec\helpers\CModule::getToken();
if ($module_token != $this_module_token) {
$return['ack'] = false;
$return['ack_description'] = "modules token is not right";
$return['content'] = $module_token . '#' . $this_module_token;
echo json_encode($return);
exit;
}
$r = $this->getControllerAndAction();
$t_controller = $r['controller'];
$t_action = $r['action'];
$current_remote_function_param_array = Yii::$app->request->post('current_remote_function_param_array');
$current_remote_function_param_array = unserialize($current_remote_function_param_array);
$param = !empty($current_remote_function_param_array) && is_array($current_remote_function_param_array) ? $current_remote_function_param_array : [];
$current_namespace = $this->_name_space;
$module_o_dir = str_replace("\\controllers", "\\o", $current_namespace);
$function_exec = $module_o_dir . "\\" . $t_controller . "::" . $t_action;
$data = \call_user_func_array($function_exec, $param);
$data = json_decode($data);
$return['ack'] = true;
$return['ack_description'] = "success";
$return['content'] = $data;
# 把模塊更新的session更新到redis上麵,以供其他模塊使用
session_commit();
echo json_encode($return);
exit;
}
示例4: bookDetails
public function bookDetails(Request $request)
{
$book_id = $request->input("book");
$book_id = trim($book_id);
$book = Book::where('book_id', $book_id)->get();
if (count($book) > 0) {
$latitude = trim($request->input("latitude"));
$longitude = trim($request->input("longitude"));
if (session_id() == "" || !isset($_SESSION['latitude'])) {
session_start();
$_SESSION['latitude'] = $latitude;
$_SESSION['longitude'] = $longitude;
} else {
unset($_SESSION['longitude']);
unset($_SESSION['latitude']);
$_SESSION['latitude'] = $latitude;
$_SESSION['longitude'] = $longitude;
}
session_commit();
$message = ["code" => 100, "message" => "success"];
} else {
$message = ["code" => 101, "message" => "fail"];
}
return $message;
}
示例5: execute
public static function execute($commande, $params)
{
session_start();
$endpoint=new static();
$commande = "API_".$commande;
$endpointReflx = new ReflectionObject($endpoint);
$methodReflx = $endpointReflx->getMethod($commande);
try{
$result =$methodReflx->invokeArgs($endpoint, $params);
$result = [
'status'=>'success',
'value'=>$result
];
}
catch(ErrorException $ex)
{
$result = [
'status'=>'error',
'value'=>$ex->getMessage()
];
}
session_commit();
return $result;
}
示例6: createResult
public function createResult()
{
$payload = json_encode($this->requestObject);
$res = $this->connection->post('/calculation/', $payload);
$object = json_decode($res);
$_SESSION['cascoResultId'] = $object->id;
session_commit();
}
示例7: sessionDestroy
public static function sessionDestroy($sessionName = null)
{
if (isset($sessionName)) {
unset($sessionName);
}
session_destroy();
session_commit();
}
示例8: testSessionDestroy
public function testSessionDestroy()
{
$this->assertFalse(session_destroy());
$_SESSION['foo'] = 'bar';
session_start();
session_commit();
$this->assertTrue(session_destroy());
$file = sprintf('%s/sess_%s', sys_get_temp_dir(), session_id());
$this->assertFalse(file_exists($file));
}
示例9: updateSession
public static function updateSession($user)
{
$_SESSION['userinfo'] = serialize($user);
if (isset($_REQUEST['rememberMe']) && ($_REQUEST['rememberMe'] === "true" || $_REQUEST['rememberMe'] === "on")) {
$_SESSION['rememberMe'] = true;
} else {
$_SESSION['rememberMe'] = false;
}
session_commit();
}
示例10: dldc_die
function dldc_die($message = 0)
{
try {
session_commit();
} catch (Exception $e) {
# TODO: SESSIONS ARE WEIRD
}
dldc_restore_db();
die($message);
}
示例11: getRsaPublicKey
/**
* Gets RSA Public Key.
*
* @return Keypair|NULL
*/
public function getRsaPublicKey()
{
$keyPair = null;
$backend = Backend\BackendFactory::getBackend();
if ($backend !== null) {
$keyPair = $backend->createNewKeyPair();
$storage = Storage\StorageFactory::getStorage();
$storage->put($keyPair->getPrivateKey());
session_commit();
}
return $keyPair;
}
示例12: Logout
public function Logout()
{
$noheader = new NoHeader();
$noheader->noheader();
if (isset($_SESSION['authUser'])) {
unset($_SESSION['authUser']);
$_SESSION = array();
session_destroy();
session_commit();
}
//echo HOME;
header("Location:" . HOME . 'index.php');
}
示例13: test_session_handler_clean
public function test_session_handler_clean()
{
$_SESSION['name'] = 'Fredrik';
session_commit();
$session_handler = WP_Sessions::instance()->get_session_handler();
$this->assertSame('name|s:7:"Fredrik";', $session_handler->read(session_id()));
global $wpdb;
$table = $wpdb->prefix . 'sessions';
$wpdb->update($table, ['timestamp' => time() - HOUR_IN_SECONDS * 25], ['id' => session_id()], ['%d'], ['%s']);
$this->assertSame('name|s:7:"Fredrik";', $session_handler->read(session_id()));
$session_handler->clean();
$this->assertEmpty($session_handler->read(session_id()));
}
示例14: auth
public static function auth($nomeDeUsuario, $senha)
{
$con = Connection::get();
$prepared = $con->prepare("SELECT codigo FROM Contas WHERE nomeDeUsuario='{$nomeDeUsuario}' AND senha=md5('{$senha}')");
$prepared->execute();
$result = $prepared->fetch(PDO::FETCH_ASSOC);
if ($result && !is_null($result['codigo'])) {
$_SESSION['cod_user'] = (int) $result['codigo'];
session_commit();
return true;
} else {
return false;
}
}
示例15: verffyOrg
static function verffyOrg()
{
$noheader = new NoHeader();
$noheader->noheader();
if (isset($_SESSION['authUser'])) {
if ($_SESSION['authUser']->organizador) {
return;
}
}
unset($_SESSION['authUser']);
$_SESSION = array();
session_destroy();
session_commit();
header("Location:" . HOME . 'index.php');
}