// Swallow the error if the table hasn't been created yet.
catch(\Exception){
}
returnFALSE;
}
/**
* Defines the schema for the session table.
*
* @internal
*/
protectedfunctionschemaDefinition():array{
$schema=[
'description'=>"Drupal's session handlers read and write into the sessions table. Each record represents a user session, either anonymous or authenticated.",
'fields'=>[
'uid'=>[
'description'=>'The {users}.uid corresponding to a session, or 0 for anonymous user.',
'type'=>'int',
'unsigned'=>TRUE,
'not null'=>TRUE,
],
'sid'=>[
'description'=>"A session ID (hashed). The value is generated by Drupal's session handlers.",
'type'=>'varchar_ascii',
'length'=>128,
'not null'=>TRUE,
],
'hostname'=>[
'description'=>'The IP address that last used this session ID (sid).',
'type'=>'varchar_ascii',
'length'=>128,
'not null'=>TRUE,
'default'=>'',
],
'timestamp'=>[
'description'=>'The Unix timestamp when this session last requested a page. Old records are purged by PHP automatically.',
'type'=>'int',
'not null'=>TRUE,
'default'=>0,
'size'=>'big',
],
'session'=>[
'description'=>'The serialized contents of the user\'s session, an array of name/value pairs that persists across page requests by this session ID. Drupal loads the user\'s session from here at the start of each request and saves it at the end.',
'type'=>'blob',
'not null'=>FALSE,
'size'=>'big',
],
],
'primary key'=>[
'sid',
],
'indexes'=>[
'timestamp'=>['timestamp'],
'uid'=>['uid'],
],
'foreign keys'=>[
'session_user'=>[
'table'=>'users',
'columns'=>['uid'=>'uid'],
],
],
];
return$schema;
}
/**
* Check if the session table exists and create it if not.
*
* @return bool
* TRUE if the table already exists or was created, FALSE if creation fails.
'description'=>"Drupal's session handlers read and write into the sessions table. Each record represents a user session, either anonymous or authenticated.",
'fields'=>[
'uid'=>[
'description'=>'The {users}.uid corresponding to a session, or 0 for anonymous user.',
'type'=>'int',
'unsigned'=>TRUE,
'not null'=>TRUE,
],
'sid'=>[
'description'=>"A session ID (hashed). The value is generated by Drupal's session handlers.",
'type'=>'varchar_ascii',
'length'=>128,
'not null'=>TRUE,
],
'hostname'=>[
'description'=>'The IP address that last used this session ID (sid).',
'type'=>'varchar_ascii',
'length'=>128,
'not null'=>TRUE,
'default'=>'',
],
'timestamp'=>[
'description'=>'The Unix timestamp when this session last requested a page. Old records are purged by PHP automatically.',
'type'=>'int',
'not null'=>TRUE,
'default'=>0,
'size'=>'big',
],
'session'=>[
'description'=>'The serialized contents of the user\'s session, an array of name/value pairs that persists across page requests by this session ID. Drupal loads the user\'s session from here at the start of each request and saves it at the end.',