Skip to content
Permalink
Browse files Browse the repository at this point in the history
chore: update PHP integration to 7.28.1
  • Loading branch information
xripoll-at-wiris committed May 17, 2022
1 parent 3f40f94 commit 037ce9c
Show file tree
Hide file tree
Showing 16 changed files with 4,592 additions and 1,306 deletions.
4,008 changes: 4,008 additions & 0 deletions integration/WIRISplugins.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion integration/lib/VERSION
@@ -1 +1 @@
7.23.0
7.28.1.1443
Expand Up @@ -54,7 +54,7 @@ public function __construct(){}
static $CLEAN_CACHE_GUI = "wiriscleancachegui";
static $imageConfigProperties;
static $imageConfigPropertiesInv;
static $SERVICES_PARAMETERS_LIST = "mml,lang,service,latex,mode";
static $SERVICES_PARAMETERS_LIST = "mml,lang,service,latex,mode,ignoreStyles";
static function computeInverse($dict) {
$keys = $dict->keys();
$outDict = new Hash();
Expand Down
6 changes: 6 additions & 0 deletions integration/lib/com/wiris/system/TypeTools.class.php
Expand Up @@ -30,6 +30,12 @@ static function isArray($o) {
static function isHash($o) {
return Std::is($o, _hx_qtype("Hash"));
}
static function isBool($o) {
return Std::is($o, _hx_qtype("Bool"));
}
static function toBool($o) {
return (($o) ? true : false);
}
static function string2ByteData_iso8859_1($str) {
return haxe_io_Bytes::ofString($str);
}
Expand Down
13 changes: 13 additions & 0 deletions integration/lib/com/wiris/system/Utf8.class.php
Expand Up @@ -9,6 +9,19 @@ static function getLength($s) {
static function charCodeAt($s, $i) {
return haxe_Utf8::charCodeAt($s, $i);
}
static function mbSubstring($s, $i, $len) {
return mb_substr($s, $i, $len);
}
static function charValueAt($s, $i) {
$ret = 0;
$charUCS4 = mb_convert_encoding(mb_substr($s, $i, 1), 'UCS-4BE', 'UTF-8');
$byte1 = ord(substr($charUCS4, 0, 1));
$byte2 = ord(substr($charUCS4, 1, 1));
$byte3 = ord(substr($charUCS4, 2, 1));
$byte4 = ord(substr($charUCS4, 3, 1));
$ret = ($byte1 << 32) + ($byte2 << 16) + ($byte3 << 8) + $byte4;
return $ret;
}
static function charAt($s, $i) {
return com_wiris_system_Utf8_0($i, $s);
}
Expand Down
285 changes: 16 additions & 269 deletions integration/lib/com/wiris/util/json/JSon.class.php
@@ -1,10 +1,9 @@
<?php

class com_wiris_util_json_JSon extends com_wiris_util_json_StringParser {
class com_wiris_util_json_JSon {
public function __construct() {
if(!php_Boot::$skip_constructor) {
parent::__construct();
}}
;
}
public function newLine($depth, $sb) {
$sb->add("\x0D\x0A");
$i = null;
Expand All @@ -21,195 +20,6 @@ public function newLine($depth, $sb) {
public function setAddNewLines($addNewLines) {
$this->addNewLines = $addNewLines;
}
public function decodeArray() {
$v = new _hx_array(array());
$this->nextToken();
$this->skipBlanks();
if($this->c === 93) {
$this->nextToken();
return $v;
}
while($this->c !== 93) {
$o = $this->localDecode();
$v->push($o);
$this->skipBlanks();
if($this->c === 44) {
$this->nextToken();
$this->skipBlanks();
} else {
if($this->c !== 93) {
throw new HException("Expected ',' or ']'.");
}
}
unset($o);
}
$this->nextToken();
return $v;
}
public function decodeHash() {
$h = new Hash();
$this->nextToken();
$this->skipBlanks();
if($this->c === 125) {
$this->nextToken();
return $h;
}
while($this->c !== 125) {
$key = $this->decodeString();
$this->skipBlanks();
if($this->c !== 58) {
throw new HException("Expected ':'.");
}
$this->nextToken();
$this->skipBlanks();
$o = $this->localDecode();
$h->set($key, $o);
$this->skipBlanks();
if($this->c === 44) {
$this->nextToken();
$this->skipBlanks();
} else {
if($this->c !== 125) {
throw new HException("Expected ',' or '}'. " . $this->getPositionRepresentation());
}
}
unset($o,$key);
}
$this->nextToken();
return $h;
}
public function decodeNumber() {
$sb = new StringBuf();
$hex = false;
$floating = false;
do {
$sb->add(com_wiris_util_json_JSon_0($this, $floating, $hex, $sb));
$this->nextToken();
if($this->c === 120) {
$hex = true;
$sb->add(com_wiris_util_json_JSon_1($this, $floating, $hex, $sb));
$this->nextToken();
}
if($this->c === 46 || $this->c === 69 || $this->c === 101) {
$floating = true;
}
} while($this->c >= 48 && $this->c <= 58 || $hex && $this->isHexDigit($this->c) || $floating && ($this->c === 46 || $this->c === 69 || $this->c === 101 || $this->c === 43 || $this->c === 45));
if($floating) {
return Std::parseFloat($sb->b);
} else {
return Std::parseInt($sb->b);
}
}
public function decodeString() {
$sb = new StringBuf();
$d = $this->c;
$this->nextToken();
while($this->c !== $d) {
if($this->c === 92) {
$this->nextToken();
if($this->c === 110) {
$sb->add("\x0A");
} else {
if($this->c === 114) {
$sb->add("\x0D");
} else {
if($this->c === 34) {
$sb->add("\"");
} else {
if($this->c === 39) {
$sb->add("'");
} else {
if($this->c === 116) {
$sb->add("\x09");
} else {
if($this->c === 92) {
$sb->add("\\");
} else {
if($this->c === 117) {
$this->nextToken();
$code = com_wiris_util_json_JSon_2($this, $d, $sb);
$this->nextToken();
$code .= com_wiris_util_json_JSon_3($this, $code, $d, $sb);
$this->nextToken();
$code .= com_wiris_util_json_JSon_4($this, $code, $d, $sb);
$this->nextToken();
$code .= com_wiris_util_json_JSon_5($this, $code, $d, $sb);
$dec = Std::parseInt("0x" . $code);
$sb->add(com_wiris_util_json_JSon_6($this, $code, $d, $dec, $sb));
unset($dec,$code);
} else {
throw new HException("Unknown scape sequence '\\" . com_wiris_util_json_JSon_7($this, $d, $sb) . "'");
}
}
}
}
}
}
}
} else {
$sb->add(com_wiris_util_json_JSon_8($this, $d, $sb));
}
$this->nextToken();
}
$this->nextToken();
return $sb->b;
}
public function decodeBooleanOrNull() {
$sb = new StringBuf();
while(com_wiris_util_xml_WCharacterBase::isLetter($this->c)) {
$sb->b .= chr($this->c);
$this->nextToken();
}
$word = $sb->b;
if($word === "true") {
return true;
} else {
if($word === "false") {
return false;
} else {
if($word === "null") {
return null;
} else {
throw new HException("Unrecognized keyword \"" . $word . "\".");
}
}
}
}
public function localDecode() {
$this->skipBlanks();
if($this->c === 123) {
return $this->decodeHash();
} else {
if($this->c === 91) {
return $this->decodeArray();
} else {
if($this->c === 34) {
return $this->decodeString();
} else {
if($this->c === 39) {
return $this->decodeString();
} else {
if($this->c === 45 || $this->c >= 48 && $this->c <= 58) {
return $this->decodeNumber();
} else {
if($this->c === 116 || $this->c === 102 || $this->c === 110) {
return $this->decodeBooleanOrNull();
} else {
throw new HException("Unrecognized char " . _hx_string_rec($this->c, ""));
}
}
}
}
}
}
}
public function localDecodeString($str) {
$this->init($str);
return $this->localDecode();
}
public function encodeIntegerFormat($sb, $i) {
$sb->add($i->toString());
}
public function encodeLong($sb, $i) {
$sb->add("" . Std::string($i));
}
Expand Down Expand Up @@ -361,17 +171,13 @@ public function encodeImpl($sb, $o) {
if(Std::is($o, _hx_qtype("haxe.Int64"))) {
$this->encodeLong($sb, $o);
} else {
if(Std::is($o, _hx_qtype("com.wiris.util.json.JSonIntegerFormat"))) {
$this->encodeIntegerFormat($sb, $o);
if(com_wiris_system_TypeTools::isBool($o)) {
$this->encodeBoolean($sb, com_wiris_system_TypeTools::toBool($o));
} else {
if(Std::is($o, _hx_qtype("Bool"))) {
$this->encodeBoolean($sb, $o);
if(Std::is($o, _hx_qtype("Float"))) {
$this->encodeFloat($sb, $o);
} else {
if(Std::is($o, _hx_qtype("Float"))) {
$this->encodeFloat($sb, $o);
} else {
throw new HException("Impossible to convert to json object of type " . Std::string(Type::getClass($o)));
}
throw new HException("Impossible to convert to json object of type " . Std::string(Type::getClass($o)));
}
}
}
Expand Down Expand Up @@ -403,15 +209,19 @@ public function __call($m, $a) {
else
throw new HException('Unable to call «'.$m.'»');
}
static function sb() { $»args = func_get_args(); return call_user_func_array(self::$sb, $»args); }
static $sb;
static function encode($o) {
$js = new com_wiris_util_json_JSon();
return $js->encodeObject($o);
}
static function decode($str) {
$json = new com_wiris_util_json_JSon();
return $json->localDecodeString($str);
try {
return com_wiris_util_json_parser_JsonParse::parse($str);
}catch(Exception $»e) {
$_ex_ = ($»e instanceof HException) ? $»e->e : $»e;
if(($e = $_ex_) instanceof com_wiris_system_Exception){
throw new HException($e->getMessage());
} else throw $»e;;
}
}
static function getDepth($o) {
if(com_wiris_system_TypeTools::isHash($o)) {
Expand Down Expand Up @@ -502,66 +312,3 @@ static function isJson($json) {
}
function __toString() { return 'com.wiris.util.json.JSon'; }
}
function com_wiris_util_json_JSon_0(&$»this, &$floating, &$hex, &$sb) {
{
$s = new haxe_Utf8(null);
$s->addChar($»this->c);
return $s->toString();
}
}
function com_wiris_util_json_JSon_1(&$»this, &$floating, &$hex, &$sb) {
{
$s = new haxe_Utf8(null);
$s->addChar($»this->c);
return $s->toString();
}
}
function com_wiris_util_json_JSon_2(&$»this, &$d, &$sb) {
{
$s = new haxe_Utf8(null);
$s->addChar($»this->c);
return $s->toString();
}
}
function com_wiris_util_json_JSon_3(&$»this, &$code, &$d, &$sb) {
{
$s = new haxe_Utf8(null);
$s->addChar($»this->c);
return $s->toString();
}
}
function com_wiris_util_json_JSon_4(&$»this, &$code, &$d, &$sb) {
{
$s = new haxe_Utf8(null);
$s->addChar($»this->c);
return $s->toString();
}
}
function com_wiris_util_json_JSon_5(&$»this, &$code, &$d, &$sb) {
{
$s = new haxe_Utf8(null);
$s->addChar($»this->c);
return $s->toString();
}
}
function com_wiris_util_json_JSon_6(&$»this, &$code, &$d, &$dec, &$sb) {
{
$s = new haxe_Utf8(null);
$s->addChar($dec);
return $s->toString();
}
}
function com_wiris_util_json_JSon_7(&$»this, &$d, &$sb) {
{
$s = new haxe_Utf8(null);
$s->addChar($»this->c);
return $s->toString();
}
}
function com_wiris_util_json_JSon_8(&$»this, &$d, &$sb) {
{
$s = new haxe_Utf8(null);
$s->addChar($»this->c);
return $s->toString();
}
}

0 comments on commit 037ce9c

Please sign in to comment.