Aller directement à la fin des métadonnées
Aller au début des métadonnées

Requirements

Overview

  • Installation begins with the civicrm-$CMS integration module.
  • Installation may either:
    • Skinny installation: Begin with a .zip file containing (a) civicrm-$CMS integration module plus (b) install-bundle.php. Additional dependencies are downloaded during installation and placed into the correct spot (per CMS FHS).
    • Full installation: Begin with a single folder that contains all dependencies. Move pieces into the correct spot (per CMS FHS).
  • Consider Good Citizenship in Drupal/Wordpress/Joomla community
  • File work under https://issues.civicrm.org/jira/browse/CRM-16408

Pseudocode

 

 

 

File Structure (composer)

CMSLocal Pathdownload
D

sites/all/modules/civicrm (etal)

git clone GITHUB/civicrm-drupal.git LOCALPATH
Dsites/all/modules/civicrm/vendor (etal)composer install (download "packages" + deps;need to patch core for "packages") --prefer-source
D (skinny)sites/all/modules/civicrm/install-bundle.php(compiled from civicrm-core Civi/Install/*)
WPwp-content/plugins/civicrmgit clone civicrm-wordpress.git LOCALPATH
WPwp-content/plugins/civicrm/vendorcomposer install (download "packages" + deps;need to patch core for "packages") --prefer-source
WP (skinny)wp-content/plugins/civicrm/install-bundle.php(compiled from civicrm-core Civi/Install/*)
Jcomponents/com_civicrmgit clone civicrm-joomla-com.git LOCALPATH
Jplugins/quickicon/civicrmicongit clone civicrm-joomla-quickicon.git LOCALPATH
Jplugins/system/civicrmsysgit clone civicrm-joomla-system.git LOCALPATH
Jplugins/user/civicrmgit clone civicrm-joomla-user.git LOCALPATH
Jadministrator/components/com_civicrm/vendorcomposer install (download "packages" + deps;need to patch core for "packages") --prefer-source
J (skinny)TMP/com_civicrm/install-bundle.php(compiled from civicrm-core Civi/Install/*)

File Structure (special)

CMSLocal Pathdownload
D

sites/all/modules/civicrm (etal)

git clone GITHUB/civicrm-core.git LOCALPATH && composer install && php xml/GenCode.php
Dsites/all/modules/civicrm/drupal (etal)git clone http://...civicrm-drupal.git
WPwp-content/plugins/civicrmgit clone civicrm-wordpress.git LOCALPATH
WPwp-content/plugins/civicrm/civicrmgit clone http://...civicrm-core.git && composer install && php xml/GenCode.php
Jcomponents/com_civicrmgit clone civicrm-joomla-com.git LOCALPATH
Jplugins/quickicon/civicrmicongit clone civicrm-joomla-quickicon.git LOCALPATH
Jplugins/system/civicrmsysgit clone civicrm-joomla-system.git LOCALPATH
Jplugins/user/civicrmgit clone civicrm-joomla-user.git LOCALPATH
Jadministrator/components/com_civicrm/civicrm

git clone http://...civicrm-core.git && composer install && php xml/GenCode.php

File Structure (User Files)

CMSLocal PathChanges
Dsites/default/files/civicrmNo Change
Dsites/default/civicrm.settings.phpNo Change
WPwp-content/uploads/civicrm-filesreplacement for wp-content/plugins/files/
WPwp-content/uploads/civicrm/settings/civicrm.settings.phpnew path for settings files.  Must protect directory via .htaccess or ngnix directives.
Jcomponents/com_civicrm/civicrm.settings.php 
Jadministrator/components/com_civicrm/civicrm.settings.php 
Jmedia/civicrmNo Change

CLI Mockup (composer)

Use-caseDrupal StepsWP Steps
Download tar & install single-DB

cd sites/all/modules

curl http://foo.bar/civicrm-drupal-X.Y.tar.gz | tar xzf -

drush en -y civicrm

  => hook_install

      => (if missing) download zips (core+pkgs+vendor)

      => load civicrm.mysql in Drupal

      => initialize civicrm.settings.php (if non-existent)

      => create data folders

[OPTIONAL] drush cvapi extension.install key=org.civicrm.demodata

cd wp-content/plugins

curl http://foo.bar/civicrm-wordpress-X.Y.zip | unzip -

wp plugin activate civicrm

  => hook_install

      => (if missing) download zips (core+pkgs+vendor)

      => load civicrm.mysql in Drupal

      => initialize civicrm.settings.php (if non-existent)

      => create data folders

[OPTIONAL] wp civicrm api extension.install key=org.civicrm.demodata

Download via git & install split-DB with demo data

cd sites/all/modules

composer create-project https://github.com/civicrm/civicrm-drupal.git civicrm

  => load civicrm-core.git, civicrm-packages.git, deps

drush en -y civicrm

  => hook_install

      => load civicrm.mysql in Drupal

      => initialize civicrm.settings.php (if non-existent)

      => create data folders

drush civicrm move-db --to=mysql://user:pass@host:port/db

  => update civicrm.settings.php

  => foreach (SHOW TABLES LIKE old_db.civicrm_%) ALTER TABLE

[OPTIONAL] drush cvapi extension.install key=org.civicrm.demodata

cd wp-content/plugins

composer create-project https://github.com/civicrm/civicrm-drupal.git civicrm

  => load civicrm-core.git, civicrm-packages.git, deps

drush en -y civicrm

  => hook_install

      => load civicrm.mysql in Drupal

      => initialize civicrm.settings.php (if non-existent)

      => create data folders

drush civicrm move-db --to=mysql://user:pass@host:port/db

  => update civicrm.settings.php

  => foreach (SHOW TABLES LIKE old_db.civicrm_%) ALTER TABLE

 

[OPTIONAL] drush cvapi extension.install key=org.civicrm.demodata

 

Demo Data

  • Use example.com / example.org instead of Yahoo/Gmail
  • Move to an extenion

 

WP Plugin Repository Notes

 

Comments from WP Plugin Team (based on review of CiviCRM WP Plugin version 4.6):

  • I think the main issue here remains 'Is CiviCRM a separate, non WP, app, or is it a plugin?' Because it acts like both.
  • 20megs is still huge, but it's okay now. I will note that installing it locally on VVV took FOREVER. So people will complain. A lot.
  • The fact that, once installed, the plugin says it can't install civicrm is bad.
  • Asking to connect the DB is one thing, but saying "And we will install that DB for you!" is another. Don't have it install, JUST have it connect. This is why the 'what is your plugin?' issue is still an issue. It's behaving like a plugin that connects to CiviCRM (see Yourls plugins as an example) but then it's installing things for you...
  • Also I got this error: The user account used by your web-server - www-data - needs to be granted write access to the following directory in order to configure the CiviCRM settings file: //srv/www/vvv-ass/wordpress-plugins/htdocs/wp-content/plugins/files Why are you writing to the PLUGINS folder? That should never happen. You should write to wp-content/uploads/ if you have to. I would even suggest wp-content/uploads/civicrm/files/ to make sure no one gets derpy
  • I did a quick check and you guys are calling wp-content in multiple places. Absolutely that has to be fixed before you go anywhere.
 elseif ($config->userFramework == 'WordPress') {
      $url = preg_replace(
        '|wp-content/plugins/civicrm/civicrm/|',
        '',
        $config->userFrameworkResourceURL
      );

$defaults['userFrameworkResourceURL'] = $baseURL . "wp-content/plugins/civicrm/civicrm/";

  • When you hardcode in paths, or assume that everyone has WordPress in the root of their domain, you cause anyone using 'Giving WordPress it's own directory' (a VERY common setup) to break. In addition, WordPress allows users to change the name of wp-content, so you would break anyone who choses to do so. Please review http://codex.wordpress.org/Determining_Plugin_and_Content_Directories and update your plugin accordingly. And don't worry about supporting WordPress 2.x or lower. We don't encourage it nor expect you to do so, so save yourself some time and energy.

 

See https://issues.civicrm.org/jira/browse/CRM-16421  and https://issues.civicrm.org/jira/browse/CRM-16408

As of 4.7 the Installer for WordPress has been improved based on the above comments.   Hardcoded references to 'wp-content' are gone for new installs.   The next step  is to  remove all hardcoded references to 'wp-admin' 'wp-login-php' etc. We can still have issues if WordPress is installed in a subdirectory (htdocs/wordpress where the vhost points to htdocs/ but the url removes the subdirectory). This means switching to WordPress functions to determine the site url via get_site_url(), the admin url via get_admin_url() and the login url by wp_login_url().  

 

Notes

  • When the CiviCRM core files move, we need to update paths for CiviCRM JS/CSS etc.
    • Drupal: path can be obtained from library_get_path('civicrm') . '/js/';
    • WordPress: URL to resources should be predictable? (since no multisite?) – Must test with current MS (uploads dir) and prior versions (blogs.dir)
    • WordPress: Define path to wp-load.php to standardize method of loading when needed
    • WordPress:  Validate php version on plugin activation.  die if less than 5.3.x (x to be determined) IRC 7/13/15
    • wp-cli:  review civicrm,php add on and remove any hardcoded files.
    • Joomla: URL to resources should be predictable?
    • WordPress:  List of WP hooks used by CiviCRM and list of hooks created by CiviCRM for WP  - https://gist.github.com/kcristiano/b5506e185eaa4f64631b
    • Drupal: CiviCRM hooks in Drupal - https://gist.github.com/xurizaemon/68adc38790c90ab86f9b
Étiquette
  • Aucun

Creative Commons License
Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-Share Alike 3.0 United States Licence.