mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-09 03:32:00 +09:00
More fixes to improve PHP 8.0 compatibility
This commit is contained in:
parent
8c161bc28d
commit
417e4d15b0
9 changed files with 41 additions and 30 deletions
|
|
@ -768,7 +768,7 @@ class Debug
|
|||
'url' => getCurrentPageUrl(),
|
||||
'request' => (object)array(
|
||||
'method' => $_SERVER['REQUEST_METHOD'] . ($_SERVER['REQUEST_METHOD'] !== \Context::getRequestMethod() ? (' (' . \Context::getRequestMethod() . ')') : ''),
|
||||
'size' => intval($_SERVER['CONTENT_LENGTH']),
|
||||
'size' => intval($_SERVER['CONTENT_LENGTH'] ?? 0),
|
||||
),
|
||||
'response' => (object)array(
|
||||
'method' => \Context::getResponseMethod(),
|
||||
|
|
@ -776,15 +776,15 @@ class Debug
|
|||
),
|
||||
'timing' => (object)array(
|
||||
'total' => sprintf('%0.4f sec', microtime(true) - \RX_MICROTIME),
|
||||
'template' => sprintf('%0.4f sec (count: %d)', $GLOBALS['__template_elapsed__'], $GLOBALS['__TemplateHandlerCalled__']),
|
||||
'xmlparse' => sprintf('%0.4f sec', $GLOBALS['__xmlparse_elapsed__']),
|
||||
'template' => sprintf('%0.4f sec (count: %d)', $GLOBALS['__template_elapsed__'] ?? 0, $GLOBALS['__TemplateHandlerCalled__'] ?? 0),
|
||||
'xmlparse' => sprintf('%0.4f sec', $GLOBALS['__xmlparse_elapsed__'] ?? 0),
|
||||
'db_query' => sprintf('%0.4f sec (count: %d)', self::$_query_time, count(self::$_queries)),
|
||||
'db_class' => sprintf('%0.4f sec', max(0, $db->getTotalElapsedTime() - self::$_query_time)),
|
||||
'session' => sprintf('%0.4f sec', self::$_session_time),
|
||||
'layout' => sprintf('%0.4f sec', $GLOBALS['__layout_compile_elapsed__']),
|
||||
'widget' => sprintf('%0.4f sec', $GLOBALS['__widget_excute_elapsed__']),
|
||||
'remote' => sprintf('%0.4f sec', $GLOBALS['__remote_request_elapsed__']),
|
||||
'trans' => sprintf('%0.4f sec', $GLOBALS['__trans_content_elapsed__']),
|
||||
'layout' => sprintf('%0.4f sec', $GLOBALS['__layout_compile_elapsed__'] ?? 0),
|
||||
'widget' => sprintf('%0.4f sec', $GLOBALS['__widget_excute_elapsed__'] ?? 0),
|
||||
'remote' => sprintf('%0.4f sec', $GLOBALS['__remote_request_elapsed__'] ?? 0),
|
||||
'trans' => sprintf('%0.4f sec', $GLOBALS['__trans_content_elapsed__'] ?? 0),
|
||||
),
|
||||
'entries' => self::$_entries,
|
||||
'errors' => self::$_errors,
|
||||
|
|
|
|||
|
|
@ -50,8 +50,8 @@ class DBQueryParser extends BaseParser
|
|||
|
||||
// Load attributes that only apply to subqueries in the <conditions> block.
|
||||
$query->operation = $attribs['operation'] ?? null;
|
||||
$query->column = preg_replace('/[^a-z0-9_\.]/i', '', $attribs['column']) ?: null;
|
||||
$query->pipe = strtoupper($attribs['pipe']) ?: 'AND';
|
||||
$query->column = preg_replace('/[^a-z0-9_\.]/i', '', $attribs['column'] ?? null) ?: null;
|
||||
$query->pipe = strtoupper($attribs['pipe'] ?? null) ?: 'AND';
|
||||
|
||||
// Load tables.
|
||||
foreach ($xml->tables ? $xml->tables->children() : [] as $tag)
|
||||
|
|
@ -108,13 +108,13 @@ class DBQueryParser extends BaseParser
|
|||
$attribs = self::_getAttributes($tag);
|
||||
$column = new DBQuery\ColumnWrite;
|
||||
$column->name = $attribs['name'];
|
||||
$column->operation = $attribs['operation'] ?: 'equal';
|
||||
$column->operation = ($attribs['operation'] ?? null) ?: 'equal';
|
||||
$column->var = $attribs['var'] ?? null;
|
||||
$column->default = $attribs['default'] ?? null;
|
||||
$column->not_null = $attribs['notnull'] ? true : false;
|
||||
$column->not_null = ($attribs['notnull'] ?? false) ? true : false;
|
||||
$column->filter = $attribs['filter'] ?? null;
|
||||
$column->minlength = intval($attribs['minlength'], 10);
|
||||
$column->maxlength = intval($attribs['maxlength'], 10);
|
||||
$column->minlength = intval($attribs['minlength'] ?? 0, 10);
|
||||
$column->maxlength = intval($attribs['maxlength'] ?? 0, 10);
|
||||
$query->columns[] = $column;
|
||||
}
|
||||
}
|
||||
|
|
@ -225,18 +225,18 @@ class DBQueryParser extends BaseParser
|
|||
$cond->var = $attribs['var'] ?? null;
|
||||
$cond->default = $attribs['default'] ?? null;
|
||||
}
|
||||
$cond->not_null = $attribs['notnull'] ? true : false;
|
||||
$cond->not_null = ($attribs['notnull'] ?? false) ? true : false;
|
||||
$cond->filter = $attribs['filter'] ?? null;
|
||||
$cond->minlength = intval($attribs['minlength'], 10);
|
||||
$cond->maxlength = intval($attribs['maxlength'], 10);
|
||||
$cond->pipe = strtoupper($attribs['pipe']) ?: 'AND';
|
||||
$cond->minlength = intval($attribs['minlength'] ?? 0, 10);
|
||||
$cond->maxlength = intval($attribs['maxlength'] ?? 0, 10);
|
||||
$cond->pipe = strtoupper($attribs['pipe'] ?? null) ?: 'AND';
|
||||
$result[] = $cond;
|
||||
}
|
||||
elseif ($name === 'group')
|
||||
{
|
||||
$group = new DBQuery\ConditionGroup;
|
||||
$group->conditions = self::_parseConditions($tag);
|
||||
$group->pipe = strtoupper($attribs['pipe']) ?: 'AND';
|
||||
$group->pipe = strtoupper($attribs['pipe'] ?? null) ?: 'AND';
|
||||
$result[] = $group;
|
||||
}
|
||||
elseif ($name === 'query')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue