Get license.
@return string
487389
public function getLicense()
    {
        if ($this->_license === null) {
            $this->_license = $this->take('package')->getLicense();
        }

        return $this->_license;
    }
1152592
public function getOnlineLicenseCheck()
    {
        if (!$this->onlineLicenseCheck) {
            /** @var \OxidEsales\Eshop\Core\Curl $curl */
            $curl = oxNew(\OxidEsales\Eshop\Core\Curl::class);

            /** @var \OxidEsales\Eshop\Core\OnlineServerEmailBuilder $emailBuilder */
            $emailBuilder = oxNew(\OxidEsales\Eshop\Core\OnlineServerEmailBuilder::class);

            /** @var \OxidEsales\Eshop\Core\SimpleXml $simpleXml */
            $simpleXml = oxNew(\OxidEsales\Eshop\Core\SimpleXml::class);

            /** @var \OxidEsales\Eshop\Core\OnlineLicenseCheckCaller $licenseCaller */
            $licenseCaller = oxNew(\OxidEsales\Eshop\Core\OnlineLicenseCheckCaller::class, $curl, $emailBuilder, $simpleXml);

            /** @var \OxidEsales\Eshop\Core\UserCounter $userCounter */
            $userCounter = oxNew(\OxidEsales\Eshop\Core\UserCounter::class);

            /** @var \OxidEsales\Eshop\Core\Service\ApplicationServerExporter $appServerExporter */
            $appServerExporter = $this->getApplicationServerExporter();

            /** @var \OxidEsales\Eshop\Core\OnlineLicenseCheck $OLC */
            $OLC = oxNew(\OxidEsales\Eshop\Core\OnlineLicenseCheck::class, $licenseCaller);
            $OLC->setAppServerExporter($appServerExporter);
            $OLC->setUserCounter($userCounter);

            $this->setOnlineLicenseCheck($OLC);
        }

        return $this->onlineLicenseCheck;
    }
183459
public static function checkSubscription( $license ) {
		$response = self::client()->get( self::api_url() .'check-subscription', [ 'query' => [ 'license' => $license,  'Geot-Origin' => $_SERVER['HTTP_HOST'] ] ] );

		if( $response->getStatusCode() != '200')
			return json_encode(['error' => 'Something wrong happened'. strip_tags((string) $response->getBody())]);

		$response = (string)$response->getBody();
		return $response;
	}
11975
function get_available_premium_licenses( $is_localhost = null ) {
            $this->_logger->entrance();

            $licenses = array();
            if ( ! $this->has_paid_plan() ) {
                return $licenses;
            }

            if ( is_array( $this->_licenses ) ) {
                foreach ( $this->_licenses as $license ) {
                    if ( ! $license->can_activate( $is_localhost ) ) {
                        continue;
                    }

                    $licenses[] = $license;
                }
            }

            return $licenses;
        }
493559
protected function extractCCLicense( $url ) {
		$license = '';

		// evaluate that it's a url
		if ( ! is_string( $url ) ) {
			return $license;
		}
		// look for creativecommons domain
		$parts = wp_parse_url( $url );

		if ( 'http' === $parts['scheme'] && 'creativecommons.org' === $parts['host'] ) {
			// extract the license information from it
			$split = explode( '/', $parts['path'] );
			if ( 'zero' === $split[2] ) {
				$license = 'cc0';
			} else {
				$license = 'cc-' . $split[2];
			}
		}

		return $license;
	}
952804
protected function getAlias()
    {
        if (empty($this->alias)) {
            return '';
        }

        if (strpos($this->alias, '.') !== false) {
            return $this->alias;
        }

        return $this->alias . '.';
    }
926973
private function get_license_network_activation_notice() {
            if ( ! $this->_is_network_active ) {
                // Module isn't network level activated.
                return '';
            }

            if ( ! fs_is_network_admin() ) {
                // Not network level admin.
                return '';
            }

            if ( get_blog_count() == 1 ) {
                // There's only a single site in the network so if there's a context license it was already activated.
                return '';
            }

            if ( ! is_object( $this->_license ) ) {
                // No context license.
                return '';
            }

            if ( $this->_license->is_single_site() && 0 < $this->_license->activated ) {
                // License was already utilized (this is not 100% the case if all the network is localhost sites and the license can be utilized on unlimited localhost sites).
                return '';
            }

            if ( $this->can_activate_license_on_network( $this->_license ) ) {
                // License can be activated on all the network, so probably, the license is already activate on all the network (that's how the after upgrade sync works).
                return '';
            }

            return sprintf(
                $this->get_text_inline( '%sClick here%s to choose the sites where you\'d like to activate the license on.', 'network-choose-sites-for-license' ),
                '<a href="' . $this->get_account_url( false, array( 'activate_license' => 'true' ) ) . '">',
                '</a>'
            );
        }
358762
public function getAuthority(): string
    {
        if ($this->host == '') {
            return '';
        }

        $authority = $this->host;
        if ($this->user != '') {
            $authority = $this->user.'@'.$authority;
        }

        if ($this->port !== null && !$this->isDefaultPort($this->scheme, $this->port)) {
            $authority .= ':'.$this->port;
        }

        return $authority;
    }
1187213
public function getCertificate($justbase64 = true)
    {
        if ($justbase64) {
            $str=str_replace("\n", "", $this->_certs['cert']);
            $str = str_replace("-----BEGIN CERTIFICATE-----","", $str);
            $str = str_replace("-----END CERTIFICATE-----","", $str);
            return $str;
        }

        return $this->_certs['cert'];
    }
913074
public function license()
    {
        $languageId = $this->getLanguageInstance()->getLanguage();
        $utils = $this->getUtilitiesInstance();

        $this->setViewOptions(
            'license.php',
            'STEP_2_TITLE',
            [
                "aLicenseText" => $utils->getLicenseContent($languageId)
            ]
        );
    }
739877
private static function get_all_licenses_by_module_type() {
            $licenses = self::get_account_option( 'all_licenses' );

            $licenses_by_module_type = array(
                WP_FS__MODULE_TYPE_PLUGIN => array(),
                WP_FS__MODULE_TYPE_THEME  => array()
            );

            if ( ! is_array( $licenses ) ) {
                return $licenses_by_module_type;
            }

            foreach ( $licenses as $module_id => $module_licenses ) {
                $fs = self::get_instance_by_id( $module_id );
                if ( false === $fs ) {
                    continue;
                }

                $licenses_by_module_type[ $fs->_module_type ] = array_merge( $licenses_by_module_type[ $fs->_module_type ], $module_licenses );
            }

            return $licenses_by_module_type;
        }
115961
public function getAuthentication()
    {
        if ($this->useAgent) {
            return $this->getAgent();
        }

        if ($this->privateKey) {
            return $this->getPrivateKey();
        }

        return $this->getPassword();
    }
282843
private function isValidLicenseString($license)
    {
        $tokens = array(
            'po' => '\(',
            'pc' => '\)',
            'op' => '(?:or|and)',
            'lix' => '(?:NONE|NOASSERTION)',
            'lir' => 'LicenseRef-\d+',
            'lic' => '[-+_.a-zA-Z0-9]{3,}',
            'ws' => '\s+',
            '_' => '.',
        );

        $next = function () use ($license, $tokens) {
            static $offset = 0;

            if ($offset >= strlen($license)) {
                return null;
            }

            foreach ($tokens as $name => $token) {
                if (false === $r = preg_match('{' . $token . '}', $license, $matches, PREG_OFFSET_CAPTURE, $offset)) {
                    throw new \RuntimeException('Pattern for token %s failed (regex error).', $name);
                }
                if ($r === 0) {
                    continue;
                }
                if ($matches[0][1] !== $offset) {
                    continue;
                }
                $offset += strlen($matches[0][0]);

                return array($name, $matches[0][0]);
            }

            throw new \RuntimeException('At least the last pattern needs to match, but it did not (dot-match-all is missing?).');
        };

        $open = 0;
        $require = 1;
        $lastop = null;

        while (list($token, $string) = $next()) {
            switch ($token) {
                case 'po':
                    if ($open || !$require) {
                        return false;
                    }
                    $open = 1;
                    break;
                case 'pc':
                    if ($open !== 1 || $require || !$lastop) {
                        return false;
                    }
                    $open = 2;
                    break;
                case 'op':
                    if ($require || !$open) {
                        return false;
                    }
                    $lastop || $lastop = $string;
                    if ($lastop !== $string) {
                        return false;
                    }
                    $require = 1;
                    break;
                case 'lix':
                    if ($open) {
                        return false;
                    }
                    goto lir;
                case 'lic':
                    if (!$this->isValidLicenseIdentifier($string)) {
                        return false;
                    }
                    // Fall-through intended
                case 'lir':
                    lir:
                    if (!$require) {
                        return false;
                    }
                    $require = 0;
                    break;
                case 'ws':
                    break;
                case '_':
                    return false;
                default:
                    throw new \RuntimeException(sprintf('Unparsed token: %s.', print_r($token, true)));
            }
        }

        return !($open % 2 || $require);
    }
572381
public function get_license() {

		if ( ! $this->requires_license() && ! $this->is_wordpress_available() ) {
			return 'free';
		}
		$license_data = get_option( $this->get_key() . '_license_data', '' );

		if ( empty( $license_data ) ) {
			return get_option( $this->get_key() . '_license', '' );
		}
		if ( ! isset( $license_data->key ) ) {
			return get_option( $this->get_key() . '_license', '' );
		}

		return $license_data->key;
	}
1087963
public function getSignatureUrl()
    {
        return $this->getBaseUrl().str_replace(
            array_keys($this->getPathParameters()),
            array_values($this->getPathParameters()),
            $this->getPath()
        );
    }
1024015
public function getIndividualLicense(string $license): array
    {
        return $this->getApi()->setAccept('application/vnd.github.drax-preview+json')->request($this->getApi()
                                                                                                    ->sprintf('/licenses/:license',
                                                                                                        $license));
    }
1299125
public function getFRegularUnitPrice()
    {
        return \OxidEsales\Eshop\Core\Registry::getLang()->formatCurrency($this->getRegularUnitPrice()->getPrice());
    }