| 1: | <?php |
| 2: | |
| 3: | |
| 4: | |
| 5: | |
| 6: | |
| 7: | |
| 8: | namespace Aurora\System\Module; |
| 9: | |
| 10: | |
| 11: | |
| 12: | |
| 13: | |
| 14: | |
| 15: | |
| 16: | |
| 17: | abstract class AbstractLicensedModule extends AbstractModule |
| 18: | { |
| 19: | protected $isValid = null; |
| 20: | |
| 21: | public function __construct($sPath, $sVersion = '1.0') |
| 22: | { |
| 23: | parent::__construct($sPath, $sVersion); |
| 24: | $this->RequireModule('Licensing'); |
| 25: | } |
| 26: | |
| 27: | public function isValid() |
| 28: | { |
| 29: | if (!isset($this->isValid)) { |
| 30: | $oLicensing = \Aurora\System\Api::GetModule('Licensing'); |
| 31: | $this->isValid = $oLicensing ? ($oLicensing->Validate(self::GetName()) && $oLicensing->ValidatePeriod(self::GetName())) : false; |
| 32: | } |
| 33: | |
| 34: | return $this->isValid; |
| 35: | } |
| 36: | } |
| 37: | |