pluginFile = $pluginFile; $this->baseName = plugin_basename($pluginFile); $this->slug = basename($this->baseName, '.php'); $this->license = $license; $this->attrs = $attrs; $this->itemName = $itemName; } /** * put your comment there... * * @param mixed $ownerName * @return mixed */ public function activateLicense($ownerName) { return (int) $this->makeCall(__FUNCTION__, compact('ownerName'))->getResponseData(); } /** * put your comment there... * * @param mixed $ownerName * @return mixed */ public function checkLicense($ownerName) { return (int) $this->makeCall(__FUNCTION__, compact('ownerName'))->getResponseData(); } /** * put your comment there... * * @param mixed $ownerName * @return mixed */ public function deactivateLicense($ownerName) { return (int) $this->makeCall(__FUNCTION__, compact('ownerName'))->getResponseData(); } /** * put your comment there... * */ public function getAttrs() { return $this->attrs; } /** * put your comment there... * */ public function getBaseName() { return $this->baseName; } /** * put your comment there... * */ public function getItemName() { return $this->itemName; } /** * put your comment there... * */ public function getPluginInformation() { # Check if there is update available for current extension $info = $this->jsonDecode($this->makeCall(__FUNCTION__)->getResponseData()); # Return result return $info; } /** * put your comment there... * */ public function getPluginUpdate() { # Check if there is update available for current extension $pluginUpdate = $this->jsonDecode($this->makeCall(__FUNCTION__)->getResponseData()); # Return result return $pluginUpdate; } /** * put your comment there... * */ public function getLicense() { return $this->license; } /** * put your comment there... * */ public function getPluginFile() { return $this->pluginFile; } /** * put your comment there... * */ public function getSlug() { return $this->slug; } /** * put your comment there... * */ public function hasUpdate() { # Get Last release version $pluginUpdate = $this->getPluginInformation(); $version = $pluginUpdate['currentVersion']; # Get Plugin current version $pluginData = get_plugin_data($this->getPluginFile()); # Return version details if there is new version/ otherwise return false $result = (version_compare($version, $pluginData['Version']) == 1) ? $pluginUpdate : false; return $result; } /** * put your comment there... * * @param mixed $method * @param mixed $params * @param mixed $postData * @return CJTServicesClientModule */ public function makeCall( $method, $params = null, $postData = null, $bodyEncoding = CJTServicesClient::BODY_ENCODING_JSON) { # Always include the following parameters $params = array_merge(array ( 'itemIdentifier' => $this->getItemName(), 'license' => $this->getLicense() , 'itemAttrs' => $this->getAttrs(), ), $params ? $params : array()); // Make API Call throuh Module base layer return parent::makeCall($method, $params, $postData, $bodyEncoding); } }