AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
DBUpdaterUtil Class Reference

#include "DBUpdater.h"

Static Public Member Functions

static std::string GetCorrectedMySQLExecutable ()
 
static bool CheckExecutable ()
 

Static Private Member Functions

static std::string & corrected_path ()
 

Detailed Description

Member Function Documentation

◆ CheckExecutable()

bool DBUpdaterUtil::CheckExecutable ( )
static
41{
42 std::filesystem::path exe(GetCorrectedMySQLExecutable());
43 if (!is_regular_file(exe))
44 {
45 exe = Acore::SearchExecutableInPath("mysql");
46 if (!exe.empty() && is_regular_file(exe))
47 {
48 // Correct the path to the cli
49 corrected_path() = absolute(exe).generic_string();
50 return true;
51 }
52
53 LOG_FATAL("sql.updates", "Didn't find any executable MySQL binary at \'{}\' or in path, correct the path in the *.conf (\"MySQLExecutable\").",
54 absolute(exe).generic_string());
55
56 return false;
57 }
58 return true;
59}
#define LOG_FATAL(filterType__,...)
Definition: Log.h:153
std::string SearchExecutableInPath(std::string const &filename)
Definition: StartProcess.cpp:271
static std::string & corrected_path()
Definition: DBUpdater.cpp:61
static std::string GetCorrectedMySQLExecutable()
Definition: DBUpdater.cpp:32

References corrected_path(), GetCorrectedMySQLExecutable(), LOG_FATAL, and Acore::SearchExecutableInPath().

Referenced by DBUpdater< T >::Populate(), and DBUpdater< T >::Update().

◆ corrected_path()

std::string & DBUpdaterUtil::corrected_path ( )
staticprivate
62{
63 static std::string path;
64 return path;
65}

Referenced by CheckExecutable(), and GetCorrectedMySQLExecutable().

◆ GetCorrectedMySQLExecutable()

std::string DBUpdaterUtil::GetCorrectedMySQLExecutable ( )
static
33{
34 if (!corrected_path().empty())
35 return corrected_path();
36 else
38}
AC_COMMON_API std::string GetMySQLExecutable()
Definition: BuiltInConfig.cpp:48

References corrected_path(), and BuiltInConfig::GetMySQLExecutable().

Referenced by DBUpdater< T >::ApplyFile(), and CheckExecutable().