當前位置: 首頁>>代碼示例>>PHP>>正文


PHP session_commit函數代碼示例

本文整理匯總了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();
 }
開發者ID:alejandrososa,項目名稱:angularja,代碼行數:7,代碼來源:Sesion.php

示例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();
}
開發者ID:netconstructor,項目名稱:elastix-mt-gui,代碼行數:28,代碼來源:index.php

示例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;
 }
開發者ID:fancyecommerce,項目名稱:yii2-fec,代碼行數:31,代碼來源:ModulesapiController.php

示例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;
 }
開發者ID:PrakharSrivastav,項目名稱:bookbarterclub,代碼行數:25,代碼來源:PagesController.php

示例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;
 }
開發者ID:RomLAURENT,項目名稱:Jar2Fer,代碼行數:29,代碼來源:api.php

示例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();
 }
開發者ID:ASDAFF,項目名稱:bitrix-casco,代碼行數:8,代碼來源:casco_api.class.php

示例7: sessionDestroy

 public static function sessionDestroy($sessionName = null)
 {
     if (isset($sessionName)) {
         unset($sessionName);
     }
     session_destroy();
     session_commit();
 }
開發者ID:stormtrooper42,項目名稱:stirl,代碼行數:8,代碼來源:App.php

示例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));
 }
開發者ID:skeetr,項目名稱:skeetr,代碼行數:10,代碼來源:SessionTest.php

示例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();
 }
開發者ID:victorfcm,項目名稱:VuFind-Plus,代碼行數:10,代碼來源:User.php

示例10: dldc_die

function dldc_die($message = 0)
{
    try {
        session_commit();
    } catch (Exception $e) {
        # TODO: SESSIONS ARE WEIRD
    }
    dldc_restore_db();
    die($message);
}
開發者ID:sinfocol,項目名稱:gwf3,代碼行數:10,代碼來源:lib.php

示例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;
 }
開發者ID:rickymathew,項目名稱:TYPO3.CMS,代碼行數:17,代碼來源:RsaEncryptionEncoder.php

示例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');
 }
開發者ID:alexdiasgonsales,項目名稱:organizador,代碼行數:13,代碼來源:Logout.class.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()));
 }
開發者ID:frozzare,項目名稱:wp-sessions,代碼行數:13,代碼來源:class-wp-session-handler-mysql-test.php

示例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;
     }
 }
開發者ID:carlosrodriguesf,項目名稱:adeushomonios,代碼行數:14,代碼來源:Security.class.php

示例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');
 }
開發者ID:alexdiasgonsales,項目名稱:organizador,代碼行數:15,代碼來源:OtherFuctions.class.php


注:本文中的session_commit函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。