Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Помогите с проблемой #9

Closed
airgroup-tech opened this issue Jul 22, 2024 · 4 comments
Closed

Помогите с проблемой #9

airgroup-tech opened this issue Jul 22, 2024 · 4 comments

Comments

@airgroup-tech
Copy link

Начал делать проект в среде, и столкнулся с проблемой:

Fatal error: Uncaught exception 'php\lang\JavaException' with message 'java.lang.ArrayIndexOutOfBoundsException: 1072' in res://textboxs/modules/MainModule.php on line 804, position 19
Stack Trace:
#0 {closure}() called at [res://script/MacroScript.php:107]
#1 script\MacroScript->call() called at [res://script/MacroScript.php:102]
#2 php\gui\framework\AbstractScript->trigger() called at [res://script/MacroScript.php:68]
#3 textboxs\modules\MainModule->doSaveFileAction() called at [res://php/gui/framework/AbstractScript.php:156]
#4 textboxs\modules\MainModule::setData() called at [res://textboxs/modules/MainModule.php:804]
#5 {main}
thrown in res://textboxs/modules/MainModule.php on line 804

Вот JVM Stack:

JVM Stack trace:
javax.xml.bind.DatatypeConverterImpl.guessLength(DatatypeConverterImpl.java:659)
javax.xml.bind.DatatypeConverterImpl._parseBase64Binary(DatatypeConverterImpl.java:692)
javax.xml.bind.DatatypeConverterImpl.parseBase64Binary(DatatypeConverterImpl.java:434)
javax.xml.bind.DatatypeConverter.parseBase64Binary(DatatypeConverter.java:342)
org.develnext.jphp.zend.ext.standard.StringFunctions.base64_decode(StringFunctions.java:2863)
textboxs\modules\MainModule.setData(res://textboxs/modules/MainModule.php:53)
java.lang.reflect.Method.invoke(Method.java:498)
php.runtime.reflection.MethodEntity.invokeDynamic(MethodEntity.java:239)
php.runtime.reflection.MethodEntity.invokeStatic(MethodEntity.java:252)
php.runtime.invoke.InvokeHelper.callStatic(InvokeHelper.java:376)
textboxs\modules\MainModule.doSaveFileAction(res://textboxs/modules/MainModule.php:800)
java.lang.reflect.Method.invoke(Method.java:498)
php.runtime.reflection.MethodEntity.invokeDynamic(MethodEntity.java:239)
php.runtime.invoke.ObjectInvokeHelper.invokeMethod(ObjectInvokeHelper.java:215)
php.runtime.invoke.InvokeHelper.callAny(InvokeHelper.java:118)
php\gui\framework\AbstractScript.trigger(res://php/gui/framework/AbstractScript.php:141)
java.lang.reflect.Method.invoke(Method.java:498)
php.runtime.reflection.MethodEntity.invokeDynamic(MethodEntity.java:239)
php.runtime.invoke.ObjectInvokeHelper.invokeMethod(ObjectInvokeHelper.java:215)
script\MacroScript.call(res://script/MacroScript.php:60)
java.lang.reflect.Method.invoke(Method.java:498)
php.runtime.reflection.MethodEntity.invokeDynamic(MethodEntity.java:239)
php.runtime.invoke.ObjectInvokeHelper.invokeMethod(ObjectInvokeHelper.java:215)
(res://script/MacroScript.php:101)
java.lang.reflect.Method.invoke(Method.java:498)
php.runtime.reflection.MethodEntity.invokeDynamic(MethodEntity.java:239)
php.runtime.invoke.ObjectInvokeHelper.invokeMethod(ObjectInvokeHelper.java:275)
php.runtime.invoke.DynamicMethodInvoker.invoke(DynamicMethodInvoker.java:57)
php.runtime.invoke.Invoker.call(Invoker.java:76)
php.runtime.invoke.Invoker.callNoThrow(Invoker.java:111)
php.runtime.ext.core.classes.WrapThread$1.run(WrapThread.java:85)
java.lang.Thread.run(Thread.java:745)

И само собой, код:
`global $login, $dir, $select, $files, $number1;

    $object = $number1 + $select - 1;
    $tmp = $files[$object - 1];
    Logger::debug('Object: ' . $object);
    $name = str::split($tmp, ',')[2];
    
    global $font, $bold, $italic, $size, $text;
    
    uiLaterAndWait(function (){
       global $font, $bold, $italic, $size, $text;
       $font = $this->MText->font->family;
       $bold = $this->MText->font->bold;
       $italic = $this->MText->font->italic;
       $size = $this->MText->font->size; 
       $text = $this->MText->text;
    });
    
    $style = '';
    
    if ($bold == true) $style = $style . 'B';
    if ($italic == true) $style = $style . 'I';
    if ($style == '') $style = 'R';
    
    MainModule::setData('./tmp/data.aft', 'Info', 'Font', $font);
    MainModule::setData('./tmp/data.aft', 'Info', 'Style', $style);
    MainModule::setData('./tmp/data.aft', 'Info', 'Size', $size);
    MainModule::setData('./tmp/data.aft', 'Data', 'Text', $text);
    
    $data = file_get_contents('./tmp/data.aft');
    $data = base64_decode($data);
    $data = str_split($data, 10);
    
    Logger::debug('Start' . count($data));
    
    for ($i = 0; $i < count($data); $i++){
        Logger::debug('Wait ' . $i);
        
        if ($i == 1) $return = MainModule::getStream('filesmanager/setData.php', 'login=' . urlencode($login) . '&dir=' . urlencode($dir) . '&name=' . urlencode($name) . '&data=' . urlencode($data[$i]) . '&set=' . urlencode('true'));
        else $return = MainModule::getStream('filesmanager/setData.php', 'login=' . urlencode($login) . '&dir=' . urlencode($dir) . '&name=' . urlencode($name) . '&data=' . urlencode($data[$i]) . '&set=' . urlencode('false'));
        
        if ($return == 'no user'){
            Logger::debug('Error ' . $i);
            MainModule::dumpError($return, 'MainModule::saveFile');
            uiLaterAndWait(function (){
                UXDialog::showAndWait('Произошла ошибка!' . "\n" . 'Возможно во время авторизации произошла ошибка, попробуйте еще раз войти в свой аккаунт', 'ERROR');
            });
            break;
        }else if ($return == 'ok'){
            Logger::debug('OK ' . $i);
        }else{
            Logger::debug('Error ' . $i);
            MainModule::dumpError($return, 'MainModule::saveFile');
            uiLaterAndWait(function (){
                UXDialog::showAndWait('Произошла ошибка', 'ERROR');
            });
            break;
        }
    }
    
    uiLaterAndWait(function (){
        $this->hidePreloader();
    });`
@airgroup-tech
Copy link
Author

Проблема решена

1 similar comment
@airgroup-tech
Copy link
Author

Проблема решена

@airgroup-tech
Copy link
Author

Проблема решена

@airgroup-tech airgroup-tech closed this as not planned Won't fix, can't repro, duplicate, stale Jul 22, 2024
@TrueS1gma
Copy link
Owner

Здравствуйте!

Приглашаем вас присоединиться к нашему Discord-серверу для решения любых вопросов и проблем. Вот ссылка: https://discord.gg/ErBRtcun7W

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants