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


PHP SessionInterface::getObjectManager方法代码示例

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


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

示例1: init_stream

 /**
  * Check whether stream was already loaded, otherwise fetch from backend
  * and cache it.
  *
  * Multivalued properties have a special handling since the backend returns
  * all streams in a single call.
  *
  * Always checks if the current session is still alive.
  *
  * @throws LogicException when trying to use a stream from a closed session
  *      and on trying to access a nonexisting multivalue id.
  *
  * @return void
  */
 private function init_stream()
 {
     if (null === $this->stream) {
         if ($this->session && !$this->session->isLive()) {
             throw new LogicException("Trying to read a stream from a closed transport.");
         }
         $url = parse_url($this->path);
         $this->session = Session::getSessionFromRegistry($url['host']);
         $property_path = $url['path'];
         $token = isset($url['user']) ? $url['user'] : null;
         if (null === $token) {
             $this->stream = $this->session->getObjectManager()->getBinaryStream($property_path);
         } else {
             // check if streams have been loaded for multivalued properties
             if (!isset(self::$multiValueMap[$token])) {
                 self::$multiValueMap[$token] = $this->session->getObjectManager()->getBinaryStream($property_path);
             }
             $index = isset($url['port']) ? $url['port'] - 1 : 0;
             if (!isset(self::$multiValueMap[$token][$index])) {
                 throw new LogicException("Trying to read a stream from a non existant token '{$token}' or token index '{$index}'.");
             }
             $this->stream = self::$multiValueMap[$token][$index];
         }
     }
 }
开发者ID:ruflin,项目名称:jackalope,代码行数:39,代码来源:BinaryStreamWrapper.php


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