PHP YML file load

http://2x2.great-site.net/PBL.html
The images are not being generated. I’m sure it was working before. I did not change anything in the php code. I think I’m using deprecated php syntax that is not working. I’ve enabled error displaying in the console and I can see this error:

GET [http://2x2.great-site.net/scig/scig.php?desc=pocket/PLL_down&data=RUR] Warning : Undefined array key “debug” in /home/vol11_1/epizy.com/epiz_27863834/htdocs/scig/scig.php on line 70

Warning : Undefined array key “use cache” in /home/vol11_1/epizy.com/epiz_27863834/htdocs/scig/scig.php on line 76

Warning : Undefined array key “width” in /home/vol11_1/epizy.com/epiz_27863834/htdocs/scig/scig.php on line 106
Error: Width is incorrect

I’m using Spyc to load yml files. I think it is not working correctly. Can anyone help me fix this problem?
Thanks

The problem is exactly what the error messages say: certain variables are undefined.

5 Likes

I have updated Spyc package from here:

but it did not fix anything.

The SCIG code is here:

Considering that SCIG is a script last updated in 2013, with the most recent file available for download updated in 2009, this isn’t surprising.
It looks like its maintainer abandoned it, and as it has not been updated in years, it likely isn’t compatible with PHP 8.2.

I’d recommend looking for a new script that has similar functionality.


That being said, can you share the contents of the YML file you are trying to load?

11 Likes

Yes I know that. I’m trying to fix it to support PHP 8.2.

2 Likes

Alright…

6 Likes

Hi robal1991,

It seems like you would like assistance in revamping a library that you used. While this may be a long process quite some changes are necessary. I think you may ask in a per-issue manner / share your current progress potentially using GitHub.

The content of the yml file does not matter here as you simply need to re-code all syntax to align with PHP 8.2.

Let me know if I can be of any assistance.

Cheers!

A quick look, the scope of work only involves 29 PHP files and it turns out it’s quite an interesting tool to study. However, it does not seem there’s a repo that manages this tool to pull and push from other than this website being hosted.

https://scig.sourceforge.net/doc/

I believe it does, or I would not have asked for it to be shared. The script throws an error saying that the width property is missing; that property is loaded from the YML file. Before assuming something is wrong with the script, let’s check the structure of the YML file first.

3 Likes

Hi ChrisPAR,

I have solved that as a part of the library upgrade, the yml file syntax from the original package is problematic (with mixed tabs and spaces here and there) as well as the decoding process not parsing the file correctly (not an assumption, it is what it is). That can be fixed by manually finding and replacing the syntax, replacing spyc will get the yml loading part to work.

Meanwhile, the bigger issue is that scig is very poorly coded in terms of syntax and code structure, therefore when upgrading to PHP8, many bugs occur here and there due to (originally intentional) missing brackets, poor formating syntaxes, etc. In addition, both spyc and xtpl in the includes folder are both outdated from the distribution so I have to manually update those to clear another batch of bugs.

To save time, I have revamped the library just now and cleared all coding obstacles that involve formatting and syntax issues. However I didn’t go in-depth into studying the algorithm for the Rubik’s cube and Pocket cube engines, I intend to let robal1991 resolve that part as he/she might be more familiar with the subject.

This is the latest error message after resolving all items in the php_error.log:
Error: Invalid puzzle state (probably engine error) ((FRU, FRU))


Getting the algorithms to list means that the yml loading part worked as expected, I’ll try to see if I can figure out the algorithm and get the images to generate as well.

Cheers!

6 Likes

Thank you very much for help. I’ve updated the code to PHP 8.2 and fixed formatting in the yml files and updated spyc to newer version. It is now working as before.

Again thanks! :slight_smile:

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.