06 January, 2010
By pkeogan
Filed under Architecture

How much server (disk space and memory) do I need to run my CiviCRM implementation....

The answer is, of course, it depends. But what are the critical factors?

-- Data base size (Number of contacts and number of custom data fields, relationships, groups, etc.)
-- Number of users (light usage vs. heavy usage)
-- What other applications will be running? (A CMS with a small data base or Jasper Reports with a lot of simultaneous users.)

I think it would be good to put forth some guidelines or rules of thumb.

For example for a database with 30,000 contacts, 200 custom data fields, a few dozen groups and relationships, integrated with a Drupal website with 200 pages with 5-10 heavy Civi users and a few hundred authenticated users….what you recommend and why? What if those 5-10 Civi users were also running Jasper reports?

If you have experience hardware sizing or, even better, if you are a hosting provider I’d love to hear what...

Read more
06 January, 2010
By Eileen
Filed under Architecture

Recently someone asked about setting up an autocomplete in a profile where the person completing the form would be offered the name of existing organisations in the database. We have implemented this with a couple of different variations and I did promise to provide some information on this so here goes. I’ll try to explain a whole lot of ‘customising civicrm’ concepts but this isn’t a step-by-step recipe you’ll have to add a fair bit of technical know-how/ extra reading to flesh this out for your own purposes. I have added a recipe-type summary at the end just to sum up. Areas I will touch on are:




  • Customising a template
  • ...
Read more
09 December, 2009
By shot
Filed under Architecture, CiviCRM

As we’re closer and closer to the release of CiviCRM 3.1, we began thinking what to schedule in CiviCRM 3.2. As one of the features we want to add is the ability to undelete certain CiviCRM entities, we want to discuss with the community the initial approach to undelete that we came up with – along with a sketch of logging functionality that we consider for a future release.

General Remarks

To make both of these features successful, we need something that’s both generic (i.e., works in the same way – or, at least, similarily – for all/most of the CiviCRM tables) and transparent from the perspective of the existing codebase. The experience with multilingual support done in that matter convinced us that it’s a sane approach; move as much as possible to the database layer, sprinkle with views and triggers if needed, add a bit of logic to CRM_Core_DAO and make the existing codebase blissfully unaware that there’s hidden functionality beneath (with the...

Read more
18 November, 2009
By lobo
Filed under v3.1, Architecture, Drupal

The past two days a group of us gathered at the Mitchell Kapor Foundation offices in downtown San Francisco for the first CiviCRM Test Sprint. Some of the highlights of the event were:

  • Introducing the concept of testing and our current framework for unit testing. CiviCRM uses PHPUnit for unit testing. We also use XDebug for code coverage. You can see the latest results of our testing here
  • Improved the test coverage for our upcoming CiviCRM 3.1. Our goal before the final release of 3.1 is to have 80% coverage of the CiviCRM API and 50% coverage of the CRM classes. We are well on our way to meeting this goal.
  • Improved the framework so we can make things easier and more efficient for future testers. Sasha worked on automating creation of CiviCRM objects via a generic method. We extended this to create all...
Read more
29 July, 2009
By lobo
Filed under v2.2, Architecture, Schools
I'm working on deploying CiviCRM for my kids school website. Part of the project requires us to expose the parent child relationship information on the website and allow parents to edit their child information. I accomplished this using a combination of civicrm hooks, custom templates, permissioned relationships and custom code in a drupal module. You can access the module and template code here. The broad steps are:
  • Implement hook_civicrm_pageRun for the profile view page (CRM_Profile_Page_Dynamic). Only implement this hook for the specific profile id's you want relationship information. In this case we have two profiles, a Parent Profile (gid=3) and a Student Profile (gid=4)
  • The pageRun hook also adds the module's template directory to the smarty include path, so we dont have to set it globally. This also allow multiple modules to append different template directories to the template...
Read more
20 July, 2009
Filed under Architecture
Some recent discussions and debates about Active Record and Data Mapper have popped up in the context of new architectural proposals for CiviCRM from Dharmatech and raSANTIAGO. We think it is important that the differences between each is known and to clarify what are some erroneous perceptions. This is not to claim that either design pattern is above criticism. It is to say, that there are some misperceptions that prevent a more intelligent discussion of the trade-offs between these two design patterns. Our hope is to bring some clarity to this discussion. What is Active Record

     Active Record, properly defined, is a design pattern where an object is represented as a record on a table in a relational database. As most know at this point this has been the ORM design pattern of choice in Ruby on Rails(RoR), although that is starting to change a bit. Because of the assumption of "one object - one record" there are a lot of...

Read more
15 July, 2009
Filed under Architecture

Current CiviCRM architecture pitfalls

rasantiago has proposed a new CiviCRM architecture with details of the ORM layer. Torenware commented on the latter and mentioned some particular scalability issues.  Our own experience with the Active Record design pattern proposed by rasantiago is that it works well for small projects but doesn't scale well.  We believe that CiviCRM is now... Read more
08 July, 2009
Filed under Architecture
This is a follow up to our last post proposing a new architecture for CiviCRM. Much appreciation for everyone's patience. Following from our last post we want to go over the use of Doctrine, a PHP implementation of the Active Record design pattern made popular through Ruby on Rails. The Doctrine Project has done a great job of maintaining detailed documentation and has a lot of features that we believe everyone will find useful when working with CiviCRM objects. We have posted some of our working code for the new ORM and REST API here at git hub.We have given this code set the working name civiBASE.
For those who are not familiar with Active Records and ORM a little background will help. An object relational mapping (ORM) layer translates objects... Read more
22 June, 2009
Filed under Architecture
Here at raSANTIAGO we are entering our third year with CiviCRM and still find ourselves struggling to make desired changes to the codebase. Too often we have expressed desired to re-architect and re-factor the CiviCRM. Recently we have completed two major projects that had us deeper in the codebase then before and realizing that we had to stop complaining. So we set ourselves to figuring out a good target architecture and a migration path that would not interfere with current development but give us the opportunity to engineer in patterns which have produced stable, extensible and maintainable systems for us. In the process, we wanted to deal with serious issues like advancing the API, advance our abilities to test and radically increase code reuse.
After a lot of work and prototyping we think we may have found an architecture that will work and a path to that architecture. From this work we offer a... Read more
03 February, 2009
Filed under v2.2, Architecture
Do you wish you could configure custom fields to store Employment History, Educational Background, Volunteer Skills or other types of information where you may need to enter multiple sets of values for a contact? Starting with CiviCRM 2.2, you can do just that. For example, if you need to collect Employment History - you might have fields for Job Title, Start Date, End Date, and Reason for Leaving. Enabling the "multiple records" setting in that custom data group will allow you to enter that information for multiple jobs. You can also set the maximum number of records which can be recorded per contact (you might only want data for the three most recent jobs).

How do I set up a multiple-record custom data group?

  • Go to Administer CiviCRM » Customize » Custom Data
  • Click "New Group of Custom Fields"
  • Select Contacts, Individuals, Households or Organizations for "Used For" record type.
  • ...
Read more