Skip to content

Commit 3fee223

Browse files
authored
Merge pull request #721 from exodus4d/develop
v1.4.3
2 parents edf264e + e42c024 commit 3fee223

File tree

184 files changed

+2630
-1409
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

184 files changed

+2630
-1409
lines changed

app/config.ini

Lines changed: 113 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,123 @@
11
; Global Framework Config
22

33
[SERVER]
4-
SERVER_NAME = PATHFINDER
4+
SERVER_NAME = PATHFINDER
55

66
[globals]
7-
; Default Verbosity level of the stack trace.
8-
; Assign values between 0 to 3 for increasing verbosity levels. Check (environment.ini) config for overwriting
9-
; (default: 0)
10-
DEBUG = 0
11-
12-
; If TRUE, the framework, after having logged stack trace and errors, stops execution
13-
; -> (die without any status) when a non-fatal error is detected. (default: FALSE)
14-
HALT = FALSE
15-
16-
; Timezone to use. Sync program with eve server time. (default: UTC)
17-
TZ = UTC
18-
19-
; Cache key prefix. Same for all cache values for this installation
20-
; CLI (cronjob) scripts use it for cache manipulation
21-
SEED = {{ md5(@SERVER.SERVER_NAME) }}
22-
23-
; Cache backend. Can handle Redis, Memcache module, APC, WinCache, XCache and a filesystem-based cache.
24-
; (default: folder=tmp/cache/)
25-
CACHE = folder=tmp/cache/
26-
;CACHE = redis=localhost:6379
27-
28-
; Cache backend used by Session handler.
29-
; default
30-
; -If CACHE is enabled (see above), the same location is used for Session data (e.g. fileCache, RedisDB)
31-
; mysql
32-
; - Session data get stored in your 'PathfinderDB' table 'sessions' (faster)
33-
SESSION_CACHE = mysql
7+
; Verbosity level of error stack trace for errors
8+
; This affects error logging and stack traces returned to clients on error.
9+
; DEBUG level can be overwritten in environment.ini
10+
; Syntax: 0 | 1 | 2 | 3
11+
; Default: 0
12+
DEBUG = 0
13+
14+
; How to behave on 'non-fatal' errors
15+
; If TRUE, the framework, after having logged stack trace and errors, stops execution
16+
; (die without any status) when a non-fatal error is detected.
17+
; Tip: You should not change this.
18+
; Syntax: TRUE | FALSE
19+
; Default: FALSE
20+
HALT = FALSE
21+
22+
; Timezone to use
23+
; Sync Pathfinder with EVE server time.
24+
; Tip: You should not change this.
25+
; Default: UTC
26+
TZ = UTC
27+
28+
; Default language
29+
; Overwrites HTTP Accept-Language request header.
30+
; Used by setlocale() and affects number formatting.
31+
; Syntax: String
32+
; Default: en-US
33+
LANGUAGE = en-US
34+
35+
; Cache key prefix
36+
; Same for all cache values for this installation.
37+
; CLI (cronjob) scripts use it for cache manipulation.
38+
; Tip: You should not change this.
39+
; Syntax String
40+
; Default: {{ md5(@SERVER.SERVER_NAME) }}
41+
SEED = {{ md5(@SERVER.SERVER_NAME) }}
42+
43+
; Cache backend
44+
; Can handle Redis, Memcache module, APC, WinCache, XCache and a filesystem-based cache.
45+
; Tip: Redis is recommended and gives the best performance.
46+
; Syntax: folder=[DIR] | redis=[SERVER]
47+
; Default: folder=tmp/cache/
48+
; Value: folder=[DIR]
49+
; - Cache data is stored on disc
50+
; redis=[SERVER]
51+
; - Cache data is stored in Redis (e.g. redis=localhost:6379)
52+
CACHE = folder=tmp/cache/
53+
54+
; Cache backend used by PHPs Session handler.
55+
; Tip1: Best performance and recommended configuration for Pathfinder is to configured Redis as PHPs default Session handler
56+
; in your php.ini and set 'default' value here in order to use Redis (fastest)
57+
; Tip2: If Redis is not available for you, leave this at 'mysql' (faster than PHPs default files bases Sessions)
58+
; Syntax: mysql | default
59+
; Default: mysql
60+
; Value: mysql
61+
; - Session data get stored in 'pathfinder'.'sessions' table (environment.ini → DB_PF_NAME).
62+
; Table `sessions` is auto created if not exist.
63+
; default
64+
; - Session data get stored in PHPs default Session handler (php.ini → session.save_handler and session.save_path)
65+
; PHPs default session.save_handler is `files` and each Session is written to disc (slowest)
66+
SESSION_CACHE = mysql
3467

3568
; Callback functions ==============================================================================
36-
ONERROR = Controller\Controller->showError
37-
UNLOAD = Controller\Controller->unload
69+
ONERROR = Controller\Controller->showError
70+
UNLOAD = Controller\Controller->unload
3871

3972
; Path configurations =============================================================================
40-
; relative to "BASE" dir
41-
42-
; Temporary folder for cache, filesystem locks, compiled F3 templates, etc. (default: tmp/)
43-
TEMP = tmp/
44-
45-
; Log file folder. (default: logs/)
46-
LOGS = logs/
47-
48-
; UI/template folder. (default: public/)
49-
UI = public/
50-
51-
; Autoloader for user-defined PHP classes that the framework will attempt to autoload at runtime. (default: app/main/)
52-
AUTOLOAD = app/main/
53-
54-
; Favicons. (default: favicon/)
55-
FAVICON = favicon/
56-
57-
; Export folder (e.g. static table data). (default: export/)
58-
EXPORT = export/
59-
60-
; Default language (overwrites HTTP Accept-Language request header) used for "setlocale()" affects number formatting. (default: en-US)
61-
LANGUAGE = en-US
62-
63-
; custom *.ini file folder, can be used to overwrite default *.ini files
64-
CONF.CUSTOM = conf/
65-
CONF.DEFAULT = app/
66-
67-
; load additional config files
68-
; DO NOT load environment.ini, it is loaded automatically
73+
; All path configurations are relative to BASE dir and should NOT be changed
74+
75+
; Temporary folder for cache
76+
; Used for compiled templates.
77+
; Syntax: [DIR]
78+
; Default: tmp/
79+
TEMP = tmp/
80+
81+
; Log file folder
82+
; Syntax: [DIR]
83+
; Default: logs/
84+
LOGS = logs/
85+
86+
; UI folder
87+
; Where all the public assets (templates, images, styles, scripts) are located.
88+
; Syntax: [DIR]
89+
; Default: public/
90+
UI = public/
91+
92+
; Autoload folder
93+
; Where PHP attempts to autoload PHP classes at runtime.
94+
; Syntax: [DIR]
95+
; Default: app/main/
96+
AUTOLOAD = app/main/
97+
98+
; Favicon folder
99+
; Syntax: [DIR]
100+
; Default: favicon/
101+
FAVICON = favicon/
102+
103+
; Export folder
104+
; Where DB dump files are located/created at.
105+
; Syntax: [DIR]
106+
; Default: export/
107+
EXPORT = export/
108+
109+
; Custom *.ini file folder
110+
; Can be used to overwrite default *.ini files and settings
111+
; See: https://github.com/exodus4d/pathfinder/wiki/Configuration#custom-confpathfinderini
112+
; Syntax: [DIR]
113+
CONF.CUSTOM = conf/
114+
CONF.DEFAULT = app/
115+
116+
; Load additional config files
117+
; DO NOT load environment.ini, it is loaded automatically
69118
[configs]
70-
{{@CONF.DEFAULT}}routes.ini = true
71-
{{@CONF.DEFAULT}}pathfinder.ini = true
72-
{{@CONF.CUSTOM}}pathfinder.ini = true
73-
{{@CONF.DEFAULT}}requirements.ini = true
74-
{{@CONF.DEFAULT}}cron.ini = true
119+
{{@CONF.DEFAULT}}routes.ini = true
120+
{{@CONF.DEFAULT}}pathfinder.ini = true
121+
{{@CONF.CUSTOM}}pathfinder.ini = true
122+
{{@CONF.DEFAULT}}requirements.ini = true
123+
{{@CONF.DEFAULT}}cron.ini = true

app/environment.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ DB_UNIVERSE_PASS =
3030
CCP_SSO_URL = https://sisilogin.testeveonline.com
3131
CCP_SSO_CLIENT_ID =
3232
CCP_SSO_SECRET_KEY =
33+
CCP_SSO_DOWNTIME = 11:00
3334

3435
; CCP ESI API
3536
CCP_ESI_URL = https://esi.tech.ccp.is
@@ -82,6 +83,7 @@ DB_CCP_PASS =
8283
CCP_SSO_URL = https://login.eveonline.com
8384
CCP_SSO_CLIENT_ID =
8485
CCP_SSO_SECRET_KEY =
86+
CCP_SSO_DOWNTIME = 11:00
8587

8688
; CCP ESI API
8789
CCP_ESI_URL = https://esi.tech.ccp.is

app/main/controller/accesscontroller.php

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ class AccessController extends Controller {
2020
* @param $params
2121
* @return bool
2222
* @throws \Exception
23-
* @throws \Exception\PathfinderException
2423
* @throws \ZMQSocketException
2524
*/
2625
function beforeroute(\Base $f3, $params): bool {
@@ -29,15 +28,7 @@ function beforeroute(\Base $f3, $params): bool {
2928
// requires a valid logged in user!
3029
if( !$this->isLoggedIn($f3) ){
3130
// no character found or login timer expired
32-
$this->logoutCharacter();
33-
34-
if($f3->get('AJAX')){
35-
// unauthorized request
36-
$f3->status(403);
37-
}else{
38-
// redirect to landing page
39-
$f3->reroute(['login']);
40-
}
31+
$this->logoutCharacter($f3);
4132
// skip route handler and afterroute()
4233
$return = false;
4334
}
@@ -51,7 +42,6 @@ function beforeroute(\Base $f3, $params): bool {
5142
* @param \Base $f3
5243
* @return bool
5344
* @throws \Exception
54-
* @throws \Exception\PathfinderException
5545
*/
5646
protected function isLoggedIn(\Base $f3): bool {
5747
$loginCheck = false;
@@ -71,7 +61,6 @@ protected function isLoggedIn(\Base $f3): bool {
7161
* @param \Base $f3
7262
* @param Model\CharacterModel $character
7363
* @return bool
74-
* @throws \Exception\PathfinderException
7564
*/
7665
private function checkLogTimer(\Base $f3, Model\CharacterModel $character){
7766
$loginCheck = false;
@@ -104,7 +93,6 @@ private function checkLogTimer(\Base $f3, Model\CharacterModel $character){
10493
* @param Model\MapModel $map
10594
* @return int (number of active connections for this map)
10695
* @throws \Exception
107-
* @throws \Exception\PathfinderException
10896
* @throws \ZMQSocketException
10997
*/
11098
protected function broadcastMapData(Model\MapModel $map){
@@ -117,7 +105,6 @@ protected function broadcastMapData(Model\MapModel $map){
117105
* @param Model\MapModel $map
118106
* @return array
119107
* @throws \Exception
120-
* @throws \Exception\PathfinderException
121108
*/
122109
protected function getFormattedMapData(Model\MapModel $map){
123110
$mapData = $map->getData();

app/main/controller/admin.php

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ class Admin extends Controller{
3737
* @param $params
3838
* @return bool
3939
* @throws \Exception
40-
* @throws \Exception\PathfinderException
4140
*/
4241
function beforeroute(\Base $f3, $params): bool {
4342
$return = parent::beforeroute($f3, $params);
@@ -50,7 +49,7 @@ function beforeroute(\Base $f3, $params): bool {
5049
$this->dispatch($f3, $params, $character);
5150
}
5251

53-
$f3->set('tplAuthType', $f3->alias( 'sso', ['action' => 'requestAdminAuthorization']));
52+
$f3->set('tplAuthType', $f3->get('BASE') . $f3->alias( 'sso', ['action' => 'requestAdminAuthorization']));
5453

5554
// page title
5655
$f3->set('tplPageTitle', 'Admin | ' . Config::getPathfinderData('name'));
@@ -67,7 +66,6 @@ function beforeroute(\Base $f3, $params): bool {
6766
/**
6867
* event handler after routing
6968
* @param \Base $f3
70-
* @throws \Exception\PathfinderException
7169
*/
7270
public function afterroute(\Base $f3) {
7371
// js view (file)
@@ -123,7 +121,6 @@ protected function getAdminCharacter(\Base $f3){
123121
* @param $params
124122
* @param null $character
125123
* @throws \Exception
126-
* @throws \Exception\PathfinderException
127124
*/
128125
public function dispatch(\Base $f3, $params, $character = null){
129126
if($character instanceof CharacterModel){
@@ -232,7 +229,6 @@ protected function saveSettings(CharacterModel $character, int $corporationId, a
232229
* @param CharacterModel $character
233230
* @param int $kickCharacterId
234231
* @param int $minutes
235-
* @throws \Exception\PathfinderException
236232
*/
237233
protected function kickCharacter(CharacterModel $character, $kickCharacterId, $minutes){
238234
$kickOptions = self::KICK_OPTIONS;
@@ -262,7 +258,6 @@ protected function kickCharacter(CharacterModel $character, $kickCharacterId, $m
262258
* @param CharacterModel $character
263259
* @param int $banCharacterId
264260
* @param int $value
265-
* @throws \Exception\PathfinderException
266261
*/
267262
protected function banCharacter(CharacterModel $character, $banCharacterId, $value){
268263
$banCharacters = $this->filterValidCharacters($character, $banCharacterId);
@@ -309,7 +304,6 @@ protected function filterValidCharacters(CharacterModel $character, $characterId
309304
* @param CharacterModel $character
310305
* @param int $mapId
311306
* @param int $value
312-
* @throws \Exception\PathfinderException
313307
*/
314308
protected function activateMap(CharacterModel $character, int $mapId, int $value){
315309
$maps = $this->filterValidMaps($character, $mapId);
@@ -322,7 +316,6 @@ protected function activateMap(CharacterModel $character, int $mapId, int $value
322316
/**
323317
* @param CharacterModel $character
324318
* @param int $mapId
325-
* @throws \Exception\PathfinderException
326319
*/
327320
protected function deleteMap(CharacterModel $character, int $mapId){
328321
$maps = $this->filterValidMaps($character, $mapId);
@@ -336,7 +329,6 @@ protected function deleteMap(CharacterModel $character, int $mapId){
336329
* @param CharacterModel $character
337330
* @param int $mapId
338331
* @return \DB\CortexCollection[]|MapModel[]
339-
* @throws \Exception\PathfinderException
340332
*/
341333
protected function filterValidMaps(CharacterModel $character, int $mapId) {
342334
$maps = [];
@@ -355,7 +347,6 @@ protected function filterValidMaps(CharacterModel $character, int $mapId) {
355347
* get log file for "admin" logs
356348
* @param string $type
357349
* @return \Log
358-
* @throws \Exception\PathfinderException
359350
*/
360351
static function getLogger($type = 'ADMIN'){
361352
return parent::getLogger('ADMIN');
@@ -406,7 +397,6 @@ protected function initMembers(\Base $f3, CharacterModel $character){
406397
* init /maps page data
407398
* @param \Base $f3
408399
* @param CharacterModel $character
409-
* @throws \Exception\PathfinderException
410400
*/
411401
protected function initMaps(\Base $f3, CharacterModel $character){
412402
$data = (object) [];

app/main/controller/api/github.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ protected function getBaseRequestOptions() : array {
2929
/**
3030
* get HTTP request options for API (curl) request
3131
* @return array
32-
* @throws \Exception\PathfinderException
3332
*/
3433
protected function getRequestReleaseOptions() : array {
3534
$options = $this->getBaseRequestOptions();
@@ -41,7 +40,6 @@ protected function getRequestReleaseOptions() : array {
4140
* get HTTP request options for API (curl) request
4241
* @param string $text
4342
* @return array
44-
* @throws \Exception\PathfinderException
4543
*/
4644
protected function getRequestMarkdownOptions(string $text) : array {
4745
$params = [
@@ -59,7 +57,6 @@ protected function getRequestMarkdownOptions(string $text) : array {
5957
/**
6058
* get release information from GitHub
6159
* @param \Base $f3
62-
* @throws \Exception\PathfinderException
6360
*/
6461
public function releases(\Base $f3){
6562
$cacheKey = 'CACHE_GITHUB_RELEASES';

0 commit comments

Comments
 (0)