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 void MarkUpdateFailed ()
 
static uint32 GetFailedUpdateCount ()
 

Static Private Member Functions

static std::string & corrected_path ()
 
static uint32failed_updates ()
 

Detailed Description

Member Function Documentation

◆ CheckExecutable()

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

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

◆ corrected_path()

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

Referenced by CheckExecutable(), and GetCorrectedMySQLExecutable().

◆ failed_updates()

uint32 & DBUpdaterUtil::failed_updates ( )
staticprivate
69{
70 static uint32 count = 0;
71 return count;
72}
std::uint32_t uint32
Definition Define.h:107

Referenced by GetFailedUpdateCount(), and MarkUpdateFailed().

◆ GetCorrectedMySQLExecutable()

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

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

Referenced by CheckExecutable().

◆ GetFailedUpdateCount()

uint32 DBUpdaterUtil::GetFailedUpdateCount ( )
static
80{
81 return failed_updates();
82}
static uint32 & failed_updates()
Definition DBUpdater.cpp:68

References failed_updates().

Referenced by main(), and World::SetInitialWorldSettings().

◆ MarkUpdateFailed()

void DBUpdaterUtil::MarkUpdateFailed ( )
static
75{
77}

References failed_updates().


The documentation for this class was generated from the following files: