CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Discussion »
  • Extensions (Moderators: mathieu, totten, kasiawaka) »
  • Dependencies
Pages: [1]

Author Topic: Dependencies  (Read 1304 times)

JoeMurray

  • Administrator
  • Ask me questions
  • *****
  • Posts: 578
  • Karma: 24
    • JMA Consulting
  • CiviCRM version: 4.4 and 4.5 (as of Nov 2014)
  • CMS version: Drupal, WordPress, Joomla
  • MySQL version: MySQL 5.5, 5.6, MariaDB 10.0 (as of Nov 2014)
Dependencies
July 25, 2012, 05:29:10 am
Is it possible to state dependencies for the CiviCRM version compatibility of an extension in a manner similar to the very flexible and precise approach used by Drupal .info files: see dependencies (Optional) section of http://drupal.org/node/542202 ?

The reason is that I would like sometimes to say that an extension only works with 4.1, and other times that it is dependent on >4.1.
Co-author of Using CiviCRM https://www.packtpub.com/using-civicrm/book

totten

  • Administrator
  • Ask me questions
  • *****
  • Posts: 695
  • Karma: 64
Re: Dependencies
July 25, 2012, 11:29:53 am
From the perspective of the core code, the convention doesn't matter because the compatibility field is advisory -- i.e. Civi prints it out on the screen but otherwise ignores it.

This is changing as we move the extension directory from SVN (extdir.civicrm.org) into civicrm.org's Drupal database (CRM-10535 et al) -- the extension directory will filter out incompatible extension-releases. Kasia and I are going to talk this afternoon about how to track and compare "compatibility" in Drupal's data model, and we can post back here with issues/ideas/solutions.

totten

  • Administrator
  • Ask me questions
  • *****
  • Posts: 695
  • Karma: 64
Re: Dependencies
July 25, 2012, 01:31:28 pm
I agree that this is a problem, but I don't think this change could make it in time for the 4.2 release cycle. Apparently it would be harder to get this working in the new extension directory (given the way we use Drupal Views). For the moment, we'll stick to the current XML spec which allows a list of version numbers:

Code: [Select]
  <compatibility>
    <ver>4.1</ver>
    <ver>4.2</ver>
  </compatibility>

If we do change this at some point, the change could be backward compatible -- because the core CiviCRM app doesn't do any enforcement of the <ver> tag. All the version-compatibility tests will be done in the distribution channel (i.e. civicrm.org) which can updated without any changes to the core app.

Some food for thought, though: there are several "dependency" related features that would be useful in the longer term (e.g. declaring dependencies between two extensions and automatically downloading them; fetching .zip or .tar.gz files; fetching directly from GIT/SVN). A great way to get this functionality might be integrating our extension system with composer (getcomposer.org, https://github.com/composer/installers). I don't believe this should block us from distributing extensions now, but it would be a good enhancement.

JoeMurray

  • Administrator
  • Ask me questions
  • *****
  • Posts: 578
  • Karma: 24
    • JMA Consulting
  • CiviCRM version: 4.4 and 4.5 (as of Nov 2014)
  • CMS version: Drupal, WordPress, Joomla
  • MySQL version: MySQL 5.5, 5.6, MariaDB 10.0 (as of Nov 2014)
Re: Dependencies
July 25, 2012, 02:05:03 pm
Thanks for the useful thought and direction on this. It may allow module extensions to handle the absence of hook_install / hook_uninstall in 4.1 more gracefully, and in the future allow one to specify dependencies between extension versions in a way that will avoid the problems that used to occur with Drupal's problematic date module and Microsoft's old dll hell.
Co-author of Using CiviCRM https://www.packtpub.com/using-civicrm/book

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Discussion »
  • Extensions (Moderators: mathieu, totten, kasiawaka) »
  • Dependencies

This forum was archived on 2017-11-26.