Skip to main content
Share Your Experience: Take the 2024 Developer Survey
9 votes

How much symfony do I need to learn if I am going to be a CiviCRM core hacker?

You must be digging pretty deep if you're running into Symfony. Its introduction into the stack is fairly new. CiviCRM has been around for over ten years, so some of the technologies are pretty hip ...
universalhandle's user avatar
9 votes
Accepted

SOLVED: 'DB Error: extension not found' after PHP upgrade to version 7.0

Summarising the above conversation: The upgrade of PHP to version made the PEAR DB extension unavailable. So the exception "DB Error: extension not found" was thrown. Changing to the database ...
Kainuk - CiviCooP's user avatar
8 votes

What to do with "mcrypt" message after upgrading to PHP 7.2

As the author of that message, let me try and clarify ... The mcrypt extension is (only) used to encrypt selected passwords, and "selected" as far as I know usually only includes the smtp password, (...
Alan Dixon's user avatar
  • 6,851
7 votes
Accepted

Unexpected T_CLONE, expecting T_STRING (PHP 7, Drupal 7, Ubuntu 16.04)

PHP 7 is not supported yet - see CRM-17789 Also: this and this Update (Aug 2017): The information above was correct when it was written. Things have moved on and PHP 7.0 is supported from 4.7.12 ...
Aidan's user avatar
  • 13.5k
7 votes
Accepted

Why do click and open reports show times in UTC rather than the site's timezone?

Mailing clicks and opens are registered via scripts in extern (which are quite old) - and don't appear to use the cms environment - as such if the timezone isn't set for php and has defaulted to UTC - ...
Luke Stewart's user avatar
  • 1,890
7 votes
Accepted

Upgraded to PHP 7.2; no errors but Sparkpost doesn't receive and send CiviMail

PHP 7.2 does not have the mcrypt module, and the Sparkpost extension needs that module. If you can install php7.2-mcrypt as a pecl module Sparkpost will work. If not, I would move to php 7.1 for ...
Kevin Cristiano's user avatar
7 votes

Upgraded to PHP 7.2; no errors but Sparkpost doesn't receive and send CiviMail

I encountered the same problem and investigated a bit further... The SparkPost extension does not directly use mcrypt but it does use CRM_Utils_Crypt which makes use of mcrypt if it is available. If ...
Aidan's user avatar
  • 13.5k
6 votes
Accepted

What versions of PHP are used in CiviCRM's internal QA?

At time of writing, all PRs tests and scheduled tests run under Ubuntu 12.04 (PHP 5.3.10). There is an effort underway to introduce a test node for Ubuntu 16.04 (PHP 7.0) (although details are still a ...
Tim Otten's user avatar
  • 5,684
6 votes

Are there up-to-date CiviCRM coding standards available?

Using the Drupal standards in your IDE ought to get you most of the way. For fine-tuning you can see https://wiki.civicrm.org/confluence/display/CRMDOC/PHP+Code+and+Inline+Documentation and also try ...
Coleman's user avatar
  • 18.7k
6 votes
Accepted

How much symfony do I need to learn if I am going to be a CiviCRM core hacker?

Those are the three that we use now, although I'd usually prefer to read the guides rather than the autogenerated API docs, i.e. Symfony Service Container Symfony Event Dispatcher Symfony Console ...
Tim Otten's user avatar
  • 5,684
6 votes

timestamp mismatch

It turns out that if you are using Wordpress you need to set the timezone to specific location, e.g. London, rather than using the default UTC offset. When I used the London timezone the problem went ...
Marian Zastawny's user avatar
6 votes
Accepted

How to set a id attribute to button?

I believe you cannot set id to a button using php however you can define your own class for the button and use JS to set the id for that class. Here is the snippet to add class for button $this->...
Pradeep Nayak's user avatar
5 votes

Are there up-to-date CiviCRM coding standards available?

For IDE purposes, look at https://github.com/civicrm/coder/ This is a fork of drupal/coder which relaxes a number of conditions. (The coding practices in Civi differed from Drupal in some non-...
Tim Otten's user avatar
  • 5,684
5 votes
Accepted

Class naming and namespaces: best practice as an extension author?

The conventional approach Generally, the safe play is to make a file like <myextension>/CRM/MyExtension/MyClass.php: <?php class CRM_MyExtension_MyClass { ...} (Be sure to match the ...
Tim Otten's user avatar
  • 5,684
5 votes
Accepted

What are `*.mgd.php` files for?

So a little research takes me to Totten's blog where he lays out the rational for splitting out entity definitions into seperate PHP files. The full definition of the array format is laid out in the ...
ErichBSchulz's user avatar
  • 1,571
5 votes

Custom PHP not being picked up

The SagePay extension from Circle is outdated and is not supported for 5.x version. Mattwire has integrated sagepay payment processor in Eileen's CiviCRM OmniPay Multiprocessor extension. The simplest,...
Pradeep Nayak's user avatar
4 votes

What are the minimum and recommended changes to CiviCRM to support PHP 7?

None any more - as of 4.7.12, CiviCRM supports PHP7
michaelmcandrew's user avatar
4 votes
Accepted

How to let extension users choose cache system?

1. CRM_Utils_Cache::create() When looking through the list of cache drivers, you see options like Memcache, Memcached, and Redis. Generally there's little reason why a deployment would use all three -...
Tim Otten's user avatar
  • 5,684
4 votes
Accepted

Mailing stopped working after CiviCRM, PHP and Drupal upgrade

The issue was affecting multilingual installations. If the multilingual support is turned off in the settings everything works. Applying the fix solves the problem for multilingual installations. ...
Marko's user avatar
  • 877
4 votes

How to get CiviCRM root via PHP?

I found the answer in the docs here: https://docs.civicrm.org/dev/en/latest/framework/filesystem/#tip-programmatic-lookup_1 You can use the following: Civi::paths()->getPath("[civicrm.root]/.") ...
Sleewok's user avatar
  • 1,146
4 votes
Accepted

SQL Syntax Error - When starting civicrm with joomla

it seems php 7.2 is not compatible with 5.x.x or i do not know how to do the configuration i think downgrade the php would be the best solution but i wonder if there is other answer, and how to do it....
Jennifer Lee's user avatar
4 votes
Accepted

CiviCRM running very slow on local network

And once again I had found out the answer on my own, took a lot of time though... it is in components and administrator's civicrm.setting.php (both php file!) just simply change both localhost (see ...
Jennifer Lee's user avatar
4 votes

Cron breaks after upgrading PHP

As PHP develops, some code that used to work in older versions fails in newer versions. The CiviCRM code gets updated to accommodate those changes - but obviously if you don't upgrade you don't get ...
Aidan's user avatar
  • 13.5k
4 votes
Accepted

How to use CiviCRM REST API in external PHP code

I use CURL to call rest api. Here is the snippet you can ignore/remove many lines that sets curl variable. $url = 'http://domain.org/sites/all/modules/civicrm/extern/rest.php?entity=Contact&...
Pradeep Nayak's user avatar
4 votes
Accepted

What to do with "mcrypt" message after upgrading to PHP 7.2

After further investigation I'm extending my answer and splitting it in two. First addressing the mcrypt and php 7.2 issue and then the drupal/civicrm and php 7.2 compatibility. Php 7.2 and mcrypt ...
Leo Gallego's user avatar
4 votes

Upgraded php from 5.6.30 to 7.0.32, civicrm still gives PHP out of date error

It depends on your hosting server. It is usually possible to specify different PHP versions for command line (eg. php -v) and php that is used by your web server. If you have no need for PHP 5.6 ...
Matthew Wire's user avatar
3 votes
Accepted

Buildkit Site fails to load due to PHP ugrade from 5 to 7

It's on your php.ini config file. where it it depends on your OS, in ubuntu/debian it's under /etc/php5 and you have cli and fpm, check that the cli version enables the extension simplexml FYI, ...
Xavier's user avatar
  • 10.2k
3 votes

Buildkit Site fails to load due to PHP ugrade from 5 to 7

It seems to me you need to install the php-xml package. sudo apt-get install php-xml should get you there on Ubuntu.
ak5's user avatar
  • 31
3 votes
Accepted

best practice for using core base functions (CRM_Utils_System_Base) from an extension?

This base class is not intended to be used by itself, but extended based on the CMS. CiviCRM will automatically give you an instance of the correct object which extends this base class. You can access ...
Coleman's user avatar
  • 18.7k
3 votes
Accepted

Smarty and future proof code

Going forward, much of the Civi UI will be written in Angular. However at least 95% of the application uses Smarty and it's still a perfectly acceptable way to mark up a form or page. Depending on ...
Coleman's user avatar
  • 18.7k

Only top scored, non community-wiki answers of a minimum length are eligible