File "ProConfigBuilder.php"

Full Path: /home/analogde/www/Massage_v3_debug/MASSAGE_TEST/FTP/application/api/licensing/ProConfigBuilder.php
File size: 1.03 KB
MIME-type: text/x-php
Charset: utf-8

<?php
    class ProConfigBuilder {
        private $proPackagedID;

        public function __construct($proPackageID) {
            $this->proPackagedID = $proPackageID;
        }

        /**
         * @return mixed
         */
        public function getProPackagedID() {
            return $this->proPackagedID;
        }

        public function generateRelativeLicensePath() {
            return sprintf("license-%s.key", $this->getProPackagedID());
        }

        public function generateRelativeProfilePath() {
            return sprintf("profiles-%s.bin", $this->getProPackagedID());
        }

        public function renderProConfig($configTemplatePath) {
            $rawContents = file_get_contents($configTemplatePath);
            $profileLocalPath = $this->generateRelativeProfilePath($this->getProPackagedID());
            $licenseLocalPath = $this->generateRelativeLicensePath($this->getProPackagedID());

            return sprintf($rawContents, $profileLocalPath, $licenseLocalPath);
        }
    }