CiviCRM: Difference between revisions

No edit summary
use Subpages template
 
(6 intermediate revisions by 2 users not shown)
Line 2: Line 2:
{{#ev:vimeo|192125770}}
{{#ev:vimeo|192125770}}


== Subpages ==
{{Subpages|}}
There are several articles that delve into the specific aspects of CiviCRM
{{#subpages:}}


== Documentation ==
== Documentation ==
Line 55: Line 53:


== Upgrading ==
== Upgrading ==
There is a long guide on [http://wiki.civicrm.org/confluence/display/CRMDOC/Upgrading+CiviCRM+for+Drupal+7 how to upgrade CiviCRM for drupal]  
[[{{PAGENAMEE}}/upgrade]]


You should be familiar with all the steps described in the manual, and understand how the particular steps impact/affect your installation.  The short version below is known to work with our setup, and with 'routine' upgrades.
== Debugging and the CV command-line ==


Here is the short version:
If you have your CiviCRM sending errors to the Drupal Watchdog Log (CiviCRM Administer > System Settings > [https://equality-tech.com/civicrm/admin/setting/debug?reset=1 Debugging and Error Handling]), you can simply navigate to it in the Drupal Admin (Reports > [https://equality-tech.com/admin/reports/dblog Recent log messages])
# backup your database(s) <code>sudo ~/bin/backup.db.sh drupal</code> <code>sudo ~/bin/backup.db.sh civicrm</code> <ref>[[Mysqldump]]</ref>
# download the code <code> wget https://download.civicrm.org/civicrm-4.6.5-drupal.tar.gz</code>
# put site in maintenance mode<code>drush vset maintenance_mode 1</code> (Make sure you are also logged in as Admin)
# move old code, and unpack new code <code>mv civicrm /tmp/ && tar xvzf civicrm-4.6.5-drupal.tar.gz</code>
# run the upgrade script <code>/civicrm/upgrade?reset=1</code>
# put site in operation mode<code>drush vset maintenance_mode 0</code>
# toast


The even shorter version is to use [[drush]] <code>civivcrm-upgrade</code> does all the above for you.
== Debugging ==
There are many tools you can use to debug your CiviCRM instance.
There are many tools you can use to debug your CiviCRM instance.
One of these is the <code>cv</code> tool [https://github.com/civicrm/cv available on Github].
One of these is the <code>cv</code> tool [https://github.com/civicrm/cv available on Github].
Line 144: Line 132:


You can create your own tokens by implementing <code>hook_civicrm_tokens()</code> and  <code>hook_civicrm_tokenValues()</code>.  See  
You can create your own tokens by implementing <code>hook_civicrm_tokens()</code> and  <code>hook_civicrm_tokenValues()</code>.  See  
<source lang="php">
<syntaxhighlight lang="php">
<?php
<?php
/**
/**
Line 302: Line 290:
     }
     }
}
}
</source>
</syntaxhighlight>


* [https://civicrm.stackexchange.com/questions/2558/tokens-for-custom-field-set-with-multiple-records?rq=1 Stack Exchange]
* [https://civicrm.stackexchange.com/questions/2558/tokens-for-custom-field-set-with-multiple-records?rq=1 Stack Exchange]
Line 357: Line 345:
== Database ==
== Database ==
The database code in CiviCRM is divided into two logical sections: the DAO and the BAO.  The BAO holds the "business logic" for objects and extends the DAO.  The DAO is concerned with data to/from the database backend and it's definition (object to relational database mapping, aka "[[wp:Object-relational mapping|ORM]]").  Both are an extension of the [https://pear.php.net/manual/en/package.database.db-dataobject.php PEAR DB DataObject] class.  As of August 2015, this is true and [https://civicrm.org/node/95 this blog post from 2006] gives some more (early) background.
The database code in CiviCRM is divided into two logical sections: the DAO and the BAO.  The BAO holds the "business logic" for objects and extends the DAO.  The DAO is concerned with data to/from the database backend and it's definition (object to relational database mapping, aka "[[wp:Object-relational mapping|ORM]]").  Both are an extension of the [https://pear.php.net/manual/en/package.database.db-dataobject.php PEAR DB DataObject] class.  As of August 2015, this is true and [https://civicrm.org/node/95 this blog post from 2006] gives some more (early) background.
<source lang="php">
<syntaxhighlight lang="php">
// from CRM/core/DAO.php
// from CRM/core/DAO.php


Line 363: Line 351:
require_once 'DB/DataObject.php'
require_once 'DB/DataObject.php'
class CRM_Core_DAO extends DB_DataObject
class CRM_Core_DAO extends DB_DataObject
</source>
</syntaxhighlight>
In 2009, [https://civicrm.org/node/597 Doctrine was proposed] as a OODB approach instead of an ORM.  There are [https://civicrm.org/blogs/dharmatech/data-mapper-pattern-civicrm-architecture-proposal other discussions too] in the "Architecture Series" that are worth reviewing if you want to know more about database development in CiviCRM.
In 2009, [https://civicrm.org/node/597 Doctrine was proposed] as a OODB approach instead of an ORM.  There are [https://civicrm.org/blogs/dharmatech/data-mapper-pattern-civicrm-architecture-proposal other discussions too] in the "Architecture Series" that are worth reviewing if you want to know more about database development in CiviCRM.