Skip to content

Commit

Permalink
Try to fix sqlite detection
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitexus committed Nov 8, 2023
1 parent bed8d9b commit e5d5e64
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
5 changes: 2 additions & 3 deletions src/Ease/Logger/ToEventlog.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* Log to EventLog.
*
* @author Vitex <vitex@hippy.cz>
* @copyright 2009-2021 Vitex@hippy.cz (G)
* @copyright 2009-2023 Vitex@hippy.cz (G)
*/
class ToEventlog extends ToSyslog implements Loggingable
{
Expand Down Expand Up @@ -50,7 +50,6 @@ public function finalizeMessage($messageRaw)
*/
public static function singleton()
{
return is_object(self::$instance) ? self::$instance :
new self(\Ease\Shared::appName() ? \Ease\Shared::appName() : 'EaseFramework');
return is_object(self::$instance) ? self::$instance : new self(\Ease\Shared::appName());
}
}
8 changes: 4 additions & 4 deletions src/Ease/Shared.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public static function init($configKeys = [], $envFile = '')
}
}
$configured = true;
if (array_key_exists('DB_CONNECTION', $configKeys) && strstr(self::cfg('DB_CONNECTION'), 'sqlite')) {
if (array_key_exists('DB_CONNECTION', $configKeys) && (substr(self::cfg('DB_CONNECTION', ''), 0, 6) === 'sqlite')) {
unset($configKeys['DB_PASSWORD']);
unset($configKeys['DB_USERNAME']);
unset($configKeys['DB_HOST']);
Expand All @@ -97,7 +97,7 @@ public static function init($configKeys = [], $envFile = '')
*
* @return string|int|boolean|null
*/
public static function cfg(/*string*/ $constant, $cfg = null)
public static function cfg(/* string */ $constant, $cfg = null)
{
if (!empty($constant) && defined($constant)) {
$cfg = constant($constant);
Expand Down Expand Up @@ -279,8 +279,8 @@ public static function &user(Person $user = null, string $candidat = 'User', str
} else {
if (!empty($candidat)) {
$_SESSION[$efprefix][self::$userSessionName] = method_exists($candidat, 'singleton') ?
$candidat::singleton() :
new $candidat();
$candidat::singleton() :
new $candidat();
}
}
return $_SESSION[$efprefix][self::$userSessionName];
Expand Down

0 comments on commit e5d5e64

Please sign in to comment.