Hot answers tagged

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,644
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
  • 12.9k
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,835
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
  • 12.9k
6 votes

What is the recommended level of PHP for CiviCRM? There seems to be some inconsistencies

CiviCRM PHP requirements recommends PHP5.5 or greater, and notes PHP5.3.10 is the bare minimum required. As well as this, you want to be sure your PHP version is actively getting security updates, and ...
Chris Burgess's user avatar
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,664
6 votes
Accepted

Recommended version of PHP?

The safest bet is probably 5.5. 5.6 ought to work but hasn't been tested as thoroughly. As a core CiviCRM developer I currently use 5.5.9 in my test environment. You should also look at which version ...
Coleman's user avatar
  • 17.5k
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
  • 17.5k
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,664
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
Accepted

Is CiviCRM 4.6.x compatible with PHP 7?

No, it is planned for 4.8, but could use some help (with funding or investigating issues). https://issues.civicrm.org/jira/browse/CRM-17789
Catorghans's user avatar
  • 3,544
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,664
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,664
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,664
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
  • 867
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
  • 12.9k
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

Why does the mailer processQueue method 'shuffle' the array of possible locks?

I don't know the original authors' intent but can find some background and share a theory: Background: To figure out the origin of some code, it sometimes helps to spot-check the branches in the old ...
Tim Otten's user avatar
  • 5,664

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