Package dependency?

Permalink
Hello World!
I am wondering if there is a way to define package dependencies in Concrete5. I would like to have my most frequently used stuff in one package, and make that package a 'prerequisite' for some projects, without having to manually keep track of those projects, that use the servicees of this 'favorite' pack. Anyone any ideas, on how to achieve this, or something similar? Thanks!

 
JohntheFish replied on at Permalink Best Answer Reply
JohntheFish
Something I regularly use in a package installer is a test for a prerequisite package (off the top of my head, so probably not exact code):
function install(){
  $pre_pkg = Package::getByHandle('prerequisite_handle');
  if (!is_object($pre_pkg)){
    throw new Exception (t('Prerequisite package required'));
  }
  // usual install stuff ......
  //
  //
}


You can also embed code to load another package from the installer of one package. But beware that it could all mount up above php execution limits.

There was a thread on this a year or so ago, but no real conclusion. It had thought on other code to solve related parts of the problem.

In the c5 marketplace, the difficulty for developers is commercial dependencies between packages. Frz posted some comments in the above mentioned thread.
szucslaszlo replied on at Permalink Reply
I understand. Thanks!
fabienapd replied on at Permalink Reply
fabienapd
the page redirect addon does that. have a look at it's controller for code sample.

http://www.concrete5.org/marketplace/addons/page-redirect/...
szucslaszlo replied on at Permalink Reply
Nice! This is very much like what I want to achieve. I shall take a look into it. Thank you!