public static function getContext() { if (!self::$context) { self::$context = stream_context_create([]); } return self::$context; }
/** * @return mixed|void * @throws DAV\Exception\Forbidden */ public function get() { if ($this->asset->isAllowed("view")) { return fopen($this->asset->getFileSystemPath(), "r", false, FileHelper::getContext()); } else { throw new DAV\Exception\Forbidden(); } }