CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> Tips & Solutions

 Custom Config.php File [PHP]

Print topic Send  topic

Author Message
feha


Posts: 712
Posted: 02/12/2006, 12:55 AM

First open Common.php

add this line in "whitespace"

    
//Include Files @0-6CA7C540    
include(RelativePath . "/Classes.php");    
include(RelativePath . "/db_mysql.php");    
//End Include Files    
if (file_exists(RelativePath . "/Config.php")) {    
    include(RelativePath . "/Config.php");    
}    
//Connection Settings @0-D7BA4D44    

The Config file must have:

   
//====================================================================    
//DB CONNECTION    
    
    global   $_DB_HOST, $_DB_PORT, $_DB_NAME, $_DB_USER, $_DB_PASSWORD ;    
    $_DB_HOST = "";    $_DB_PORT = "";    $_DB_NAME = "";    $_DB_USER = "";    $_DB_PASSWORD = "";    
    
    $_DB_HOST = "localhost";    
    $_DB_PORT = "";    
    $_DB_NAME = "1_cms";    
    $_DB_USER = "root";    
    $_DB_PASSWORD = "";    
//====================================================================    

Project Settings -> Connections -> (select your connection) ...
Modify -> Server ->

Instead of real names insert variables as:
$_DB_NAME, ... $_DB_HOST even for password $_DB_PASSWORD ...

After you regenerate files the Common.php will be changed by CCS (3.0)
as follows:

   
//Connection Settings @0-D7BA4D44    
$CCConnectionSettings = array (    
    "cms" => array(    
        "Type" => "MySQL",    
        "Database" => "$_DB_NAME",    
        "Host" => "$_DB_HOST",    
        "Port" => "$_DB_PORT",    
        "User" => "$_DB_USER",    
        "Password" => "$_DB_PASSWORD",    
        "Encoding" => array("", "utf8"),    
        "Persistent" => true,    
        "DateFormat" => array("yyyy", "-", "mm", "-", "dd", " ", "HH", ":", "nn", ":", "ss"),    
        "BooleanFormat" => array(1, 0, ""),    
        "Uppercase" => false    
    )    
);    
//End Connection Settings    
So the code will be still compatible with Codecharge and will not be overwritten.

enjoy :-)

_________________
Regards
feha

www.vision.to
feedpixel.com
View profile  Send private message
navcan

Posts: 61
Posted: 02/12/2006, 2:18 PM

Beautiful solution. Simple and easy.

Feha, can you make a similar configuration file for ASP solutions?

Thanks,
navcan
View profile  Send private message
feha


Posts: 712
Posted: 02/17/2006, 6:53 AM

I'm sorry i don't program in ASP.
_________________
Regards
feha

www.vision.to
feedpixel.com
View profile  Send private message
feha


Posts: 712
Posted: 03/28/2006, 12:38 PM

Update problem ...
Note this solution will not work on latest update CCS 3.0.3.1

it inserts "Database" => "\$_DB_NAME",
instead of "Database" => "$_DB_NAME",
on all variables ... using constants is impossible ...
:-(

_________________
Regards
feha

www.vision.to
feedpixel.com
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.