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
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:141
static std::string & corrected_path()
Definition DBUpdater.cpp:61
static std::string GetCorrectedMySQLExecutable()
Definition DBUpdater.cpp:32
std::string SearchExecutableInPath(std::string const &filename)
Definition StartProcess.cpp:280

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

Referenced by DBUpdater< T >::Populate(), DBUpdater< T >::Update(), 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().

◆ failed_updates()

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

Referenced by GetFailedUpdateCount(), and MarkUpdateFailed().

◆ 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().

◆ GetFailedUpdateCount()

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

References failed_updates().

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

◆ MarkUpdateFailed()

void DBUpdaterUtil::MarkUpdateFailed ( )
static
74{
76}

References failed_updates().

Referenced by DBUpdater< T >::ApplyFile().


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