We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 5811
    • 1,717 Posts
    Few questions regarding packaging stuffs ...

    1/ What is the better way to get the version of the addon used in the buit package process ? I would like get this info inside snippets. How could I propagate this value.
    Do I create a system setting for each snippet and initialize this value inside the packaging process (and in this case how could I initialize system setting for snippets )
    or ...

    2/ How could be initialized the value "provider" of the package installed. Sometimes we have modx.com, sometines nothing.
      • 33976 ☆ A M B ☆
      • 571 Posts
      Hi Coroico,

      Albeit it’s not dealing about packages, you might want to give a look at the MODX getVersionData method.

      PS: you should have a mail before tomorrow smiley
        • 5811
        • 1,717 Posts
        Thanks Romain. getVersionData gives the version of Revo (e.g: 2.1.0 RC3). What I would like is to propagate during the packaging installation the correct version of the addon.
        I would like avoid to hard code the snippet version inside the files.

        But may be I could use the PKG_VERSION and PKG_RELEASE constantes used in the build.transport.php file and then the appropriate resolver assign these values inside snippets system settings.
        But I am not sure that this is the better way to do this. Any thought on this subject is welcome.
          • 33976 ☆ A M B ☆
          • 571 Posts
          In that case why not just create the system setting on your own (beside the "automation", i can’t see any benefit from my seat)?