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) »
  • Is there a way to change the path of Extensions to absolute?
Pages: [1]

Author Topic: Is there a way to change the path of Extensions to absolute?  (Read 450 times)

merewell

  • I’m new here
  • *
  • Posts: 1
  • Karma: 0
  • CiviCRM version: 4.4.6
  • CMS version: WordPress
  • MySQL version: 23
  • PHP version: 23
Is there a way to change the path of Extensions to absolute?
July 16, 2014, 05:15:39 am
We're running Wordpress and installed CiviCRM yesterday. We're using Amazon Elastic Beanstalk to manage our scaling, so the relative path settings for Upload Directories won't work in our situation because when traffic increases, new instances spin up from an image, deleting anything that was installed after the first instance was created.

The solution we use for Wordpress is to have uploads go to Amazon Cloudfront/S3, not the instance. I was hoping that we could do a similar setup for CiviCRM, but the Upload Directories don't seem to support absolute urls, which makes it difficult for us to use CiviCRM for our needs.

Is there a way to force Civi to accept absolute urls?

totten

  • Administrator
  • Ask me questions
  • *****
  • Posts: 695
  • Karma: 64
Re: Is there a way to change the path of Extensions to absolute?
July 16, 2014, 01:26:07 pm
You can define the path using PHP code -- see http://wiki.civicrm.org/confluence/display/CRMDOC/Override+CiviCRM+Settings . I'm not sure if that'll work with a relative path per-se, but even if doesn't, you could generate the absolute path dynamically, e.g.

Code: [Select]
<?php
global $civicrm_setting;
$civicrm_setting['Directory Preferences']['extensionsDir'] = getcwd() . '/path/to/extensions-dir';
$civicrm_setting['URL Preferences']['extensionsURL'] = 'http://example.com/pathtoextensiondir';

You might experiment with computing the path based on a couple different options -- getcwd(), __DIR__, getenv'(SOME_VAR'), etc -- and then pick the best.

Chris Burgess

  • Ask me questions
  • ****
  • Posts: 675
  • Karma: 59
Re: Is there a way to change the path of Extensions to absolute?
July 24, 2014, 11:06:49 am
AFAIK both Wordpress and Drupal can readily use entirely relative paths for files etc - fixing this would be a good developer experience improvement since it also affects how portable sites are (along with things like DEFINER in .sql). One of those things that stands out as needing extra special care with CiviCRM compared to the host CMS.

Interested to hear how you get along.
@xurizaemon ● www.fuzion.co.nz

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Discussion »
  • Extensions (Moderators: mathieu, totten, kasiawaka) »
  • Is there a way to change the path of Extensions to absolute?

This forum was archived on 2017-11-26.