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) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Extension depending on another extension
Pages: [1]

Author Topic: Extension depending on another extension  (Read 929 times)

Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
Extension depending on another extension
May 06, 2013, 06:06:10 am
Is there a recommended way to deal with an extension that relies on another extension being installed and enabled? Or should we as a rule always assume that an extension can run in a core CiviCRM environment without any other extension?
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Extension depending on another extension
May 06, 2013, 07:38:48 am
Interesting question--do you have a specific case in mind or is this still just theoretical?
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Extension depending on another extension
May 06, 2013, 10:26:20 am
Seems like this could fairly easily be added to the xml info if it's not already supported.
Try asking your question on the new CiviCRM help site.

Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
Re: Extension depending on another extension
May 06, 2013, 11:00:15 am
Hershel,

I am currently working on an upgrade project where we have two parts of code that are really distinct. One is a synchronization with an Oracle application which I would prefer to stick in a separate extension. That is easier for maintenance purposes.

But in the general customization extension for that client we create a specific config file that holds some specific config info. I do need that file every now and then in the sync extension so in the ideal world I would just make the sync extension dependent on the other one?

Coleman, should I raise an issue for this and assign it to totten?
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

totten

  • Administrator
  • Ask me questions
  • *****
  • Posts: 695
  • Karma: 64
Re: Extension depending on another extension
May 06, 2013, 11:18:22 am
I agree that this is important functionality.

Quote from: Coleman Watts on May 06, 2013, 10:26:20 am
Seems like this could fairly easily be added to the xml info if it's not already supported.

*blink*

Adding to the xml? Easy. Actually managing the dependencies? Different topic.

The real question is how much we want to invest in writing our own dependency manager. There's already a decent/popular one written for PHP -- https://getcomposer.org/ . The project we need to do is adapting that dependency manager to work with Civi extensions.

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Extension depending on another extension
May 06, 2013, 11:31:15 am
I think Coleman may have meant something very simple, like how Drupal module dependencies work. You add the dependency to the XML and then all CiviCRM has to do is not allow you to enable an extension that is missing a dependency and show you a message that X depends on Y which is not enabled/installed and that's it.

Then it's up to you to install Y.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
Re: Extension depending on another extension
May 06, 2013, 12:22:37 pm
I agree with Hershel that is the easy option, and I would be happy with that:
Quote
like how Drupal module dependencies work. You add the dependency to the XML and then all CiviCRM has to do is not allow you to enable an extension that is missing a dependency and show you a message that X depends on Y which is not enabled/installed and that's it.

But I can also see the point Tim is making. Why not use a dependency manager like Composer? I have not worked with composer myself, feedback I am getting from a guy who has worked with it is that it has the potential to get mighty complicated. Would it be easy to just start with the simple version sketched by Hershel?
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Extension depending on another extension
May 06, 2013, 02:36:45 pm
The example I have is that I re-use a lot of functionality in reports that I wrote for our customers & reports written for PTP. PTP want their reports packaged separately. A base class/ extension would be better than copy and paste....
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

jcasharpe

  • I post occasionally
  • **
  • Posts: 57
  • Karma: 5
    • Woodlands Church
  • CiviCRM version: 4.4.6
  • CMS version: Drupal 7
  • MySQL version: MariaDB 10.0.13
  • PHP version: 5.5
Re: Extension depending on another extension
May 10, 2013, 03:28:06 pm
Another consideration is the concept of 'weight' of the extensions i.e. when running the hooks which run first? As soon as you build dependencies you need to explicitly place guarantees on the order that hooks will run between modules.

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: Extension depending on another extension
May 15, 2013, 06:29:46 am
+1 for some form of dependency management between extensions along the lines of Drupal, where you can specify particular versions etc.

+1 for reusing an existing dependency manager like composer or even Drupal's.
Co-author of Using CiviCRM https://www.packtpub.com/using-civicrm/book

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Extension depending on another extension

This forum was archived on 2017-11-26.