Raised This Month: $ Target: $400
 0% 

Base Settings for MySQL


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
tla-nick
Junior Member
Join Date: Mar 2004
Location: Bradford UK
Old 05-27-2004 , 07:26   Base Settings for MySQL
Reply With Quote #1

I've been writing a couple of plugins which make use of the MySQL facilitys available and I was wondering what the opinion is on exec'ing mysql.cfg. ATM all the sql plugins I am using register (or attempt to register) the db cvars and exec the config file, which means that (at tme moment) mysql.cfg is being exec'd three times on each map load.

I was wondering if perhaps it might be better to put all of this in a hypothetical mysql_base plugin consisting of something like this:
Code:
//MySQL base plugin, required for use with all MySQL plugins #include <amxmodx> #include <amxmisc> public plugin_init() {     register_plugin("Base Plugin for MySQL","X.X","default")     register_cvar("amx_mysql_host","127.0.0.1")     register_cvar("amx_mysql_user","root")     register_cvar("amx_mysql_pass","")     register_cvar("amx_mysql_db","amx")     new configsDir[128]     get_configsdir(configsDir, 127)     server_cmd("exec %s/mysql.cfg", configsDir) }
So that people writing plugins for MySql don't need to worry about registering the cvars and exec'ing the config file etc.
__________________
Where did you want to be, the day before yesterday?

- Another Disgruntled Microsoft User
tla-nick is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:15.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode