当前位置: 首页>>代码示例>>PHP>>正文


PHP Tinebase_Core::getSessionId方法代码示例

本文整理汇总了PHP中Tinebase_Core::getSessionId方法的典型用法代码示例。如果您正苦于以下问题:PHP Tinebase_Core::getSessionId方法的具体用法?PHP Tinebase_Core::getSessionId怎么用?PHP Tinebase_Core::getSessionId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Tinebase_Core的用法示例。


在下文中一共展示了Tinebase_Core::getSessionId方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: uploadImage

 /**
  * upload image
  *
  * @param  string  $base64
  */
 public function uploadImage($base64 = 'no')
 {
     $tmpFile = tempnam(Tinebase_Core::getTempDir(), '');
     $file = new Zend_Form_Element_File('file');
     $maxsize = $file->getMaxFileSize();
     $sessionId = Tinebase_Core::getSessionId();
     if (move_uploaded_file($_FILES['upload']['tmp_name'], $tmpFile)) {
         $image_id = str_replace(Tinebase_Core::getTempDir() . '/', '', $tmpFile);
         $image_size = filesize($tmpFile);
         if ($base64 === 'yes') {
             // converts image to base64
             try {
                 $image = file_get_contents($tmpFile);
                 $encoded_data = base64_encode($image);
                 echo '{"success":true , "id":"' . $image_id . '", "session_id":"' . $sessionId . '", "size":"' . $image_size . '", "path":"' . $tmpFile . '", "base64":"' . $encoded_data . '"}';
             } catch (Exception $e) {
                 echo '{"success":false, "error":' . $e . description . '}';
             }
         } else {
             echo '{"success":true , "id":"' . $image_id . '", "session_id":"' . $sessionId . '", "size":"' . $image_size . '", "path":"' . $tmpFile . '"}';
         }
     } else {
         echo '{"success":false, "method":"uploadImage", "maxsize":"' . $maxsize . '"}';
     }
 }
开发者ID:hernot,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:30,代码来源:Http.php

示例2: setSessionId

 /**
  * set session id for current request in accesslog
  *
  * @param Tinebase_Model_AccessLog $accessLog
  */
 public function setSessionId(Tinebase_Model_AccessLog $accessLog)
 {
     if (in_array($accessLog->clienttype, array(Tinebase_Server_WebDAV::REQUEST_TYPE, ActiveSync_Server_Http::REQUEST_TYPE))) {
         try {
             $previousAccessLog = Tinebase_AccessLog::getInstance()->getPreviousAccessLog($accessLog);
             $accessLog->sessionid = $previousAccessLog->sessionid;
         } catch (Tinebase_Exception_NotFound $tenf) {
             // ignore
         }
     }
     if (empty($accessLog->sessionid)) {
         $accessLog->sessionid = Tinebase_Core::getSessionId();
     } else {
         Tinebase_Core::set(Tinebase_Core::SESSIONID, $accessLog->sessionid);
     }
 }
开发者ID:ingoratsdorf,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:21,代码来源:AccessLog.php

示例3: createTempFile

 /**
  * create new temp file
  * 
  * @param string $_path
  * @param string $_name
  * @param string $_type
  * @param double $_size
  * @param integer $_error
  * @return Tinebase_Model_TempFile
  */
 public function createTempFile($_path, $_name = 'tempfile.tmp', $_type = 'unknown', $_size = 0, $_error = 0)
 {
     // sanitize filename (convert to utf8)
     $filename = Tinebase_Helper::mbConvertTo($_name);
     $id = Tinebase_Model_TempFile::generateUID();
     $tempFile = new Tinebase_Model_TempFile(array('id' => $id, 'session_id' => Tinebase_Core::getSessionId(false), 'time' => Tinebase_DateTime::now()->get(Tinebase_Record_Abstract::ISO8601LONG), 'path' => $_path, 'name' => $filename, 'type' => !empty($_type) ? $_type : 'unknown', 'error' => !empty($_error) ? $_error : 0, 'size' => !empty($_size) ? (double) $_size : (double) filesize($_path)));
     if (Tinebase_Core::isLogLevel(Zend_Log::TRACE)) {
         Tinebase_Core::getLogger()->trace(__METHOD__ . '::' . __LINE__ . " tempfile data: " . print_r($tempFile->toArray(), TRUE));
     }
     $this->create($tempFile);
     return $tempFile;
 }
开发者ID:ingoratsdorf,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:22,代码来源:TempFile.php


注:本文中的Tinebase_Core::getSessionId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。