Session class update, cli check add, tests updates, edit table update
Update edit_access_data table and set unique check for edit_access_id + name so we do not have two identical keys for one edit access set Update config host and add more test domains for various access tests Update Session and move cli check to Get\System class. Some other minor session info updates New method \Get\System::checkCLI() returns true if the sapi name has cli inside, else false
This commit is contained in:
@@ -53,7 +53,10 @@ $SITE_CONFIG = [
|
||||
'login_enabled' => true
|
||||
],
|
||||
// 'other.host.com' => $__LOCAL_CONFIG
|
||||
'soba-dev.tequila.jp' => $__LOCAL_CONFIG
|
||||
'soba-dev.tequila.jp' => $__LOCAL_CONFIG,
|
||||
'soba.tequila.jp' => $__LOCAL_CONFIG,
|
||||
'soba.teq.jp' => $__LOCAL_CONFIG,
|
||||
'soba-local.tokyo.tequila.jp' => $__LOCAL_CONFIG,
|
||||
];
|
||||
|
||||
// __END__
|
||||
|
||||
@@ -61,7 +61,10 @@ class Session
|
||||
}
|
||||
|
||||
/**
|
||||
* Undocumented function
|
||||
* start session with given session name if set
|
||||
* aborts on command line or if sessions are not enabled
|
||||
* also aborts if session cannot be started
|
||||
* On sucess returns the session id
|
||||
*
|
||||
* @param string|null $session_name
|
||||
* @return string|bool
|
||||
@@ -69,7 +72,7 @@ class Session
|
||||
public static function startSession(?string $session_name = null)
|
||||
{
|
||||
// we can't start sessions on command line
|
||||
if (php_sapi_name() === 'cli') {
|
||||
if (\CoreLibs\Get\System::checkCLI()) {
|
||||
self::$error_str = '[SESSION] No sessions in php cli';
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -94,6 +94,16 @@ class System
|
||||
{
|
||||
return pathinfo($_SERVER['PHP_SELF']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the php sapi interface has cli inside
|
||||
*
|
||||
* @return bool True for CLI type PHP, else false
|
||||
*/
|
||||
public static function checkCLI(): bool
|
||||
{
|
||||
return substr(php_sapi_name(), 0, 3) === 'cli' ? true : false;
|
||||
}
|
||||
}
|
||||
|
||||
// __END__
|
||||
|
||||
Reference in New Issue
Block a user