diff options
author | Urban Müller | 2016-06-21 16:11:20 +0200 |
---|---|---|
committer | Urban Müller | 2016-06-21 16:11:20 +0200 |
commit | d9912050e844cce1fd44575ff2857f140e7d6591 (patch) | |
tree | b1bd54a96a91365b9e455e18a4af4dad833ad30a /it_dbi.class | |
parent | 01f739592ce97aa71ff7807af55d45055220ab2b (diff) | |
download | itools-d9912050e844cce1fd44575ff2857f140e7d6591.tar.gz itools-d9912050e844cce1fd44575ff2857f140e7d6591.tar.bz2 itools-d9912050e844cce1fd44575ff2857f140e7d6591.zip |
only warn if local db is replicated
Diffstat (limited to 'it_dbi.class')
-rw-r--r-- | it_dbi.class | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/it_dbi.class b/it_dbi.class index d7d0d79..4f1e599 100644 --- a/it_dbi.class +++ b/it_dbi.class @@ -462,8 +462,9 @@ function query($query, $p = array()) $this->_p['server'] = $p['server'] = $p['server_update']; unset($this->_p['server_update'], $p['server_update'], $this->_link); } - else if ($p['server'] == "localhost" && $p['db'] == $GLOBALS['ULTRADB'] && ($t = @file($GLOBALS['ULTRAHOME'] . "/doc/machines.txt")) && preg_grep("/^" . gethostname() . "/", array_slice($t, 2))) - it::error("local write access on a replication slave machine?"); + else if ($p['server'] == "localhost" && $p['db'] == $GLOBALS['ULTRADB'] && preg_grep('/replicat/', (array)@file($GLOBALS['ULTRAHOME'] . "/etc/my.cnf"))) + if (($t = @file($GLOBALS['ULTRAHOME'] . "/doc/machines.txt")) && preg_grep("/^" . gethostname() . "/", array_slice($t, 2))) + it::error("local mysql write on a replication slave machine?"); } $this->_connect($p); # must be called after update server switching code |