Prevent upgrade over-writing your customizations

From PhpCOIN Documentation

Jump to: navigation, search

Contents

The Issue

Every time phpCOIN issues an update or a fix-file, it will over-write your customized strings, configuration settings, and user-supplied custom functions. There is an easy solution to this, however ~ override files.


Language Customizations

Most people do not change all the strings in phpCOIN. Usually they change less than a half dozen strings in only one or two files. An obvious example is the
$_CCFG['SITE_FOOTER_EMAIL_WEBMASTER']
in lang_config.php

To use a language override file, create a php file with the same name as the original, with _override appended to the name.

  • For phpCOIN v1.3.0 to v1.4.2 save it in the same location as the original language file.
  • For phpCOIN v1.4.3 and higher, save it in the /coin_overrides/lang_xxxxx folder, where xxxxx is the name of the language such as english, french, etc.

This new file should contain only those strings that you normally change. For example, the override file for lang_config.php would be lang_config_override.php and it's contents would be

<?php
$_CCFG['SITE_FOOTER_EMAIL_WEBMASTER'] = 'Email 
 <a href="mailto:webmaster@MYDOMAIN.com">webmaster@MYDOMAIN.com</a> with questions or 
 comments about this site';
?>

If you do not normally change any other strings within lang_config.php, then the override file would have only the single string.

Repeat as necessary for any other language files and strings. From now on, when phpCOIN runs it will load it's usual files and strings, then load your override files to override specific strings. This also means that future upgrades of phpCOIN would not hurt your customizations ~ customize with an over-ride file once, and forget about it forever.


Settings Customizations

As of v1.2.6, this same principle applies to the config.php file. Create a file called config_override.php and in it put only those items that you normally change, such as your database info (and your authenticated SMTP settings if you do not use the defaults).

  • For phpCOIN v1.2.6 to v1.4.2, place the file in the root folder of the phpCOIN website.
  • For phpCOIN v1.4.3 and higher, place the file in the /coin_overrides folder.

From now on, everytime you upgrade phpCOIN you will not have to re-edit the config.php file.

<?php
# Database Configuration Array
	$_DBCFG['dbms'] 		= "mysql";	// Database System (type)
	$_DBCFG['dbhost'] 		= "localhost";	// Database Host
	$_DBCFG['dbuname'] 		= "username";	// User
	$_DBCFG['dbpass'] 		= "password";	// Password
	$_DBCFG['dbname'] 		= "database";	// Database Name
	$_DBCFG['table_prefix'] 	= "phpcoin_";	// Database table prefix
?>


Functions Customizations

As of v1.2.6, this same principle applies to the /coin_includes/custom.php file. Create a file called custom_override.php and in it put those functions that you created yourself.

  • For phpCOIN v1.2.6 to v1.4.2, place the file in the /coin_includes folder of the phpCOIN website.
  • For phpCOIN v1.4.3 and higher, place the file in the /coin_overrides folder.

From now on, every time you upgrade phpCOIN you will not have to re-enter your custom functions.


Cron_Config Customization

As of v1.4.1, this same principle applies to the /coin_cron/cron_config.php file. Create a file called cron_config_override.php and in it put only the value for your $_COINURL setting.

  • For phpCOIN v1.4.1 to v1.4.2, place the file in the /coin_cron folder of the phpCOIN website.
  • For phpCOIN v1.4.3 and higher, place the file in the /coin_overrides folder.

From now on, upgrades to phpCOIN will not require you to re-edit the cron_config.php file

RackSpace Hosting

Personal tools