- added new "Jump log" for selected wormhole connections, closed #313 closed #449 closed #382

- added new "select connection" feature to map - ctrl + click for multiselect, closed  #174
- added new "wormhole type" table to "Jump info" dialog, closed  #174
- added new re-order drag&drop feature for pannels, #470 closed #234
- fixed PHP-Doc comments - added @throw statements
- fixed some Javascript memory leaks with infinite counters
- updated "Peity jQuery plugin" `3.2.0` -> `3.2.1`
This commit is contained in:
Mark Friedrich
2017-12-04 15:12:52 +01:00
parent 605beeb248
commit ff15fc0bf9
238 changed files with 60230 additions and 1158 deletions

View File

@@ -19,6 +19,9 @@ class AccessController extends Controller {
* @param \Base $f3
* @param $params
* @return bool
* @throws \Exception
* @throws \Exception\PathfinderException
* @throws \ZMQSocketException
*/
function beforeroute(\Base $f3, $params): bool {
if($return = parent::beforeroute($f3, $params)){
@@ -47,6 +50,8 @@ class AccessController extends Controller {
* get current character and check if it is a valid character
* @param \Base $f3
* @return bool
* @throws \Exception
* @throws \Exception\PathfinderException
*/
protected function isLoggedIn(\Base $f3): bool {
$loginCheck = false;
@@ -66,6 +71,7 @@ class AccessController extends Controller {
* @param \Base $f3
* @param Model\CharacterModel $character
* @return bool
* @throws \Exception\PathfinderException
*/
private function checkLogTimer(\Base $f3, Model\CharacterModel $character){
$loginCheck = false;
@@ -97,6 +103,9 @@ class AccessController extends Controller {
* -> send over TCP Socket
* @param Model\MapModel $map
* @return int (number of active connections for this map)
* @throws \Exception
* @throws \Exception\PathfinderException
* @throws \ZMQSocketException
*/
protected function broadcastMapData(Model\MapModel $map){
$mapData = $this->getFormattedMapData($map);
@@ -107,6 +116,8 @@ class AccessController extends Controller {
* get formatted Map Data
* @param Model\MapModel $map
* @return array
* @throws \Exception
* @throws \Exception\PathfinderException
*/
protected function getFormattedMapData(Model\MapModel $map){
$mapData = $map->getData();

View File

@@ -34,6 +34,8 @@ class Admin extends Controller{
* @param \Base $f3
* @param $params
* @return bool
* @throws \Exception
* @throws \Exception\PathfinderException
*/
function beforeroute(\Base $f3, $params): bool {
$return = parent::beforeroute($f3, $params);
@@ -63,6 +65,7 @@ class Admin extends Controller{
/**
* event handler after routing
* @param \Base $f3
* @throws \Exception\PathfinderException
*/
public function afterroute(\Base $f3) {
// js view (file)
@@ -81,6 +84,7 @@ class Admin extends Controller{
* returns valid admin $characterModel for current user
* @param \Base $f3
* @return CharacterModel|null
* @throws \Exception
*/
protected function getAdminCharacter(\Base $f3){
$adminCharacter = null;
@@ -148,6 +152,7 @@ class Admin extends Controller{
* @param \Base $f3
* @param array $params
* @param null $character
* @throws \Exception\PathfinderException
*/
public function dispatch(\Base $f3, $params, $character = null){
if($character instanceof CharacterModel){
@@ -191,6 +196,7 @@ class Admin extends Controller{
* @param CharacterModel $character
* @param int $kickCharacterId
* @param int $minutes
* @throws \Exception\PathfinderException
*/
protected function kickCharacter(CharacterModel $character, $kickCharacterId, $minutes){
$kickOptions = self::KICK_OPTIONS;
@@ -220,6 +226,7 @@ class Admin extends Controller{
* @param CharacterModel $character
* @param int $banCharacterId
* @param int $value
* @throws \Exception\PathfinderException
*/
protected function banCharacter(CharacterModel $character, $banCharacterId, $value){
$banCharacters = $this->filterValidCharacters($character, $banCharacterId);
@@ -267,6 +274,7 @@ class Admin extends Controller{
* get log file for "admin" logs
* @param string $type
* @return \Log
* @throws \Exception\PathfinderException
*/
static function getLogger($type = 'ADMIN'){
return parent::getLogger('ADMIN');

View File

@@ -17,6 +17,7 @@ class Access extends Controller\AccessController {
* search character/corporation or alliance by name
* @param \Base $f3
* @param $params
* @throws \Exception
*/
public function search($f3, $params){

View File

@@ -17,6 +17,7 @@ class Connection extends Controller\AccessController {
* save a new connection or updates an existing (drag/drop) between two systems
* if a connection is changed (drag&drop) to another system. -> this function is called for update
* @param \Base $f3
* @throws \Exception
*/
public function save(\Base $f3){
$postData = (array)$f3->get('POST');

View File

@@ -21,6 +21,7 @@ class GitHub extends Controller\Controller {
/**
* get HTTP request options for API (curl) request
* @return array
* @throws \Exception\PathfinderException
*/
protected function getRequestOptions(){
$requestOptions = [
@@ -36,6 +37,7 @@ class GitHub extends Controller\Controller {
/**
* get release information from GitHub
* @param $f3
* @throws \Exception\PathfinderException
*/
public function releases($f3){
$cacheKey = 'CACHE_GITHUB_RELEASES';

View File

@@ -71,6 +71,8 @@ class Map extends Controller\AccessController {
/**
* Get all required static config data for program initialization
* @param \Base $f3
* @throws Exception
* @throws Exception\PathfinderException
*/
public function init(\Base $f3){
// expire time in seconds
@@ -159,6 +161,15 @@ class Map extends Controller\AccessController {
}
$return->connectionScopes = $connectionScopeData;
// get available wormhole types ---------------------------------------------------------------------------
$wormholes = Model\BasicModel::getNew('WormholeModel');
$rows = $wormholes->find('id > 0', null, $expireTimeSQL);
$wormholesData = [];
foreach((array)$rows as $rowData){
$wormholesData[$rowData->name] = $rowData->getData();
}
$return->wormholes = $wormholesData;
// get available character status -------------------------------------------------------------------------
$characterStatus = Model\BasicModel::getNew('CharacterStatusModel');
$rows = $characterStatus->find('active = 1', null, $expireTimeSQL);
@@ -223,6 +234,7 @@ class Map extends Controller\AccessController {
/**
* import new map data
* @param \Base $f3
* @throws Exception
*/
public function import(\Base $f3){
$importData = (array)$f3->get('POST');
@@ -367,6 +379,7 @@ class Map extends Controller\AccessController {
/**
* save a new map or update an existing map
* @param \Base $f3
* @throws Exception
*/
public function save(\Base $f3){
$formData = (array)$f3->get('POST.formData');
@@ -563,6 +576,7 @@ class Map extends Controller\AccessController {
/**
* delete a map and all dependencies
* @param \Base $f3
* @throws Exception
*/
public function delete(\Base $f3){
$mapData = (array)$f3->get('POST.mapData');
@@ -597,6 +611,9 @@ class Map extends Controller\AccessController {
* -> if characters with map access found -> broadcast mapData to them
* @param Model\MapModel $map
* @param array $characterIds
* @throws Exception
* @throws Exception\PathfinderException
* @throws \ZMQSocketException
*/
protected function broadcastMapAccess($map, $characterIds){
$mapAccess = [
@@ -614,6 +631,7 @@ class Map extends Controller\AccessController {
* broadcast map delete information to clients
* @param int $mapId
* @return bool|string
* @throws \ZMQSocketException
*/
protected function broadcastMapDeleted($mapId){
return (new Socket( Config::getSocketUri() ))->sendData('mapDeleted', $mapId);
@@ -623,6 +641,7 @@ class Map extends Controller\AccessController {
* get map access tokens for current character
* -> send access tokens via TCP Socket for WebSocket auth
* @param \Base $f3
* @throws Exception
*/
public function getAccessData(\Base $f3){
$return = (object) [];
@@ -656,6 +675,8 @@ class Map extends Controller\AccessController {
* update map data
* -> function is called continuously (trigger) by any active client
* @param \Base $f3
* @throws Exception
* @throws Exception\PathfinderException
*/
public function updateData(\Base $f3){
$mapData = (array)$f3->get('POST.mapData');
@@ -805,6 +826,8 @@ class Map extends Controller\AccessController {
* get formatted map data
* @param Model\MapModel[] $mapModels
* @return array
* @throws Exception
* @throws Exception\PathfinderException
*/
protected function getFormattedMapsData($mapModels){
$mapData = [];
@@ -819,6 +842,8 @@ class Map extends Controller\AccessController {
* update map data api
* -> function is called continuously by any active client
* @param \Base $f3
* @throws Exception
* @throws Exception\PathfinderException
*/
public function updateUserData(\Base $f3){
$return = (object) [];
@@ -896,6 +921,7 @@ class Map extends Controller\AccessController {
* @param Model\CharacterModel $character
* @param Model\MapModel $map
* @return Model\MapModel
* @throws Exception
*/
protected function updateMapData(Model\CharacterModel $character, Model\MapModel $map){
@@ -1056,21 +1082,34 @@ class Map extends Controller\AccessController {
}
}
// save connection ------------------------------------------------------------------------------------
if(
$addConnection &&
$sourceExists &&
$targetExists &&
$sourceSystem &&
$targetSystem &&
!$map->searchConnection( $sourceSystem, $targetSystem )
$targetSystem
){
$connection = $map->getNewConnection($sourceSystem, $targetSystem);
$connection = $map->saveConnection($connection, $character);
// get updated maps object
if($connection){
$map = $connection->mapId;
$mapDataChanged = true;
$connection = $map->searchConnection( $sourceSystem, $targetSystem);
// save connection --------------------------------------------------------------------------------
if(
$addConnection &&
!$connection
){
$connection = $map->getNewConnection($sourceSystem, $targetSystem);
$connection = $map->saveConnection($connection, $character);
// get updated maps object
if($connection){
$map = $connection->mapId;
$mapDataChanged = true;
}
}
// log jump mass ----------------------------------------------------------------------------------
if(
$connection &&
$connection->isWormhole()
){
$connection->logMass($log);
}
}
}
@@ -1087,9 +1126,13 @@ class Map extends Controller\AccessController {
/**
* get connectionData
* @param \Base $f3
* @throws Exception
*/
public function getConnectionData (\Base $f3){
$postData = (array)$f3->get('POST');
$addData = (array)$postData['addData'];
$filterData = (array)$postData['filterData'];
$connectionData = [];
if($mapId = (int)$postData['mapId']){
@@ -1102,13 +1145,27 @@ class Map extends Controller\AccessController {
$map->getById($mapId);
if($map->hasAccess($activeCharacter)){
$connections = $map->getConnections('wh');
foreach($connections as $connection){
$data = $connection->getData(true);
// skip connections whiteout signature data
if($data->signatures){
$connectionData[] = $data;
// get specific connections by id
$connectionIds = null;
if(is_array($postData['connectionIds'])){
$connectionIds = $postData['connectionIds'];
}
$connections = $map->getConnections($connectionIds, 'wh');
foreach($connections as $connection){
$check = true;
$data = $connection->getData(in_array('signatures', $addData), in_array('logs', $addData));
// filter result
if(in_array('signatures', $filterData) && !$data->signatures){
$check = false;
}
if(in_array('logs', $filterData) && !$data->logs){
$check = false;
}
if($check){
$connectionData[] = $data;
}
}
}
@@ -1120,6 +1177,8 @@ class Map extends Controller\AccessController {
/**
* get map log data
* @param \Base $f3
* @throws Exception
* @throws Exception\PathfinderException
*/
public function getLogData(\Base $f3){
$postData = (array)$f3->get('POST');

View File

@@ -509,6 +509,8 @@ class Route extends Controller\AccessController {
/**
* search multiple route between two systems
* @param \Base $f3
* @throws \Exception
* @throws \Exception\PathfinderException
*/
public function search($f3){
$requestData = (array)$f3->get('POST');

View File

@@ -18,6 +18,7 @@ class Signature extends Controller\AccessController {
* get signature data for systems
* -> return value of this is limited to a "SINGLE" system
* @param \Base $f3
* @throws \Exception
*/
public function getAll(\Base $f3){
$signatureData = [];
@@ -50,6 +51,7 @@ class Signature extends Controller\AccessController {
* save or update a full signature data set
* or save/update just single or multiple signature data
* @param \Base $f3
* @throws \Exception
*/
public function save(\Base $f3){
$requestData = $f3->get('POST');
@@ -221,6 +223,7 @@ class Signature extends Controller\AccessController {
/**
* delete signatures
* @param \Base $f3
* @throws \Exception
*/
public function delete(\Base $f3){
$signatureIds = $f3->get('POST.signatureIds');

View File

@@ -123,6 +123,7 @@ class Statistic extends Controller\AccessController {
* @param int $yearEnd
* @param int $weekEnd
* @return array
* @throws \Exception\PathfinderException
*/
protected function queryStatistic( CharacterModel $character, $typeId, $yearStart, $weekStart, $yearEnd, $weekEnd){
$data = [];
@@ -231,6 +232,7 @@ class Statistic extends Controller\AccessController {
/**
* get statistics data
* @param \Base $f3
* @throws \Exception
*/
public function getData(\Base $f3){
$postData = (array)$f3->get('POST');

View File

@@ -175,6 +175,7 @@ class System extends Controller\AccessController {
/**
* save a new system to a a map
* @param \Base $f3
* @throws \Exception
*/
public function save(\Base $f3){
$postData = (array)$f3->get('POST');
@@ -278,6 +279,7 @@ class System extends Controller\AccessController {
* get system log data from CCP API import
* system Kills, Jumps,....
* @param \Base $f3
* @throws \Exception
*/
public function graphData(\Base $f3){
$graphData = [];
@@ -329,6 +331,8 @@ class System extends Controller\AccessController {
* get system data for all systems within a constellation
* @param \Base $f3
* @param array $params
* @throws \Exception
* @throws \Exception\PathfinderException
*/
public function constellationData(\Base $f3, $params){
$return = (object) [];
@@ -363,6 +367,7 @@ class System extends Controller\AccessController {
/**
* set destination for specific systemIds
* @param \Base $f3
* @throws \Exception
*/
public function setDestination(\Base $f3){
$postData = (array)$f3->get('POST');
@@ -405,6 +410,8 @@ class System extends Controller\AccessController {
/**
* send Rally Point poke
* @param \Base $f3
* @throws \Exception
* @throws \Exception\PathfinderException
*/
public function pokeRally(\Base $f3){
$rallyData = (array)$f3->get('POST');
@@ -437,6 +444,7 @@ class System extends Controller\AccessController {
* delete systems and all its connections from map
* -> set "active" flag
* @param \Base $f3
* @throws \Exception
*/
public function delete(\Base $f3){
$mapId = (int)$f3->get('POST.mapId');

View File

@@ -44,6 +44,7 @@ class User extends Controller\Controller{
* @param Model\CharacterModel $characterModel
* @param string $browserTabId
* @return bool
* @throws Exception
*/
protected function loginByCharacter(Model\CharacterModel &$characterModel, string $browserTabId){
$login = false;
@@ -108,6 +109,8 @@ class User extends Controller\Controller{
* validate cookie character information
* -> return character data (if valid)
* @param \Base $f3
* @throws Exception
* @throws Exception\PathfinderException
*/
public function getCookieCharacter(\Base $f3){
$data = $f3->get('POST');
@@ -188,6 +191,7 @@ class User extends Controller\Controller{
/**
* delete the character log entry for the current active (main) character
* @param \Base $f3
* @throws Exception
*/
public function deleteLog(\Base $f3){
if($activeCharacter = $this->getCharacter()){
@@ -198,6 +202,8 @@ class User extends Controller\Controller{
/**
* log the current user out + clear character system log data
* @param \Base $f3
* @throws Exception
* @throws \ZMQSocketException
*/
public function logout(\Base $f3){
$this->logoutCharacter(false, true, true, true);
@@ -211,6 +217,7 @@ class User extends Controller\Controller{
* remote open ingame information window (character, corporation or alliance) Id
* -> the type is auto-recognized by CCP
* @param \Base $f3
* @throws Exception
*/
public function openIngameWindow(\Base $f3){
$data = $f3->get('POST');
@@ -241,6 +248,7 @@ class User extends Controller\Controller{
* -> a fresh user automatically generated on first login with a new character
* -> see SSO login
* @param \Base $f3
* @throws Exception
*/
public function saveAccount(\Base $f3){
$data = $f3->get('POST');
@@ -361,6 +369,8 @@ class User extends Controller\Controller{
/**
* delete current user account from DB
* @param \Base $f3
* @throws Exception
* @throws \ZMQSocketException
*/
public function deleteAccount(\Base $f3){
$data = $f3->get('POST.formData');

View File

@@ -52,6 +52,7 @@ class Sso extends Api\User{
* redirect user to CCP SSO page and request authorization
* -> cf. Controller->getCookieCharacters() ( equivalent cookie based login)
* @param \Base $f3
* @throws \Exception\PathfinderException
*/
public function requestAdminAuthorization($f3){
// store browser tabId to be "targeted" after login
@@ -66,6 +67,8 @@ class Sso extends Api\User{
* redirect user to CCP SSO page and request authorization
* -> cf. Controller->getCookieCharacters() ( equivalent cookie based login)
* @param \Base $f3
* @throws \Exception
* @throws \Exception\PathfinderException
*/
public function requestAuthorization($f3){
$params = $f3->get('GET');
@@ -135,6 +138,7 @@ class Sso extends Api\User{
* @param \Base $f3
* @param array $scopes
* @param string $rootAlias
* @throws \Exception\PathfinderException
*/
private function rerouteAuthorization(\Base $f3, $scopes = [], $rootAlias = 'login'){
if( !empty( Controller\Controller::getEnvironmentData('CCP_SSO_CLIENT_ID') ) ){
@@ -166,6 +170,8 @@ class Sso extends Api\User{
* callback handler for CCP SSO user Auth
* -> see requestAuthorization()
* @param \Base $f3
* @throws \Exception
* @throws \Exception\PathfinderException
*/
public function callbackAuthorization($f3){
$getParams = (array)$f3->get('GET');
@@ -305,6 +311,8 @@ class Sso extends Api\User{
/**
* login by cookie name
* @param \Base $f3
* @throws \Exception
* @throws \Exception\PathfinderException
*/
public function login(\Base $f3){
$data = (array)$f3->get('GET');
@@ -343,6 +351,7 @@ class Sso extends Api\User{
* -> else try to refresh auth and get fresh "access_token"
* @param bool $authCode
* @return null|\stdClass
* @throws \Exception\PathfinderException
*/
public function getSsoAccessData($authCode){
$accessData = null;
@@ -362,6 +371,7 @@ class Sso extends Api\User{
* verify authorization code, and get an "access_token" data
* @param $authCode
* @return \stdClass
* @throws \Exception\PathfinderException
*/
protected function verifyAuthorizationCode($authCode){
$requestParams = [
@@ -377,6 +387,7 @@ class Sso extends Api\User{
* -> if "access_token" is expired, this function gets a fresh one
* @param $refreshToken
* @return \stdClass
* @throws \Exception\PathfinderException
*/
public function refreshAccessToken($refreshToken){
$requestParams = [
@@ -393,6 +404,7 @@ class Sso extends Api\User{
* OR by providing a valid "refresh_token"
* @param $requestParams
* @return \stdClass
* @throws \Exception\PathfinderException
*/
protected function requestAccessData($requestParams){
$verifyAuthCodeUrl = self::getVerifyAuthorizationCodeEndpoint();
@@ -457,6 +469,7 @@ class Sso extends Api\User{
* -> if more character information is required, use ESI "characters" endpoints request instead
* @param $accessToken
* @return mixed|null
* @throws \Exception\PathfinderException
*/
public function verifyCharacterData($accessToken){
$verifyUserUrl = self::getVerifyUserEndpoint();
@@ -492,6 +505,7 @@ class Sso extends Api\User{
* get character data
* @param int $characterId
* @return object
* @throws \Exception
*/
public function getCharacterData($characterId){
$characterData = (object) [];
@@ -601,6 +615,7 @@ class Sso extends Api\User{
* get CCP SSO url from configuration file
* -> throw error if url is broken/missing
* @return string
* @throws \Exception\PathfinderException
*/
static function getSsoUrlRoot(){
$url = '';
@@ -630,6 +645,7 @@ class Sso extends Api\User{
/**
* get logger for SSO logging
* @return \Log
* @throws \Exception\PathfinderException
*/
static function getSSOLogger(){
return parent::getLogger('SSO');

View File

@@ -17,6 +17,7 @@ class Universe extends Controller {
/**
* Set up "Universe" Database
* @param \Base $f3
* @throws \Exception
*/
public function setupDB(\Base $f3){
$this->setupRegions($f3);
@@ -26,6 +27,7 @@ class Universe extends Controller {
/**
* get all regions from CCP and store region data
* @param \Base $f3
* @throws \Exception
*/
private function setupRegions(\Base $f3){
$this->getDB('UNIVERSE');
@@ -50,6 +52,7 @@ class Universe extends Controller {
/**
* get all constellations from CCP and store constellation data
* @param \Base $f3
* @throws \Exception
*/
private function setupConstellations(\Base $f3){
$this->getDB('UNIVERSE');

View File

@@ -63,6 +63,7 @@ class Controller {
* @param \Base $f3
* @param $params
* @return bool
* @throws \Exception\PathfinderException
*/
function beforeroute(\Base $f3, $params): bool {
// initiate DB connection
@@ -107,6 +108,7 @@ class Controller {
/**
* init new Session handler
* @param \Base $f3
*/
protected function initSession(\Base $f3){
$sessionCacheKey = $f3->get('SESSION_CACHE');
@@ -117,6 +119,7 @@ class Controller {
* @param $session
* @param $sid
* @return bool
* @throws \Exception\PathfinderException
*/
$onSuspect = function($session, $sid){
self::getLogger('SESSION_SUSPECT')->write( sprintf(
@@ -181,6 +184,7 @@ class Controller {
* set/update logged in cookie by character model
* -> store validation data in DB
* @param Model\CharacterModel $character
* @throws \Exception\PathfinderException
*/
protected function setLoginCookie(Model\CharacterModel $character){
if( $this->getCookieState() ){
@@ -237,6 +241,8 @@ class Controller {
* @param array $cookieData
* @param bool $checkAuthorization
* @return Model\CharacterModel[]
* @throws \Exception
* @throws \Exception\PathfinderException
*/
protected function getCookieCharacters($cookieData = [], $checkAuthorization = true){
$characters = [];
@@ -341,6 +347,7 @@ class Controller {
* get current character data from session
* ->
* @return array
* @throws \Exception
*/
public function getSessionCharacterData(){
$data = [];
@@ -417,6 +424,7 @@ class Controller {
* get current user
* @param int $ttl
* @return Model\UserModel|null
* @throws \Exception
*/
public function getUser($ttl = 0){
$user = null;
@@ -463,6 +471,8 @@ class Controller {
* @param bool $deleteSession
* @param bool $deleteLog
* @param bool $deleteCookie
* @throws \Exception
* @throws \ZMQSocketException
*/
protected function logoutCharacter(bool $all = false, bool $deleteSession = true, bool $deleteLog = true, bool $deleteCookie = false){
$sessionCharacterData = (array)$this->getF3()->get(Api\User::SESSION_KEY_CHARACTERS);
@@ -581,6 +591,7 @@ class Controller {
/**
* get a custom userAgent string for API calls
* @return string
* @throws \Exception\PathfinderException
*/
protected function getUserAgent(){
$userAgent = '';
@@ -598,6 +609,7 @@ class Controller {
* -> on HTTP request -> render error page
* @param \Base $f3
* @return bool
* @throws \Exception\PathfinderException
*/
public function showError(\Base $f3){
@@ -817,6 +829,7 @@ class Controller {
* get the current registration status
* 0=registration stop |1=new registration allowed
* @return int
* @throws \Exception\PathfinderException
*/
static function getRegistrationStatus(){
return (int)Config::getPathfinderData('registration.status');
@@ -827,6 +840,7 @@ class Controller {
* -> set in pathfinder.ini
* @param string $type
* @return \Log|null
* @throws \Exception\PathfinderException
*/
static function getLogger($type){
return LogController::getLogger($type);
@@ -856,6 +870,7 @@ class Controller {
* health check for ICP socket -> ping request
* @param $ttl
* @param $load
* @throws \ZMQSocketException
*/
static function checkTcpSocket($ttl, $load){
(new Socket( Config::getSocketUri(), $ttl ))->sendData('healthCheck', $load);

View File

@@ -34,6 +34,7 @@ class LogController extends \Prefab {
/**
* get columns from ActivityLogModel that can be uses as counter
* @return array
* @throws \Exception
*/
protected function getActivityLogColumns(): array{
if(empty($this->activityLogColumns)){
@@ -56,6 +57,7 @@ class LogController extends \Prefab {
* -> this buffered data can be stored somewhere (e.g. DB) before HTTP response
* -> should be cleared afterwards!
* @param MapLog $log
* @throws \Exception
*/
public function push(MapLog $log){
$action = $log->getAction();
@@ -161,6 +163,7 @@ class LogController extends \Prefab {
* get Logger instance
* @param string $type
* @return \Log|null
* @throws \Exception\PathfinderException
*/
public static function getLogger($type){
$logFiles = Config::getPathfinderData('logfiles');

View File

@@ -15,6 +15,8 @@ class MapController extends AccessController {
/**
* @param \Base $f3
* @throws \Exception
* @throws \Exception\PathfinderException
*/
public function init(\Base $f3) {
$character = $this->getCharacter();

View File

@@ -85,6 +85,7 @@ class Setup extends Controller {
'Model\ConstellationWormholeModel',
'Model\ConnectionModel',
'Model\ConnectionLogModel',
'Model\SystemSignatureModel',
'Model\ActivityLogModel',
@@ -139,6 +140,7 @@ class Setup extends Controller {
* @param \Base $f3
* @param array $params
* @return bool
* @throws \Exception\PathfinderException
*/
function beforeroute(\Base $f3, $params): bool {
// init dbLib class. Manages all DB connections
@@ -161,6 +163,7 @@ class Setup extends Controller {
/**
* @param \Base $f3
* @throws \Exception\PathfinderException
*/
public function afterroute(\Base $f3) {
// js view (file)
@@ -194,6 +197,7 @@ class Setup extends Controller {
* works as dispatcher for setup functions
* -> for security reasons all /setup "routes" are dispatched by GET params
* @param \Base $f3
* @throws \Exception
*/
public function init(\Base $f3){
$params = $f3->get('GET');
@@ -760,6 +764,7 @@ class Setup extends Controller {
* get default map config
* @param \Base $f3
* @return array
* @throws \Exception\PathfinderException
*/
protected function getMapsDefaultConfig(\Base $f3): array {
$matrix = \Matrix::instance();
@@ -1245,6 +1250,7 @@ class Setup extends Controller {
/**
* get Socket information (TCP (internal)), (WebSocket (clients))
* @return array
* @throws \ZMQSocketException
*/
protected function getSocketInformation(){
// $ttl for health check
@@ -1298,6 +1304,7 @@ class Setup extends Controller {
/** get indexed (cache) data information
* @return array
* @throws \Exception
*/
protected function getIndexData(){
// active DB and tables are required for obtain index data
@@ -1509,6 +1516,7 @@ class Setup extends Controller {
/**
* clear all character authentication (Cookie) data
* @param \Base $f3
* @throws \Exception
*/
protected function invalidateCookies(\Base $f3){
$this->getDB('PF');