RMS\PushNotificationsBundle\Service\OS\AppleNotification::getStreamContext PHP Метод

getStreamContext() защищенный Метод

Gets a stream context set up for SSL using our PEM file and passphrase
protected getStreamContext ( ) : resource
Результат resource
    protected function getStreamContext()
    {
        $pem = $this->pemPath;
        $passphrase = $this->passphrase;
        // Create cache pem file if needed
        if (!empty($this->pemContent)) {
            $filename = $this->cachedir . self::APNS_CERTIFICATE_FILE;
            $fs = new Filesystem();
            $fs->mkdir(dirname($filename));
            file_put_contents($filename, $this->pemContent);
            // Now we use this file as pem
            $pem = $filename;
            $passphrase = $this->pemContentPassphrase;
        }
        $ctx = stream_context_create();
        stream_context_set_option($ctx, "ssl", "local_cert", $pem);
        if (strlen($passphrase)) {
            stream_context_set_option($ctx, "ssl", "passphrase", $passphrase);
        }
        return $ctx;
    }