Pimcore\File::getContext PHP Method

getContext() public static method

public static getContext ( ) : null | resource
return null | resource
    public static function getContext()
    {
        if (!self::$context) {
            self::$context = stream_context_create([]);
        }
        return self::$context;
    }

Usage Example

Example #1
0
 /**
  * @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();
     }
 }
All Usage Examples Of Pimcore\File::getContext