Gossamer Forum
Quote Reply
Grab SQL type?
I'm sure this has been discussed before...but I can't find any threads related to it. Basically, I need to grab the type of SQL server being used to run Links on. I need to report back to the user that a MySQLDump will obviously not be available to a server that runs on PostGres or Ms-SQL (etc). Anyone know how to do this?

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Grab SQL type? In reply to
You could:

Code:
$Config = GT::Config->load($CFG->{'fileman_root_dir'}."/defs/database.def");
$databasetype = $Config->{'driver'}


Or something likes that.

GM
=================
www.iuni.com - Custom Coding and Plugins
YouPlusMe.com - For a good time
Quote Reply
Re: [gsm] Grab SQL type? In reply to
Its a case of "do or die" Wink

Code:
my $driver = do("$CFG->{admin_root_path}/defs/database.def")->{driver} or die $!;
Quote Reply
Re: [Paul] Grab SQL type? In reply to
yes...very compact.
=================
www.iuni.com - Custom Coding and Plugins
YouPlusMe.com - For a good time
Quote Reply
Re: [gsm] Grab SQL type? In reply to
I have a feeling it's not a sensible idea to use it as if do() fails then the hashref won't be returned and hence ->{driver} will probably cause the script to die. But I guess it would have died anyway once it hit die $!

Last edited by:

Paul: Jan 14, 2003, 11:29 AM
Quote Reply
Re: [gsm] Grab SQL type? In reply to
Thanks guys Wink

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!