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) »
  • How do you find the UserFramework via api?
Pages: [1]

Author Topic: How do you find the UserFramework via api?  (Read 436 times)

adixon

  • I post frequently
  • ***
  • Posts: 314
  • Karma: 19
    • Blackfly Solutions
How do you find the UserFramework via api?
March 21, 2014, 12:05:29 pm
In other words, it would appear that this value:
Code: [Select]
$config = CRM_Core_Config::singleton();
$config->userFramework; 
is not accessible via the api?

I'm just trying to figure out if they're using drupal, which I guess could also be done using a function_exists call...

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: How do you find the UserFramework via api?
March 24, 2014, 12:59:30 am
No, as far as I know you can not access the config via the API.
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: How do you find the UserFramework via api?
March 24, 2014, 01:30:34 pm
You can get it through accessing domain.get - but it feels pretty long-winded & it's not tested so it doesn't offer you any stability reward on your code-lines
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

adixon

  • I post frequently
  • ***
  • Posts: 314
  • Karma: 19
    • Blackfly Solutions
Re: How do you find the UserFramework via api?
March 26, 2014, 09:32:32 am
Indeed, I was accessing from domain.get and it broke for 4.4  :'(

On the other hand, it's kind of a good kick in the derriere (as we say here in Canada) to reconsider whether I really need to include userframework-specific code after all.

Thinking about the specifics here, it was because I'd grown too accustomed to Drupalisms and was using the watchdog to log stuff, when in fact I can just log to the CiviCRM log and use the setting that also logs that to the framework log.

Thanks for your feedbacks,

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • How do you find the UserFramework via api?

This forum was archived on 2017-11-26.