Skip to content

Commit

Permalink
Merge pull request #750 from exodus4d/develop
Browse files Browse the repository at this point in the history
v1.5.0
  • Loading branch information
exodus4d authored Mar 1, 2019
2 parents 3fee223 + 3223843 commit 38c1a26
Show file tree
Hide file tree
Showing 187 changed files with 3,773 additions and 1,895 deletions.
35 changes: 27 additions & 8 deletions app/config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ DEBUG = 0
; How to behave on 'non-fatal' errors
; If TRUE, the framework, after having logged stack trace and errors, stops execution
; (die without any status) when a non-fatal error is detected.
; Tip: You should not change this.
; Hint: You should not change this.
; Syntax: TRUE | FALSE
; Default: FALSE
HALT = FALSE

; Timezone to use
; Sync Pathfinder with EVE server time.
; Tip: You should not change this.
; Hint: You should not change this.
; Default: UTC
TZ = UTC

Expand All @@ -35,26 +35,45 @@ LANGUAGE = en-US
; Cache key prefix
; Same for all cache values for this installation.
; CLI (cronjob) scripts use it for cache manipulation.
; Tip: You should not change this.
; Hint: You should not change this.
; Syntax String
; Default: {{ md5(@SERVER.SERVER_NAME) }}
SEED = {{ md5(@SERVER.SERVER_NAME) }}

; Cache backend
; This sets the primary cache backend for Pathfinder. Used for e.g.:
; DB query, DB schema, HTTP response, or even simple key->value caches
; Can handle Redis, Memcache module, APC, WinCache, XCache and a filesystem-based cache.
; Tip: Redis is recommended and gives the best performance.
; Hint: Redis is recommended and gives the best performance.
; Syntax: folder=[DIR] | redis=[SERVER]
; Default: folder=tmp/cache/
; Value: folder=[DIR]
; Value: FALSE
; - Disables caching
; folder=[DIR]
; - Cache data is stored on disc
; redis=[SERVER]
; - Cache data is stored in Redis (e.g. redis=localhost:6379)
; - Cache data is stored in Redis. redis=[host]:[port]:[db] (e.g. redis=localhost:6379:1)
CACHE = folder=tmp/cache/

; Cache backend for API data
; This sets the cache backend for API response data and other temp data relates to API requests.
; Response data with proper 'Expire' HTTP Header will be cached here and speed up further requests.
; As default 'API_CACHE' and 'CACHE' share the same backend (cache location)
; Hint1: You can specify e.g. a dedicated Redis DB here, then 'CACHE' and 'API_CACHE' can be cleared independently
; Hint2: Redis is recommended and gives the best performance.
; Default: {{@CACHE}}
; Value: FALSE
; - Disables caching
; folder=[DIR]
; - Cache data is stored on disc
; redis=[SERVER]
; - Cache data is stored in Redis. redis=[host]:[port]:[db] (e.g. redis=localhost:6379:2)
API_CACHE = {{@CACHE}}

; Cache backend used by PHPs Session handler.
; Tip1: Best performance and recommended configuration for Pathfinder is to configured Redis as PHPs default Session handler
; Hint1: Best performance and recommended configuration for Pathfinder is to configured Redis as PHPs default Session handler
; in your php.ini and set 'default' value here in order to use Redis (fastest)
; Tip2: If Redis is not available for you, leave this at 'mysql' (faster than PHPs default files bases Sessions)
; Hint2: If Redis is not available for you, leave this at 'mysql' (faster than PHPs default files bases Sessions)
; Syntax: mysql | default
; Default: mysql
; Value: mysql
Expand Down
3 changes: 3 additions & 0 deletions app/cron.ini
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ deleteExpiredCacheData = Cron\Cache->deleteExpiredData, @downtime
; delete old statistics (activity log) data
deleteStatisticsData = Cron\StatisticsUpdate->deleteStatisticsData, @weekly

; truncate map history log files
truncateMapHistoryLogFiles = Cron\MapHistory->truncateFiles, @halfHour

; updates small amount of static system data from CCP API
;updateUniverseSystems = Cron\Universe->updateUniverseSystems, @instant

Expand Down
6 changes: 3 additions & 3 deletions app/environment.ini
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ CCP_SSO_SECRET_KEY =
CCP_SSO_DOWNTIME = 11:00

; CCP ESI API
CCP_ESI_URL = https://esi.tech.ccp.is
CCP_ESI_URL = https://esi.evetech.net
CCP_ESI_DATASOURCE = singularity
CCP_ESI_SCOPES = esi-location.read_online.v1,esi-location.read_location.v1,esi-location.read_ship_type.v1,esi-ui.write_waypoint.v1,esi-ui.open_window.v1,esi-universe.read_structures.v1,esi-corporations.read_corporation_membership.v1
CCP_ESI_SCOPES_ADMIN =
Expand Down Expand Up @@ -86,7 +86,7 @@ CCP_SSO_SECRET_KEY =
CCP_SSO_DOWNTIME = 11:00

; CCP ESI API
CCP_ESI_URL = https://esi.tech.ccp.is
CCP_ESI_URL = https://esi.evetech.net
CCP_ESI_DATASOURCE = tranquility
CCP_ESI_SCOPES = esi-location.read_online.v1,esi-location.read_location.v1,esi-location.read_ship_type.v1,esi-ui.write_waypoint.v1,esi-ui.open_window.v1,esi-universe.read_structures.v1,esi-corporations.read_corporation_membership.v1
CCP_ESI_SCOPES_ADMIN =
Expand All @@ -103,4 +103,4 @@ SMTP_ERROR = [email protected]

; TCP Socket configuration (optional) (advanced)
;SOCKET_HOST = 127.0.0.1
;SOCKET_PORT = 5555
;SOCKET_PORT = 5555
43 changes: 43 additions & 0 deletions app/lib/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,48 @@
CHANGELOG

3.6.5 (24 December 2018)
* NEW: Log, added timestamp to each line
* NEW: Auth, added support for custom compare method, [#116](https://github.com/bcosca/fatfree-core/issues/116)
* NEW: cache tag support for mongo & jig mapper, ref [#166](https://github.com/bcosca/fatfree-core/issues/116)
* NEW: Allow PHP functions as template token filters
* Web: Fix double redirect bug when running cURL with open_basedir disabled
* Web: Cope with responses from HTTP/2 servers
* Web->filler: remove very first space, when $std is false
* Web\OAuth2: Cope with HTTP/2 responses
* Web\OAuth2: take Content-Type header into account for json decoding, [#250](https://github.com/bcosca/fatfree-core/issues/250) [#251](https://github.com/bcosca/fatfree-core/issues/251)
* Web\OAuth2: fixed empty results on some endpoints [#250](https://github.com/bcosca/fatfree-core/issues/250)
* DB\SQL\Mapper: optimize mapper->count memory usage
* DB\SQL\Mapper: New table alias operator
* DB\SQL\Mapper: fix count() performance on non-grouped result sets, [bcosca/fatfree#1114](https://github.com/bcosca/fatfree/issues/1114)
* DB\SQL: Support for CTE in postgreSQL, [bcosca/fatfree#1107](https://github.com/bcosca/fatfree/issues/1107), [bcosca/fatfree#1116](https://github.com/bcosca/fatfree/issues/1116), [bcosca/fatfree#1021](https://github.com/bcosca/fatfree/issues/1021)
* DB\SQL->log: Remove extraneous whitespace
* DB\SQL: Added ability to add inline comments per SQL query
* CLI\WS, Refactoring: Streamline socket server
* CLI\WS: Add option for dropping query in OAuth2 URI
* CLI\WS: Add URL-safe base64 encoding
* CLI\WS: Detect errors in returned JSON values
* CLI\WS: Added support for Sec-WebSocket-Protocol header
* Matrix->calendar: Allow unix timestamp as date argument
* Basket: Access basket item by _id [#260](https://github.com/bcosca/fatfree-core/issues/260)
* SMTP: Added TLS 1.2 support [bcosca/fatfree#1115](https://github.com/bcosca/fatfree/issues/1115)
* SMTP->send: Respect $log argument
* Base->cast: recognize binary and octal numbers in config
* Base->cast: add awareness of hexadecimal literals
* Base->abort: Remove unnecessary Content-Encoding header
* Base->abort: Ensure headers have not been flushed
* Base->format: Differentiate between long- and full-date (with localized weekday) formats
* Base->format: Conform with intl extension's number output
* Enable route handler to override Access-Control headers in response to OPTIONS request, [#257](https://github.com/bcosca/fatfree-core/issues/257)
* Augment filters with a var_export function
* Bug fix php7.3: Fix template parse regex to be compatible with strict PCRE2 rules for hyphen placement in a character class
* Bug fix, Cache->set: update creation time when updating existing cache entries
* Bug fix: incorrect ICU date/time formatting
* Bug fix, Jig: lazy write on empty data
* Bug fix: Method uppercase to avoid route failure [#252](https://github.com/bcosca/fatfree-core/issues/252)
* Fixed error description when (PSR-11) `CONTAINER` fails to resolve a class [#253](https://github.com/bcosca/fatfree-core/issues/253)
* Mitigate CSRF predictability/vulnerability
* Expose Mapper->factory() method

3.6.4 (19 April 2018)
* NEW: Added Dependency Injection support with CONTAINER variable [#221](https://github.com/bcosca/fatfree-core/issues/221)
* NEW: configurable LOGGABLE error codes [#1091](https://github.com/bcosca/fatfree/issues/1091#issuecomment-364674701)
Expand Down
45 changes: 29 additions & 16 deletions app/lib/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/*
Copyright (c) 2009-2017 F3::Factory/Bong Cosca, All rights reserved.
Copyright (c) 2009-2018 F3::Factory/Bong Cosca, All rights reserved.
This file is part of the Fat-Free Framework (http://fatfreeframework.com).
Expand Down Expand Up @@ -35,7 +35,9 @@ class Auth {
//! Mapper object
$mapper,
//! Storage options
$args;
$args,
//! Custom compare function
$func;

/**
* Jig storage handler
Expand All @@ -45,22 +47,26 @@ class Auth {
* @param $realm string
**/
protected function _jig($id,$pw,$realm) {
return (bool)
$success = (bool)
call_user_func_array(
[$this->mapper,'load'],
[
array_merge(
[
'@'.$this->args['id'].'==? AND '.
'@'.$this->args['pw'].'==?'.
'@'.$this->args['id'].'==?'.
($this->func?'':' AND @'.$this->args['pw'].'==?').
(isset($this->args['realm'])?
(' AND @'.$this->args['realm'].'==?'):''),
$id,$pw
$id
],
($this->func?[]:[$pw]),
(isset($this->args['realm'])?[$realm]:[])
)
]
);
if ($success && $this->func)
$success = call_user_func($this->func,$pw,$this->mapper->get($this->args['pw']));
return $success;
}

/**
Expand All @@ -71,15 +77,16 @@ protected function _jig($id,$pw,$realm) {
* @param $realm string
**/
protected function _mongo($id,$pw,$realm) {
return (bool)
$success = (bool)
$this->mapper->load(
[
$this->args['id']=>$id,
$this->args['pw']=>$pw
]+
[$this->args['id']=>$id]+
($this->func?[]:[$this->args['pw']=>$pw])+
(isset($this->args['realm'])?
[$this->args['realm']=>$realm]:[])
);
if ($success && $this->func)
$success = call_user_func($this->func,$pw,$this->mapper->get($this->args['pw']));
return $success;
}

/**
Expand All @@ -90,22 +97,26 @@ protected function _mongo($id,$pw,$realm) {
* @param $realm string
**/
protected function _sql($id,$pw,$realm) {
return (bool)
$success = (bool)
call_user_func_array(
[$this->mapper,'load'],
[
array_merge(
[
$this->args['id'].'=? AND '.
$this->args['pw'].'=?'.
$this->args['id'].'=?'.
($this->func?'':' AND '.$this->args['pw'].'=?').
(isset($this->args['realm'])?
(' AND '.$this->args['realm'].'=?'):''),
$id,$pw
$id
],
($this->func?[]:[$pw]),
(isset($this->args['realm'])?[$realm]:[])
)
]
);
if ($success && $this->func)
$success = call_user_func($this->func,$pw,$this->mapper->get($this->args['pw']));
return $success;
}

/**
Expand Down Expand Up @@ -234,8 +245,9 @@ function basic($func=NULL) {
* @return object
* @param $storage string|object
* @param $args array
* @param $func callback
**/
function __construct($storage,array $args=NULL) {
function __construct($storage,array $args=NULL,$func=NULL) {
if (is_object($storage) && is_a($storage,'DB\Cursor')) {
$this->storage=$storage->dbtype();
$this->mapper=$storage;
Expand All @@ -244,6 +256,7 @@ function __construct($storage,array $args=NULL) {
else
$this->storage=$storage;
$this->args=$args;
$this->func=$func;
}

}
Loading

0 comments on commit 38c1a26

Please sign in to comment.