Piwik\Plugins\Marketplace\Environment::getPiwikVersion PHP Method

getPiwikVersion() public method

public getPiwikVersion ( )
    public function getPiwikVersion()
    {
        if (!empty($this->piwikVersion)) {
            return $this->piwikVersion;
        }
        return Version::VERSION;
    }

Usage Example

Example #1
0
 /**
  * @param  $pluginOrThemeName
  * @throws Exception
  * @return string
  */
 public function getDownloadUrl($pluginOrThemeName)
 {
     $plugin = $this->getPluginInfo($pluginOrThemeName);
     if (empty($plugin['versions'])) {
         throw new Exception('Plugin has no versions.');
     }
     $latestVersion = array_pop($plugin['versions']);
     $downloadUrl = $latestVersion['download'];
     return $this->service->getDomain() . $downloadUrl . '?coreVersion=' . $this->environment->getPiwikVersion();
 }
All Usage Examples Of Piwik\Plugins\Marketplace\Environment::getPiwikVersion