Advanced

Change History

Request new methods needed to make challenge checkers. One method request per thread please.

Message: New Log-method

Changed By: magma1447
Change Date: February 06, 2018 10:14PM

Re: My trail / Cache chainNew Log-method
[quote=arisoft]
While debugging this I really missed the debug log output. Is there any possibility to get the output saved?
[/quote]

To be honest I am not sure how to solve the problem with getting the output from a process that's in an endless loop.

Your web browser is contacting a web server, which starts a PHP process (with LUA support). PHP-FPM is configured to kill the process after X seconds, the output is then lost.

I can currently think of two solutions.
1) Instead of outputting to stdout, write it to a file that can later on be retrieved. Since the LUA-sandbox doesn't have any functions that can read or write from/to disk a new PGC-api-method would have to be created for that purpose.

2) Build a standalone framework. In this case the LUA code would be run on your computer. One of the downsides would be that you have to install an environment for executing LUA. PGC would then need to expose the LUA callbacks as AJAX calls so that they can be fetched from LUA code in some way, probably via a built LUA library. While this has some advantages, it's a lot more work to implement, and has the mentioned downside that the developer would need LUA installed as well.

Of those suggestions I can think of right now, #1 seems easier. I'll get right at trying to implement it. I don't know how hard it will be yet.
Changed By: magma1447
Change Date: February 06, 2018 10:14PM

Re: My trail / Cache chain
[quote=arisoft]
While debugging this I really missed the debug log output. Is there any possibility to get the output saved?
[/quote]

To be honest I am not sure how to solve the problem with getting the output from a process that's in an endless loop.

Your web browser is contacting a web server, which starts a PHP process (with LUA support). PHP-FPM is configured to kill the process after X seconds, the output is then lost.

I can currently think of two solutions.
1) Instead of outputting to stdout, write it to a file that can later on be retrieved. Since the LUA-sandbox doesn't have any functions that can read or write from/to disk a new PGC-api-method would have to be created for that purpose.

2) Build a standalone framework. In this case the LUA code would be run on your computer. One of the downsides would be that you have to install an environment for executing LUA. PGC would then need to expose the LUA callbacks as AJAX calls so that they can be fetched from LUA code in some way, probably via a built LUA library. While this has some advantages, it's a lot more work to implement, and has the mentioned downside that the developer would need LUA installed as well.

Of those suggestions I can think of right now, #1 seems easier. I'll get right at trying to implement it. I don't know how hard it will be yet.

Original Message

Author: magma1447
Date: February 06, 2018 08:49PM

Re: My trail / Cache chain
To be honest I am not sure how to solve the problem with getting the output from a process that's in an endless loop.

Your web browser is contacting a web server, which starts a PHP process (with LUA support). PHP-FPM is configured to kill the process after X seconds, the output is then lost.

I can currently think of two solutions.
1) Instead of outputting to stdout, write it to a file that can later on be retrieved. Since the LUA-sandbox doesn't have any functions that can read or write from/to disk a new PGC-api-method would have to be created for that purpose.

2) Build a standalone framework. In this case the LUA code would be run on your computer. One of the downsides would be that you have to install an environment for executing LUA. PGC would then need to expose the LUA callbacks as AJAX calls so that they can be fetched from LUA code in some way, probably via a built LUA library. While this has some advantages, it's a lot more work to implement, and has the mentioned downside that the developer would need LUA installed as well.

Of those suggestions I can think of right now, #1 seems easier. I'll get right at trying to implement it. I don't know how hard it will be yet.