getConstantValue('TAO_RELEASE_STATUS'); return in_array($releaseStatus, ['demo', 'demoA', 'demoB', 'demoS']); } /** * @return string */ public function getVersionName() { $version = $this->getPlatformVersion(); if ($this->hasOption(self::OPTION_BUILD_NUMBER)) { $buildNumber = $this->getOption(self::OPTION_BUILD_NUMBER); $version = 'v' . $version; $version = is_numeric($buildNumber) ? "{$version}+build{$buildNumber}" : $version; } return $version; } /** * @return string * @throws \common_exception_Error * @throws \common_ext_ExtensionException */ public function getProductName() { return $this->getConstantValue('PRODUCT_NAME'); } /** * @return string * @throws \common_exception_Error * @throws \common_ext_ExtensionException */ public function getPlatformVersion() { return $this->getConstantValue('TAO_VERSION'); } /** * @return string * @throws \common_exception_Error * @throws \common_ext_ExtensionException */ public function getDefaultEncoding() { return $this->getConstantValue('TAO_DEFAULT_ENCODING'); } /** * Return true if platform is on debug mode * * @return bool */ public function isDebugMode() { return defined('DEBUG_MODE') && (DEBUG_MODE === true); } /** * @return bool */ public function isInstallationFinished() { return $this->hasOption(self::OPTION_INSTALLATION_FINISHED) && $this->getOption(self::OPTION_INSTALLATION_FINISHED); } /** * @param string $constantName * @return string * * @throws \common_exception_Error * @throws \common_ext_ExtensionException */ private function getConstantValue($constantName) { $serviceLocator = $this->getServiceLocator(); if (!$serviceLocator instanceof ServiceLocatorInterface) { throw new common_exception_Error(); } return $serviceLocator->get(common_ext_ExtensionsManager::SERVICE_ID) ->getExtensionById('tao') ->getConstant($constantName); } }