Helper for drupal_rewrite_settings().
Checks whether this token represents a scalar or NULL.
int $type: The token type @see token_name().
string $value: The value of the token.
bool TRUE if this token represents a scalar or NULL.
function _drupal_rewrite_settings_is_simple($type, $value) {
$is_integer = $type == T_LNUMBER;
$is_float = $type == T_DNUMBER;
$is_string = $type == T_CONSTANT_ENCAPSED_STRING;
$is_boolean_or_null = $type == T_STRING && in_array(strtoupper($value), array(
'TRUE',
'FALSE',
'NULL',
));
return $is_integer || $is_float || $is_string || $is_boolean_or_null;
}