read transport identification number

@param mixed $transportStageQualifier

@return null|string
167077
public function readTDTtransportIdentification($transportStageQualifier): string
    {
        $transportIdentification = $this->readEdiDataValue(['TDT', ['1' => $transportStageQualifier]], 8, 0);
        if (!empty($transportIdentification)) {
            return $transportIdentification;
        }

        return $this->readEdiDataValue(['TDT', ['1' => $transportStageQualifier]], 8);
    }
1045799
protected function cardOrTransactionId($actionCounts)
    {
        return (isset($actionCounts['card']) && $actionCounts['card'] == 1
                && (!isset($actionCounts['transactionId'])
                    || isset($actionCounts['transactionId']) && $actionCounts['transactionId'] == 0))
            || (isset($actionCounts['transactionId']) && $actionCounts['transactionId'] == 1
                && (!isset($actionCounts['card'])
                    || isset($actionCounts['card']) && $actionCounts['card'] == 0));
    }
1071017
public function getStatus($ticket)
    {
        $sender = new ExtService();
        $sender->setClient($this->wsClient);

        return $sender->getStatus($ticket);
    }
1082683
public function getItemControllerId($type)
    {
        $controllerId = null;
        switch ($type) {
            case CAuthItem::TYPE_OPERATION:
                $controllerId = 'operation';
                break;

            case CAuthItem::TYPE_TASK:
                $controllerId = 'task';
                break;

            case CAuthItem::TYPE_ROLE:
                $controllerId = 'role';
                break;

            default:
                throw new CException('Auth item type "' . $type . '" is valid.');
        }
        return $controllerId;
    }
494965
private function readTicket()
    {
        if (!$this->getFileSystem()->isFile($this->getTicketFilePath())) {
            return '';
        }

        $content = trim($this->getFileSystem()->get($this->getTicketFilePath()));
        $result = unserialize($content);

        if (isset($result['ticket']) && isset($result['expire']) && isset($result['time'])) {
            $expireTime = $result['time'] + $result['expire'] - self::EXPIRE_SUB_TIME;
            if ($expireTime > time()) {
                return $result['ticket'];
            }
        }

        return '';
    }
462009
private String getServiceName() {
        TransportMetadata tm = getTransportMetadata();
        if (tm == null) {
            return "null";
        }
        
        return tm.getProviderName() + ' ' + tm.getName();
    }
1012457
public function getTicketSignature($ticket, $nonce, $timestamp, $url): string
    {
        return sha1(sprintf('jsapi_ticket=%s&noncestr=%s&timestamp=%s&url=%s', $ticket, $nonce, $timestamp, $url));
    }
1167972
private function getQuality($quality, $extension) {

		if(false === ('-' . intval($quality) == '-' . $quality)) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type integer, "%s" given', __METHOD__, gettype($quality)), E_USER_ERROR);
		}

		if(false === is_string($extension)) {
			return trigger_error(sprintf('Argument 2 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($extension)), E_USER_ERROR);
		}

		if(strtolower($extension) === 'png' && $quality > 9) {
			$quality = floor(($quality - 1) / 10);
		}

		return $quality;
	}
362523
static function instance( $transport = false, $forceNewInstance = false )
    {
        $ini = eZINI::instance( 'notification.ini' );
        if ( $transport == false )
        {
            $transport = $ini->variable( 'TransportSettings', 'DefaultTransport' );
        }
        $transportImpl =& $GLOBALS['eZNotificationTransportGlobalInstance_' . $transport ];
        $class = $transportImpl !== null ? strtolower( get_class( $transportImpl ) ) : '';

        $fetchInstance = false;
        if ( !preg_match( '/.*?transport/', $class ) )
                $fetchInstance = true;

        if ( $forceNewInstance  )
        {
            $fetchInstance = true;
        }

        if ( $fetchInstance )
        {
            $extraPluginPathArray = $ini->variable( 'TransportSettings', 'TransportPluginPath' );
            $pluginPathArray = array_merge( array( 'kernel/classes/notification/' ),
                                            $extraPluginPathArray );
            foreach( $pluginPathArray as $pluginPath )
            {
                $transportFile = $pluginPath . $transport . 'notificationtransport.php';
                if ( file_exists( $transportFile ) )
                {
                    include_once( $transportFile );
                    $className = $transport . 'notificationtransport';
                    $impl = new $className( );
                    break;
                }
            }
        }
        if ( !isset( $impl ) )
        {
            $impl = new eZNotificationTransport();
            eZDebug::writeError( 'Transport implementation not supported: ' . $transport, __METHOD__ );
        }
        return $impl;
    }
1155081
public function getDestinationMeta($clientDestinationName)
    {
        if (false == array_key_exists($clientDestinationName, $this->destinationsMeta)) {
            throw new \InvalidArgumentException(sprintf(
                'The destination meta not found. Requested name `%s`',
                $clientDestinationName
            ));
        }

        $transportName = $this->defaultQueueClientName === $clientDestinationName ?
            $this->config->getDefaultQueueName() :
            $this->config->formatName($clientDestinationName)
        ;

        $destination = array_replace([
            'subscribers' => [],
            'transportName' => $transportName,
        ], $this->destinationsMeta[$clientDestinationName]);

        return new DestinationMeta($clientDestinationName, $destination['transportName'], $destination['subscribers']);
    }
410211
public function getSignaturePackage($url = null, $nonce = null, $timestamp = null, $isAdminGroup = false)
    {
        $url = $url ? $url : $this->getUrl();
        $nonce = $nonce ? $nonce : $this->getNonce();
        $timestamp = $timestamp ? $timestamp : time();
        $ticket = $isAdminGroup ? $this->getGroupTicket() : $this->getTicket();

        $sign = $isAdminGroup ? array(
            'groupId' => $ticket['group_id'],
            'timestamp' => $timestamp,
            'nonceStr' => $nonce,
            'signature' => $this->getSignature($ticket['ticket'], $nonce, $timestamp, $url, true),
        ) : array(
            'appId' => $this->appId,
            'nonceStr' => $nonce,
            'timestamp' => $timestamp,
            'url' => $url,
            'signature' => $this->getSignature($ticket, $nonce, $timestamp, $url),
        );

        return $sign;
    }
557572
private function checkTicket($ticketId)
	{
		$signature = $this->signature();
		$url = $this->_config['checkTicketUrl'].$this->signature().'&ticketId='.$ticketId;
		$result = $this->getUrl($url);
		return $result;
	}
516465
public function getTicketCacheKey()
    {
        if (is_null($this->ticketCacheKey)) {
            return $this->ticketCachePrefix.$this->getAccessToken()->getFingerprint();
        }

        return $this->ticketCacheKey;
    }
322151
public function ticket($forceRefresh = false)
    {
        $key = self::TICKET_CACHE_PREFIX.$this->getAccessToken()->getFingerprint();
        $ticket = $this->getCache()->fetch($key);

        if (!$forceRefresh && !empty($ticket)) {
            return $ticket;
        }

        $result = $this->parseJSON('get', [self::API_TICKET]);

        $this->getCache()->save($key, $result['ticket'], $result['expires_in'] - 500);

        return $result['ticket'];
    }
106979
private function getRevisionId()
    {
        if (null === $this->revisionId) {
            $this->conn->insert(
                $this->config->getRevisionTableName(),
                [
                    'timestamp' => date_create('now'),
                    'username' => $this->config->getCurrentUsername(),
                ],
                [
                    Type::DATETIME,
                    Type::STRING,
                ]
            );

            $sequenceName = $this->platform->supportsSequences()
                ? $this->platform->getIdentitySequenceName($this->config->getRevisionTableName(), 'id')
                : null;

            $this->revisionId = $this->conn->lastInsertId($sequenceName);
        }

        return $this->revisionId;
    }
730644
public function checkTransport($from)
    {
        if (! array_key_exists($from, self::$mailServers)) {
            $sql = 'SELECT * FROM gems__mail_servers WHERE ? LIKE gms_from ORDER BY LENGTH(gms_from) DESC LIMIT 1';

            // Always set cache, se we know when not to check for this row.
            $serverData = $this->db->fetchRow($sql, $from);

            // \MUtil_Echo::track($serverData);

            if (isset($serverData['gms_server'])) {
                $options = array();
                if (isset($serverData['gms_user'], $serverData['gms_password'])) {
                    $options['auth'] = 'login';
                    $options['username'] = $serverData['gms_user'];
                    $options['password'] = $this->project->decrypt($serverData['gms_password']);
                }
                if (isset($serverData['gms_port'])) {
                    $options['port'] = $serverData['gms_port'];
                }
                if (isset($serverData['gms_ssl'])) {
                    switch ($serverData['gms_ssl']) {
                        case self::MAIL_SSL:
                            $options['ssl'] = 'ssl';
                            break;

                        case self::MAIL_TLS:
                            $options['ssl'] = 'tls';
                            break;

                        default:
                            // intentional fall through

                    }
                }

                self::$mailServers[$from] = new \Zend_Mail_Transport_Smtp($serverData['gms_server'], $options);
            } else {
                self::$mailServers[$from] = $this->getDefaultTransport();
            }
        }

        return self::$mailServers[$from];
    }
172021
public static function getPort() :? int
  {
      // Check for proxy first
      if (isset($_SERVER['HTTP_X_FORWARDED_PORT'])) {
          return (int) $_SERVER['HTTP_X_FORWARDED_PORT'];
      }
      if ('https' === ($_SERVER['HTTP_X_FORWARDED_PROTO'] ?? '')) {
          return 443;
      }

      return isset($_SERVER['SERVER_PORT']) ?
        (int) $_SERVER['SERVER_PORT'] : null;
  }