function get_access_realms() { $levels = $this->get_access_levels(); $realms = array(); foreach ($levels as $level) { if ($level->gmlevel >= Environment::get_value('min_gm_level', 'access')) { if ($level->realmid == -1) { $realms = Realm::find()->available()->all(); break; } else { $realms = Realms::find()->where(array('realmid' => $level->realmid))->first(); } } } return $realms; }
public function get_dumpfile_path($realmid, $guid, $backup=false){ try { $dumpdir = Environment::get_value('dump_dir'); if(substr($dumpdir, strlen($dumpdir), 1) != '/') $dumpdir .= '/'; } catch(Exception $e) { $this->errors[] = $e->getMessage(); return false; } $filenameparts = array( $realmid, $guid, 'tcdump.sql' ); $path = $dumpdir; if($backup) $path .= 'backup/' . time() . '_'; $this->last_dumpfile_name = join('_', $filenameparts); return $path . $this->last_dumpfile_name; }
function setUp() { $config = Environment::get_value('soap'); $config['host'] = '127.0.0.1'; $this->client = new TrinitySoapClient($config); $this->client->connect(); }