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

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
61{
62 static std::string path;
63 return path;
64}

Referenced by CheckExecutable(), and GetCorrectedMySQLExecutable().

◆ GetCorrectedMySQLExecutable()

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

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

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