attachWss
@param \PHPDaemon\Network\Pool $wss
@return boolean
6965
public function attachWss($wss)
    {
        if ($this->wss->contains($wss)) {
            return false;
        }
        $this->wss->attach($wss);
        $wss->bind('customTransport', [$this, 'wsHandler']);
        return true;
    }
80102
public function call_hook($sWhich = '')
    {
        if (!isset($this->aCustomHooks[$sWhich])) {
            return parent::call_hook($sWhich);
        }

        if (isset($this->aCustomHooks[$sWhich][0]) && is_array($this->aCustomHooks[$sWhich][0])) {
            foreach ($this->aCustomHooks[$sWhich] as $aCustomHook) {
                $this->runCustomHook($aCustomHook);
            }
            return true;
        } else {
            $this->runCustomHook($this->aCustomHooks[$sWhich]);
            return true;
        }

        return parent::call_hook($sWhich);
    }
329524
public function setAttachments($attachments) {
		$attach = [];
		foreach ((array)$attachments as $name => $fileInfo) {
			if (!is_array($fileInfo)) {
				$fileInfo = ['file' => $fileInfo];
			}
			if (!isset($fileInfo['file'])) {
				if (!isset($fileInfo['data'])) {
					throw new InvalidArgumentException('No file or data specified.');
				}
				if (is_int($name)) {
					throw new InvalidArgumentException('No filename specified.');
				}
			} else {
				$fileName = $fileInfo['file'];
				if (!preg_match('~^https?://~i', $fileInfo['file'])) {
					$fileInfo['file'] = realpath($fileInfo['file']);
				}
				if ($fileInfo['file'] === false || !Utility::fileExists($fileInfo['file'])) {
					throw new InvalidArgumentException(sprintf('File not found: "%s"', $fileName));
				}
				if (is_int($name)) {
					$name = basename($fileInfo['file']);
				}
			}
			if (!isset($fileInfo['mimetype'])) {
				$ext = pathinfo($name, PATHINFO_EXTENSION);
				$fileInfo['mimetype'] = $this->_getMimeByExtension($ext);
			}
			$attach[$name] = $fileInfo;
		}
		$this->_attachments = $attach;

		return $this;
	}
409445
public function setWsdlServer($wsdlServer = NULL)
    {
        $this->wsdlServer = $wsdlServer;
        $this->debug->debug(__FUNCTION__, 'setWsdlServer: ' . json_encode($this->wsdlServer));
    }
1133036
public function withAttachments($attachments)
    {
        if (! is_array($attachments)) {
            $attachments = [$attachments];
        }

        foreach ($attachments as $attachment) {
            $this->withAttachment($attachment);
        }

        return $this;
    }
719881
public function onWsdlResponse(WsdlResponseEvent $event)
    {
        $xpath = new \DOMXPath($event->getWsdl());
        $xpath->registerNamespace('wsaw', self::NS_WSAW);

        // This is a pretty dumb check. Just see if a wsaw:Addressing or wsaw:UsingAddressing tag exists
        if ($xpath->query('//wsaw:Addressing')->length || $xpath->query('//wsaw:UsingAddressing')->length) {
            $this->wsaEnabled = true;
        }
    }
884440
function addWSSecurityHeader($config) {
    $config = array_merge(['timezone' => 'BST'], $config);

    $nonce = $this->getNonce();
    $ts    = $this->getTimestamp($config['timezone']);

    $auth = new \stdClass();
    $auth->Username = new \SoapVar($config['username'], XSD_STRING, NULL, $this->wss_ns, NULL, $this->wss_ns);
    $auth->Password = new \SoapVar($this->getPasswordDigest($nonce, $ts, $config['password']), XSD_STRING, NULL, $this->wss_ns, NULL, $this->wss_ns);
    $auth->Nonce    = new \SoapVar(base64_encode($nonce), XSD_STRING, NULL, $this->wss_ns, NULL, $this->wss_ns);
    $auth->Created  = new \SoapVar($ts, XSD_STRING, NULL, $this->wss_ns, NULL, $this->wsu_ns);

    $username_token = new \stdClass();
    $username_token->UsernameToken = new \SoapVar(@$auth, SOAP_ENC_OBJECT, NULL, $this->wss_ns, 'UsernameToken', $this->wss_ns);

    $security_sv = new \SoapVar(
      new \SoapVar($username_token, SOAP_ENC_OBJECT, NULL, $this->wss_ns, 'UsernameToken', $this->wss_ns),
      SOAP_ENC_OBJECT, NULL, $this->wss_ns, 'Security', $this->wss_ns
    );

    $this->__setSoapHeaders([new \SoapHeader($this->wss_ns, 'Security', $security_sv, TRUE)]);
  }
1327476
public function attach($dados)
    {
        foreach ($dados as $item => $value) {
            $this->{$item} = $value;
        }

        $this->withDefaultValuesValidation();
    }
69283
public function attach(\SplObserver $observer): void
    {
        $id = spl_object_hash($observer);
        $this->_observers[$id] = $observer;
    }
1091197
public function attach(EventManagerInterface $events)
    {
        $sharedEvents = $events->getSharedManager();
        
        // check for 403 at beginning of route and dispatch events
        $this->listeners[] = $events->attach(
            array(MvcEvent::EVENT_ROUTE, MvcEvent::EVENT_DISPATCH),
            array($this, 'detectAccessDenied'),
            1000);

        // check for 403 immediately after controller dispatch
        $this->listeners[] = $sharedEvents->attach(
            'Zend\Stdlib\DispatchableInterface',
            MvcEvent::EVENT_DISPATCH,
            array($this, 'detectAccessDenied'),
            0);
        
        // inject access denied view model
        $this->listeners[] = $events->attach(
            MvcEvent::EVENT_RENDER, 
            array($this, 'injectAccessDeniedViewModel'), 
            1);
    }
836599
public final void mWS() throws RecognitionException {
		try {
			int _type = WS;
			int _channel = DEFAULT_TOKEN_CHANNEL;
			// hql.g:791:5: ( ( ' ' | '\\t' | '\\r' '\\n' | '\\n' | '\\r' ) )
			// hql.g:791:9: ( ' ' | '\\t' | '\\r' '\\n' | '\\n' | '\\r' )
			{
			// hql.g:791:9: ( ' ' | '\\t' | '\\r' '\\n' | '\\n' | '\\r' )
			int alt4=5;
			switch ( input.LA(1) ) {
			case ' ':
				{
				alt4=1;
				}
				break;
			case '\t':
				{
				alt4=2;
				}
				break;
			case '\r':
				{
				int LA4_3 = input.LA(2);
				if ( (LA4_3=='\n') ) {
					alt4=3;
				}

				else {
					alt4=5;
				}

				}
				break;
			case '\n':
				{
				alt4=4;
				}
				break;
			default:
				if (state.backtracking>0) {state.failed=true; return;}
				NoViableAltException nvae =
					new NoViableAltException("", 4, 0, input);
				throw nvae;
			}
			switch (alt4) {
				case 1 :
					// hql.g:791:13: ' '
					{
					match(' '); if (state.failed) return;
					}
					break;
				case 2 :
					// hql.g:792:7: '\\t'
					{
					match('\t'); if (state.failed) return;
					}
					break;
				case 3 :
					// hql.g:793:7: '\\r' '\\n'
					{
					match('\r'); if (state.failed) return;
					match('\n'); if (state.failed) return;
					}
					break;
				case 4 :
					// hql.g:794:7: '\\n'
					{
					match('\n'); if (state.failed) return;
					}
					break;
				case 5 :
					// hql.g:795:7: '\\r'
					{
					match('\r'); if (state.failed) return;
					}
					break;

			}

			if ( state.backtracking==0 ) {skip();}
			}

			state.type = _type;
			state.channel = _channel;
		}
		finally {
			// do for sure before leaving
		}
	}
127376
public function attach()
    {
        $this->detectReturnType();

        if (empty($_REQUEST['broker'])) {
            return $this->fail("No broker specified", 400);
        }

        if (empty($_REQUEST['token'])) {
            return $this->fail("No token specified", 400);
        }

        if (!$this->returnType) {
            return $this->fail("No return url specified", 400);
        }

        $checksum = $this->generateAttachChecksum($_REQUEST['broker'], $_REQUEST['token']);

        if (empty($_REQUEST['checksum']) || $checksum != $_REQUEST['checksum']) {
            return $this->fail("Invalid checksum", 400);
        }

        $this->startUserSession();
        $sid = $this->generateSessionId($_REQUEST['broker'], $_REQUEST['token']);

        $this->cache->set($sid, $this->getSessionData('id'));
        $this->outputAttachSuccess();
    }
613858
public function attach(EventManagerInterface $events)
    {
        $sharedManager = $events->getSharedManager();
        $sharedManager->attach(ManagerRegistryFactory::class, ManagerRegistryFactory::EVENT_BUILD_LIST_CONNECTIONS, [$this, 'buildListConnectionsHandler']);
        $sharedManager->attach(ManagerRegistryFactory::class, ManagerRegistryFactory::EVENT_BUILD_LIST_OBJECT_MANAGERS, [$this, 'buildListObjectManagersHandler']);
    }
1190377
public function connect($ariAddress, $amiAddress = null, $streamOptions = [], $clientOptions = [])
    {
        $this->ariClient->connect($ariAddress, $streamOptions, $clientOptions);
        $this->wsClient = $this->ariClient->getWsClient();
        $this->stasisApplicationName = $this->ariClient->getStasisApplicationName();

        if ($amiAddress !== null) {
            $this->amiClient = new AmiClient($this->ariClient->getWsClient(), $this->eventLoop, $this->logger);
            $this->amiClient
                ->connect($amiAddress)
                ->done();
        }
    }
491279
function remove($wsdl) {
		$filename = $this->createFilename($wsdl);
		if (!file_exists($filename)) {
			$this->debug("$wsdl ($filename) not in cache to be removed");
			return false;
		}
		// ignore errors obtaining mutex
		$this->obtainMutex($filename, "w");
		$ret = unlink($filename);
		$this->debug("Removed ($ret) $wsdl ($filename) from cache");
		$this->releaseMutex($filename);
		return $ret;
	}
727987
public function hasWebserviceConfiguration(string $webServiceId)
    {
        foreach ($this->configuration['connections'] as $serverId => $configuration) {
            if ($configuration['id'] == $webServiceId) {
                return $serverId;
            }
        }

        return false;
    }
513730
public function attach()
    {
        $parameters = [
            'return_url' => $this->getCurrentUrl(),
            'broker' => $this->brokerName,
            'token' => $this->token,
            'checksum' => hash('sha256', 'attach' . $this->token . $this->brokerSecret)
        ];

        $attachUrl = $this->generateCommandUrl('attach', $parameters);

        $this->redirect($attachUrl);
    }