[Vtigercrm-developers] [Vtigercrm-commits] [vtiger-commits] r4057 - in /vtigercrm/branches/4.2: config.template.php install/2setConfig.php

Mike Fedyk mfedyk at mikefedyk.com
Mon Mar 6 13:16:27 PST 2006


First of all, did you even look at the diff before committing?!

>Author: saraj
>Date: Mon Mar  6 06:20:40 2006
>New Revision: 4057
>
>Log:
>changes made to support multiple packaging
>
>Modified:
>    vtigercrm/branches/4.2/config.template.php
>    vtigercrm/branches/4.2/install/2setConfig.php
>
>  
>
Checking differences without reporting white space:
diff -uw config.template.php.r4056 config.template.php.r4057

>Modified: vtigercrm/branches/4.2/config.template.php
>--- config.template.php.r4056	2006-03-06 12:01:28.000000000 -0800
>+++ config.template.php.r4057	2006-03-06 12:01:40.000000000 -0800
>@@ -1,17 +1,17 @@
> <?php
> /*********************************************************************************
>- * The contents of this file are subject to the SugarCRM Public License Version 1.1.2
>- * ("License"); You may not use this file except in compliance with the 
>- * License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
>- * Software distributed under the License is distributed on an  "AS IS"  basis,
>- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
>- * the specific language governing rights and limitations under the License.
>- * The Original Code is:  SugarCRM Open Source
>- * The Initial Developer of the Original Code is SugarCRM, Inc.
>- * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.;
>- * All Rights Reserved.
>- * Contributor(s): ______________________________________.
>-********************************************************************************/
>+3  * The contents of this file are subject to the SugarCRM Public License Version 1.1.2 
>+4  * ("License"); You may not use this file except in compliance with the  
>+5  * License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL 
>+6  * Software distributed under the License is distributed on an  "AS IS"  basis, 
>+7  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for 
>+8  * the specific language governing rights and limitations under the License. 
>+9  * The Original Code is:  SugarCRM Open Source 
>+10  * The Initial Developer of the Original Code is SugarCRM, Inc. 
>+11  * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.; 
>+12  * All Rights Reserved. 
>+13  * Contributor(s): ______________________________________. 
>+14 ********************************************************************************/ 
> 
> include('vtigerversion.php');
> 
>@@ -33,20 +33,30 @@
> $HELPDESK_SUPPORT_NAME = 'your-domain name';
> 
> /* database configuration
>-      db_server
>-      db_port
>-      db_hostname
>-      db_username
>-      db_password
>-      db_name
>-*/
>+36       db_server 
>+37       db_port 
>+38       db_hostname 
>+39       db_username 
>+40       db_password 
>+41       db_name 
>+42 */ 
>+   $mysql_dir = 'MYSQLINSTALLDIR'; 
>  
>

Oh goody! We have number prefixes now!

> 
>+ $mysql_bundled = 'MYSQLBUNDLEDSTATUS';
>
NO

This is not used in the code and if the installer needs it, then have 
the installer make a file that keeps track of this info (or use the 
registry).

> $dbconfig['db_server'] = '_DBC_SERVER_';
>-$dbconfig['db_port'] = ':_DBC_PORT_';
>-$dbconfig['db_username'] = '_DBC_USER_';
>-$dbconfig['db_password'] = '_DBC_PASS_';
> $dbconfig['db_name'] = '_DBC_NAME_';
> $dbconfig['db_type'] = '_DBC_TYPE_';
>+$apache_dir = 'APACHEINSTALLDIR';
>+$apache_bin = 'APACHEBIN';
>+$apache_conf = 'APACHECONF';
>+$apache_port = 'APACHEPORT';
>+ $apache_bundled = 'APACHEBUNDLED';
>

Same here. Don't keep variables used for the installer in the vtiger source.

>+   $dbconfig['db_username'] = '_DBC_USER_';
>+   $dbconfig['db_password'] = '_DBC_PASS_';
>+   $dbconfig['db_port'] = ':_DBC_PORT_';
>+  $mysql_username = '_DBC_USER_';
>+  $mysql_password = '_DBC_PASS_';
>+  $mysql_port = '_DBC_PORT_';
>

You are now duplicating variables!

> 
> // TODO: test if port is empty
> // TODO: set db_hostname dependending on db_type
>@@ -78,24 +88,24 @@
> $site_URL = '_SITE_URL_';
> 
> // root directory path
>-$root_directory = '_VT_ROOTDIR_';
>+ $root_directory = 'C:\Program Files\vtigerCRM4.2.4\apache\htdocs\vtigerCRM/'; 
>  
>

Bad. This change should be in config.inc.php and should be done at 
install time, not installer creation time.

> 
> // cache direcory path
>-$cache_dir = '_VT_CACHEDIR_';
>+ $cache_dir = 'cache/'; 
>  
>

Bad. This change should be in config.inc.php and should be done at 
install time, not installer creation time.

> 
> // tmp_dir default value prepended by cache_dir = images/
>-$tmp_dir = '_VT_TMPDIR_';
>+ $tmp_dir = 'cache/images/'; 
>  
>

Bad. This change should be in config.inc.php and should be done at 
install time, not installer creation time.

> 
> // import_dir default value prepended by cache_dir = import/
>-$import_dir = '_VT_IMPORTDIR_';
>+ $import_dir = 'cache/import/'; 
>  
>

Bad. This change should be in config.inc.php and should be done at 
install time, not installer creation time.

> 
> // upload_dir default value prepended by cache_dir = upload/
>-$upload_dir = '_VT_UPLOADDIR_';
>+ $upload_dir = 'cache/upload/'; 
>  
>

Bad. This change should be in config.inc.php and should be done at 
install time, not installer creation time.

> 
> // mail server parameters
>-$mail_server = '_MAIL_SERVER_';
>-$mail_server_username = '_MAIL_USERNAME_';
>-$mail_server_password = '_MAIL_PASSWORD_';
>+ $mail_server = ''; 
>+ $mail_server_username = ''; 
>+ $mail_server_password = ''; 
>  
>

Bad. This change should be in config.inc.php and should be done at 
install time, not installer creation time.

>Modified: vtigercrm/branches/4.2/install/2setConfig.php
>==============================================================================
>--- vtigercrm/branches/4.2/install/2setConfig.php (original)
>+++ vtigercrm/branches/4.2/install/2setConfig.php Mon Mar  6 06:20:40 2006
>@@ -35,7 +35,7 @@
> $cache_dir = "cache/";
> 
> if (is_file("config.php") && is_file("config.inc.php")) {
>-  require_once("config.php");
>+  require_once("config.template.php");
>  
>

Bad. config.template.php is not meant to be called from the code. It is 
only used by the installer.

>   session_start();
> 
>   if(isset($upload_maxsize))
>@@ -100,10 +100,10 @@
> 
>   if (isset($_REQUEST['db_name']))
>     $db_name = $_REQUEST['db_name'];
>-  elseif (isset($dbconfig['db_name']))
>+  elseif (isset($dbconfig['db_name']) && $dbconfig['db_name']!='_DBC_NAME_')
>  
>

Bad. The keywords are supposed to be replaced by the installer by search 
and replace.

>     $db_name = $dbconfig['db_name'];
>   else
>-    $db_name = 'vtigercrm';
>+    $db_name = 'vtigercrm4_2_4';
>  
>

Bad. I see no reason to have the version in the database name.

> 
>   !isset($_REQUEST['db_drop_tables']) ? $db_drop_tables = "0" : $db_drop_tables = $_REQUEST['db_drop_tables'];
> 
>@@ -143,7 +143,7 @@
>   !isset($_REQUEST['db_username']) ? $db_username = $mysql_username : $db_username = $_REQUEST['db_username'];
>   !isset($_REQUEST['db_password']) ? $db_password= $mysql_password : $db_password = $_REQUEST['db_password'];
>   */
>-  !isset($_REQUEST['db_name']) ? $db_name = "vtigercrm" : $db_name = $_REQUEST['db_name'];
>+  !isset($_REQUEST['db_name']) ? $db_name = "vtigercrm4_2_4" : $db_name = $_REQUEST['db_name'];
>  
>

Bad. I see no reason to have the version in the database name.




More information about the vtigercrm-developers mailing list