+ Start a Discussion
SF Buzz VutukuriSF Buzz Vutukuri 

How to get version number of package

HI,
We got a requirement, need to get the version number of a installed package from PHP side so that we can maintain dffrnt folders from each version in PHP.
please help me in getting version number of installed package from the side of PHP through API
Gaurav NirwalGaurav Nirwal
This isn't necessarily the answer you're looking for, but one way to do this could be to just have a static string member variable in a class which becomes part of your package. Each time you update the package you could update the value of the string and then read that from wherever else you need to.

// the class
class CVersionTracker
{
  public static string version = "1.0";
}

// inside a method of some other class
if (CVersionTracker.version == "1.0")
{
    // take some action
}
else
{
    // take the new improved action!
}
Depending on your requirements for the version number of course, an integer or double might be the simpler option (though it maybe not reflect the actual version) as it would let you leverage the > and < operators.
SF Buzz VutukuriSF Buzz Vutukuri
Hi Matthews,

Thanks for your solution.

How to access that class from Other Technology like Java or PHP.

can we use MetaData??

or 

can we implement  that class as SOAP or REST custom Service class


Thanks