sportsmanager 2.0 changes merge result

This commit is contained in:
Paul Fleischanderl
2025-02-28 17:13:35 +01:00
parent 5a25f6d398
commit fbdcfacb21
12 changed files with 3214 additions and 6516 deletions
@@ -308,9 +308,9 @@ class MathParser
$this->StringLiteralsAllowed = $value;
if($value==true){
if($this->StrConcatOperator=='&'){
$this->AndOp = new Mathparser_ParserFunction('&', mp_and_str_, 2);
$this->AndOp = new Mathparser_ParserFunction('&', 'mp_and_str_', 2);
}else if ($this->StrConcatOperator=='+'){
$this->AddOp = new Mathparser_ParserFunction('+', mp_add_str_, 2);
$this->AddOp = new Mathparser_ParserFunction('+', 'mp_add_str_', 2);
}else{
throw new Exception('Invalid string concat operator: '.$this->StrConcatOperator);
}
@@ -339,18 +339,18 @@ class MathParser
$this->StrConcatOperator=$value;
if($value=='&'){
if($this->StringLiteralsAllowed){
$this->AndOp = new Mathparser_ParserFunction('&', mp_and_str_, 2);
$this->AndOp = new Mathparser_ParserFunction('&', 'mp_and_str_', 2);
$this->AddOp = self::$add__;
}else{
$this->AddOp = new Mathparser_ParserFunction('+', mp_add_str_, 2);
$this->AddOp = new Mathparser_ParserFunction('+', 'mp_add_str_', 2);
$this->AndOp = self::$and__;
}
}else if ($value=='+'){
if($this->StringLiteralsAllowed){
$this->AddOp = new Mathparser_ParserFunction('+', mp_add_str_, 2);
$this->AddOp = new Mathparser_ParserFunction('+', 'mp_add_str_', 2);
$this->AndOp = self::$and__;
}else{
$this->AndOp = new Mathparser_ParserFunction('&', mp_and_str_, 2);
$this->AndOp = new Mathparser_ParserFunction('&', 'mp_and_str_', 2);
$this->AddOp = self::$add__;
}
}else{
@@ -404,26 +404,26 @@ class MathParser
$this->createDefaultVars();
if(!isset(self::$add__)){
self::$add__ = new Mathparser_ParserFunction('+', mp_add_, 2);
self::$subtract__ = new Mathparser_ParserFunction('-', mp_subtract_, 2);
self::$mult__ = new Mathparser_ParserFunction('*', mp_mult_, 2);
self::$div__ = new Mathparser_ParserFunction('/', mp_div_, 2);
self::$power__ = new Mathparser_ParserFunction('/', mp_power_, 2);
self::$mod__ = new Mathparser_ParserFunction('/', mp_mod_, 2);
self::$add__ = new Mathparser_ParserFunction('+', 'mp_add_', 2);
self::$subtract__ = new Mathparser_ParserFunction('-', 'mp_subtract_', 2);
self::$mult__ = new Mathparser_ParserFunction('*', 'mp_mult_', 2);
self::$div__ = new Mathparser_ParserFunction('/', 'mp_div_', 2);
self::$power__ = new Mathparser_ParserFunction('/', 'mp_power_', 2);
self::$mod__ = new Mathparser_ParserFunction('/', 'mp_mod_', 2);
self::$notequals__ = new Mathparser_ParserFunction('!=', mp_notequals_, 2);
self::$equals__ = new Mathparser_ParserFunction('=', mp_equals_, 2);
self::$lt__ = new Mathparser_ParserFunction('<', mp_ltequals_, 2);
self::$gt__ = new Mathparser_ParserFunction('>', mp_gtequals_, 2);
self::$ltequals__ = new Mathparser_ParserFunction('<=', mp_ltequals_, 2);
self::$gtequals__ = new Mathparser_ParserFunction('>=', mp_gtequals_, 2);
self::$notequals__ = new Mathparser_ParserFunction('!=', 'mp_notequals_', 2);
self::$equals__ = new Mathparser_ParserFunction('=', 'mp_equals_', 2);
self::$lt__ = new Mathparser_ParserFunction('<', 'mp_ltequals_', 2);
self::$gt__ = new Mathparser_ParserFunction('>', 'mp_gtequals_', 2);
self::$ltequals__ = new Mathparser_ParserFunction('<=', 'mp_ltequals_', 2);
self::$gtequals__ = new Mathparser_ParserFunction('>=', 'mp_gtequals_', 2);
self::$unaryadd__ = new Mathparser_ParserFunction('+', mp_unaryadd_, 1);
self::$negate__ = new Mathparser_ParserFunction('-', mp_negate_, 1);
self::$not__ = new Mathparser_ParserFunction('!', mp_not_, 1);
self::$unaryadd__ = new Mathparser_ParserFunction('+', 'mp_unaryadd_', 1);
self::$negate__ = new Mathparser_ParserFunction('-', 'mp_negate_', 1);
self::$not__ = new Mathparser_ParserFunction('!', 'mp_not_', 1);
self::$and__ = new Mathparser_ParserFunction('&', mp_and_, 2);
self::$or__ = new Mathparser_ParserFunction('|', mp_or_, 2);
self::$and__ = new Mathparser_ParserFunction('&', 'mp_and_', 2);
self::$or__ = new Mathparser_ParserFunction('|', 'mp_or_', 2);
}
$this->AddOp = self::$add__;
@@ -442,7 +442,7 @@ class MathParser
* may contain placeholder parameters using %s.
* @return array
*/
public function &getTranslationStrings()
public static function &getTranslationStrings()
{
if(!isset(self::$translator))
{
@@ -640,7 +640,7 @@ class MathParser
throw new Mathparser_ParserException($this->getMessage2("BrcktMis", $formula, $brackets), substr($formula, $brackets), $formula);
}
else
if($brackets==len)
if($brackets=='len')
{
throw new Mathparser_ParserException($this->getMessage1("MisBrckt", $formula), $formula, $formula);
}
@@ -876,45 +876,45 @@ class MathParser
*/
public function createDefaultFuncs()
{
$this->createFunc("SQR", mp_square_, 1);
$this->createFunc("SIN", sin, 1);
$this->createFunc("COS", cos, 1);
$this->createFunc("ATAN", atan, 1);
$this->createFunc("SINH", sinh, 1);
$this->createFunc("COSH", cosh, 1);
$this->createFunc("COTAN", mp_cotan_, 1);
$this->createFunc("TAN", tan, 1);
$this->createFunc("EXP", exp, 1);
$this->createFunc("LN", log, 1);
$this->createFunc("LOG", log10, 1);
$this->createFunc("SQRT", sqrt, 1);
$this->createFunc("ABS", abs, 1);
$this->createFunc("SIGN", mp_sign_, 1);
$this->createFunc("TRUNC", mp_trunc_, 1);
$this->createFunc("CEIL", ceil, 1);
$this->createFunc("FLOOR", floor, 1);
$this->createFunc("RND", mp_rand_, 0);
$this->createFunc("VAL", mp_float_, 1);
$this->createFunc("SQR", 'mp_square_', 1);
$this->createFunc("SIN", 'sin', 1);
$this->createFunc("COS", 'cos', 1);
$this->createFunc("ATAN", 'atan', 1);
$this->createFunc("SINH", 'sinh', 1);
$this->createFunc("COSH", 'cosh', 1);
$this->createFunc("COTAN", 'mp_cotan_', 1);
$this->createFunc("TAN", 'tan', 1);
$this->createFunc("EXP", 'exp', 1);
$this->createFunc("LN", 'log', 1);
$this->createFunc("LOG", 'log10', 1);
$this->createFunc("SQRT", 'sqrt', 1);
$this->createFunc("ABS", 'abs', 1);
$this->createFunc("SIGN", 'mp_sign_', 1);
$this->createFunc("TRUNC", 'mp_trunc_', 1);
$this->createFunc("CEIL", 'ceil', 1);
$this->createFunc("FLOOR", 'floor', 1);
$this->createFunc("RND", 'mp_rand_', 0);
$this->createFunc("VAL", 'mp_float_', 1);
$this->createFunc("POW", pow, 2);
$this->createFunc("LOGN", mp_logn_, 2);
$this->createFunc("MIN", mp_min_, -1);
$this->createFunc("MAX", mp_max_, -1);
$this->createFunc("MOD", modulo, 2);
$this->createFunc("POW", 'pow', 2);
$this->createFunc("LOGN", 'mp_logn_', 2);
$this->createFunc("MIN", 'mp_min_', -1);
$this->createFunc("MAX", 'mp_max_', -1);
$this->createFunc("MOD", 'modulo', 2);
$this->createFunc("IF", if_, 3);
$this->createFunc("IF", 'if_', 3);
$this->createFunc("STRLEN", strlen, 1);
$this->createFunc("STR", strval,1);
$this->createFunc("SUBSTR", substr,3);
$this->createFunc("CONCAT", mp_concat_,-1);
$this->createFunc("TRIM", trim,1);
$this->createFunc("RTRIM", rtrim,1);
$this->createFunc("LTRIM", ltrim,1);
$this->createFunc("CHR", chr,1);
$this->createFunc("NUM", mp_num_,1);
$this->createFunc("STRLEN", 'strlen', 1);
$this->createFunc("STR", 'strval',1);
$this->createFunc("SUBSTR", 'substr',3);
$this->createFunc("CONCAT", 'mp_concat_',-1);
$this->createFunc("TRIM", 'trim',1);
$this->createFunc("RTRIM", 'rtrim',1);
$this->createFunc("LTRIM", 'ltrim',1);
$this->createFunc("CHR", 'chr',1);
$this->createFunc("NUM", 'mp_num_',1);
$this->createFunc("SUM", sum_, -1);
$this->createFunc("SUM", 'sum_', -1);
}
@@ -1247,7 +1247,7 @@ class MathParser
$len = strlen($name);
for ($i=0; $i<$len; $i++)
{
if(!$this->isValidChar($i, $name[i]))
if(!$this->isValidChar($i, $name[$i]))
{
return false;
}