CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • civicrm.settings.php.sample versus civicrm.settings.php.sample.tpl
Pages: [1]

Author Topic: civicrm.settings.php.sample versus civicrm.settings.php.sample.tpl  (Read 4081 times)

mcsmom

  • I post frequently
  • ***
  • Posts: 266
  • Karma: 23
    • Official Joomla! Book
  • CiviCRM version: 4 and 3.4
  • CMS version: Joomla!
civicrm.settings.php.sample versus civicrm.settings.php.sample.tpl
March 16, 2008, 04:33:37 pm
In the joomla! configure.php file civicrm.settings.php.sample.tpl is included  rather than civicrm.settings.php.sample. I'm not sure hat civicrm.settings.php.sample is ever referenced.

I think this is probably a mistake--civicrm.settings.php.sample is probably meant to provide the settings for Joomla!.

I'm trying to 1.5-ify 2.0 a little more and as part of that I need to change the settings and obviously civicrm.settings.php.sample is the better place to do that.


Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: civicrm.settings.php.sample versus civicrm.settings.php.sample.tpl
March 16, 2008, 11:55:33 pm
If i am not wrong, civicrm.settings.php.sample is generated from civicrm.settings.php.sample.tpl, which can be used for manual installation of CiviCRM in Drupal. So just a reference file, which user can copy to sites/default.

In case of Joomla, civicrm.settings.php is directly generated from civicrm.settings.php.sample.tpl file.

HTH

kurund
Found this reply helpful? Support CiviCRM

mcsmom

  • I post frequently
  • ***
  • Posts: 266
  • Karma: 23
    • Official Joomla! Book
  • CiviCRM version: 4 and 3.4
  • CMS version: Joomla!
Re: civicrm.settings.php.sample versus civicrm.settings.php.sample.tpl
March 17, 2008, 12:57:21 am
Well, yes and no, I believe.  When you download the joomla package civicrm.settings.php.sample already exists. It actually exists in two places, in the /civicrm/joomla folder and also in the /civicrm folder. It is identical to the file civicrm.settings.php.sample.tpl which is in /civicrm/templates/CRM/common folder.


I certainly agree that the various copies of civicrm.settings.php.sample seem to come from civicrm.settings.php.sample.tpl. The question I am asking is, I suppose, why make these copies when you are going to refer to civicrm.settings.php.sample.tpl anyway?
The answer I believe is that sometimes the settings need to be modified and it makes more sense to have that in /civicrm and it doesn't make sense to use the template rather than the actual file for that.

configure.php seems to run just fine referring to civicrm/civicrm.settings.php.sample instead of civicrm.settings.php.sample.tpl.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: civicrm.settings.php.sample versus civicrm.settings.php.sample.tpl
March 17, 2008, 03:51:01 pm

The sample files are now becoming a relic of the past since we now autogenerate them for both drupal and joomla via the component installers.

If someone files an issue, i'll get rid of the sample files in 2.1 :). I dont think they are needed any more

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

mcsmom

  • I post frequently
  • ***
  • Posts: 266
  • Karma: 23
    • Official Joomla! Book
  • CiviCRM version: 4 and 3.4
  • CMS version: Joomla!
Re: civicrm.settings.php.sample versus civicrm.settings.php.sample.tpl
March 17, 2008, 04:51:48 pm
That they are a relic is certainly true.   But the question I have still is, in 2.0 configure.php calls the sample.tpl file, is there any reason it can't call the sample file instead? I'll be honest, this is totally motivated by trying to make a 1.5 installer in the shallowest way possible, which means I don't want to touch anything below civicrm\.

You know me, always willing to file an issue. :)

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: civicrm.settings.php.sample versus civicrm.settings.php.sample.tpl
March 17, 2008, 09:29:59 pm

the sample.tpl file is the "original" template file and it differs from the sample file.

I think in 2.1 we should get rid of the .sample files, since most people no longer need to create one of those files from scracth, and we generate a custom specific one from sample.tpl

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

mcsmom

  • I post frequently
  • ***
  • Posts: 266
  • Karma: 23
    • Official Joomla! Book
  • CiviCRM version: 4 and 3.4
  • CMS version: Joomla!
Re: civicrm.settings.php.sample versus civicrm.settings.php.sample.tpl
March 19, 2008, 11:19:52 am
In 1.5 would it really be necessary to generate civicrm.settings.php?

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: civicrm.settings.php.sample versus civicrm.settings.php.sample.tpl
March 19, 2008, 03:42:03 pm

yeah, since the settings file holds all the core settings we need to run. any reason we can get by without it in 1.5?

in related news, we've got a few ideas on how to improve the install/upgrade process for joomla 1.5. hopefully this will work quite nicely for 2.1. we'll try to get it coded by end of week :)

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

mcsmom

  • I post frequently
  • ***
  • Posts: 266
  • Karma: 23
    • Official Joomla! Book
  • CiviCRM version: 4 and 3.4
  • CMS version: Joomla!
Re: civicrm.settings.php.sample versus civicrm.settings.php.sample.tpl
March 19, 2008, 07:58:09 pm
:)

I heard great things.

Well in playing around with it, I made this to produce the settings.

<?php
/**
 * CiviCRM Configuration File - v2.0
 */

/**
 * Content Management System (CMS) Host:
 *
 * CiviCRM can be hosted in either Drupal or Joomla.
 *
 *
 * Settings for Joomla 1.0.x and 1.5.x:
 *      define( 'CIVICRM_UF'        , 'Joomla' );
 *      define( 'CIVICRM_UF_VERSION', '1' );
 *
 
 * You may have issues with images in CiviCRM. If this is the case, be sure
 * to update the CiviCRM Resource URL field (in Administer CRM: Global
 * Settings: Resource URLS) to your CiviCRM root directory.
 */

define( 'CIVICRM_UF'               , 'Joomla'        );
 define( 'CIVICRM_UF_VERSION', '1.5' );
/**
 * Content Management System (CMS) Datasource:
 *
 * Update this setting with your  Joomla database username, server and DB name. Comment it out if using CiviCRM standalone.
 * Datasource (DSN) format:
 *      define( 'CIVICRM_UF_DSN', 'mysql://cms_db_username:cms_db_password@db_server/cms_database?new_link=true');
 */



      $config =&JFactory::getConfig();
   define( 'UF_DSN', 'mysql://' .
   $config->getValue('config.user') . ':' .
   $config->getValue('config.password'). '@' .
   $config->getValue('config.host'). '/' .
   $config->getValue('config.db') .
      '?new_link=true' );


define( 'CIVICRM_UF_DSN', 'UF_DSN');


/**
 * CiviCRM Database Settings
 *
 * Database URL (CIVICRM_DSN) for CiviCRM Data:
 * Database URL format:
 *      define( 'CIVICRM_DSN', 'mysql://crm_db_username:crm_db_password@db_server/crm_database?new_link=true');
 *
 * Joomla and CiviCRM can share the same database, or can be installed into separate databases.
 *
 * EXAMPLE: Joomla and CiviCRM running in the same database...
 *      DB Name = drupal, DB User = drupal
 *      define( 'CIVICRM_DSN'         , 'mysql://joomla:YOUR_PASSWORD@localhost/joomla?new_link=true' );
 *
 * EXAMPLE: Joomla and CiviCRM running in separate databases...
 *      Joomla  DB Name = drupal, DB User = joomla
 *      CiviCRM DB Name = civicrm, CiviCRM DB User = civicrm
 *      define( 'CIVICRM_DSN'         , 'mysql://civicrm:YOUR_PASSWORD@localhost/civicrm?new_link=true' );
 *
 * MySQL Path:
 * This stores the installed path of mysql. You will need to verify and modify this value if you are
 * planning on using CiviCRMs built-in Database Backup utility. If you have shell access, you may be
 * able to query the path by using one of the following commands:
 * $ whereis mysql
 * $ type mysql
 *
 */
 

      $configj =&JFactory::getConfig();
   define( 'DSN', 'mysql://' .
   $configj->getValue('configj.user') . ':' .
   $configj->getValue('configj.password'). '@' .
   $configj->getValue('configj.host'). '/' .
   $configj->getValue('configj.db') .
      '?new_link=true' );


define( 'CIVICRM_DSN', 'DSN');




define( 'CIVICRM_MYSQL_PATH', '%%mysqlPath%%' );

/**
 * File System Paths:
 *
 * $civicrm_root is the file system path on your server where the civicrm
 * code is installed. Use an ABSOLUTE path (not a RELATIVE path) for this setting.
 *
 * CIVICRM_TEMPLATE_COMPILEDIR is the file system path where compiled templates are stored.
 * These sub-directories and files are temporary caches and will be recreated automatically
 * if deleted.
 *
 * IMPORTANT: The COMPILEDIR directory must exist,
 * and your web server must have read/write access to these directories.
 *
 *
 *
 * EXAMPLE - Joomla Installations:
 * If the path to the Joomla home directory is /var/www/htdocs/joomla
 * the $civicrm_root setting would be:
 *      $civicrm_root = '/var/www/htdocs/joomla/administrator/components/com_civicrm/civicrm/';
 *
 * the CIVICRM_TEMPLATE_COMPILEDIR would be:
 *      define( 'CIVICRM_TEMPLATE_COMPILEDIR', '/var/www/htdocs/joomla/media/civicrm/templates_c/' );
 *
 */

global $civicrm_root;

$civicrm_root = 'crmPath';
define( 'CIVICRM_TEMPLATE_COMPILEDIR', 'compileDir' );

/**
 * Site URLs:
 *
 * This section defines absolute and relative URLs to access the host CMS (Drupal or Joomla) resources.
 *
 * IMPORTANT: Trailing slashes should be used on all URL settings.
 *
 * EXAMPLE - Joomla Installations:
 * If your site's home url is http://www.example.com/joomla/
 *
 * CIVICRM_UF_BASEURL - home URL for your site:
 * Administration site:
 *      define( 'CIVICRM_UF_BASEURL' , 'http://www.example.com/joomla/administrator/' );
 * Front-end site:
 *      define( 'CIVICRM_UF_BASEURL' , 'http://www.example.com/joomla/' );
 *
 *
 * CIVICRM_UF_BASEURL - home URL for your site:
 *      define( 'CIVICRM_UF_BASEURL' , 'http://www.example.com/civicrm/standalone/' );
 */
 
define( 'CIVICRM_UF_BASEURL'      , 'JURI::base()' );

/**
 * Multi-site Support
 *
 * CiviCRM uses Domain ID keys to allow you to store separate data sets for multiple sites
 * using the same codebase.
 *
 * Refer to the 'Multi-site Support' section of the Installation Guide for more info.
 */

define('CIVICRM_DOMAIN_ID' , 1 );

/**
 *
 * Do not change anything below this line. Keep as is
 *
 */

$include_path = '.'        . PATH_SEPARATOR .
                $civicrm_root . PATH_SEPARATOR .
                $civicrm_root . DIRECTORY_SEPARATOR . 'packages' . PATH_SEPARATOR .
                get_include_path( );
set_include_path( $include_path );

define( 'CIVICRM_TEST_DIR'   , $civicrm_root . DS . 'test-new'   . DS );

if ( function_exists( 'variable_get' ) && variable_get('clean_url', '0') != '0' ) {
    define( 'CIVICRM_CLEANURL', 1 );
} else {
    define( 'CIVICRM_CLEANURL', 0 );
}

// force PHP to auto-detect Mac line endings
ini_set('auto_detect_line_endings', '1');

// make sure the memory_limit is at least 32 MiB
$memLimitString = trim(ini_get('memory_limit'));
$memLimitUnit   = strtolower(substr($memLimitString, -1));
$memLimit       = (int) $memLimitString;
switch ($memLimitUnit) {
    case 'g': $memLimit *= 1024;
    case 'm': $memLimit *= 1024;
    case 'k': $memLimit *= 1024;
}
if ($memLimit >= 0 and $memLimit < 33554432) {
    ini_set('memory_limit', '32M');
}

?>

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • civicrm.settings.php.sample versus civicrm.settings.php.sample.tpl

This forum was archived on 2017-11-26.