gordon-matt / peachpie-responsive-file-manager

Responsive File Manager running on .NET Core with Peachpie
24 stars 16 forks source link

updates to peachpie 0.9.800 and aspnetcore3.0 #8

Closed jakubmisek closed 4 years ago

jakubmisek commented 4 years ago

rough update to latest versions

gordon-matt commented 4 years ago

Nice. Thank you.

gordon-matt commented 4 years ago

@jakubmisek Actually this is now giving an error as follows: Pchp.Core.ScriptDiedException: '255'

This happens when trying to upload a very small image file. Please try and see. Also, FYI: I added a new commit to swap Bower for Libman.

Would appreciate your assistance in fixing whatever this new error is. Thanks in advance.

jakubmisek commented 4 years ago

You can ignore ScriptDiedException (https://docs.peachpie.io/api/ref/scriptdiedexception/) and continue. This is handled exception that is thrown in response to exit PHP command.

gordon-matt commented 4 years ago

@jakubmisek Thanks for the response. There are 2 things I'd like to note here:

  1. It's not just that error. If I ignore it, the file manager is still not behaving right and without any error, so I am not sure yet what the other problem(s) could be. I may have to revert the changes.

  2. Regarding the ScriptDiedException, I think there should be some Peachpie option we can configure to ignore the exit commands (not throw exception).. because there are cases (like this case) where the PHP code is third party. It's not convenient to find and remove all exit statements. I suggest something like this:

app.UsePhp(new PhpRequestOptions(scriptAssemblyName: "ResponsiveFileManager")
{
    ThrowExceptionOnExitStatements = false,
    //etc

What do you think?

jakubmisek commented 4 years ago
  1. is there any warning or notice in Visual Studio Output panel ?

  2. nope, just ignore the exception, keep exit and die commands in place. The exception is vital for the code and is thrown by purpose. It is handled and program continues normally.

The exception is there by design.

gordon-matt commented 4 years ago

What exactly do you mean by "ignore"? Sorry if it's a stupid question.. but this is new.. it did not happen before with the old version and I don't know how to ignore it as you say.. except by hitting continue in Visual Studio while debugging.. how would I ignore it during runtime?

jakubmisek commented 4 years ago

Right, just continue in Visual Studio.

ScriptDiedException is thrown to terminate the request and then safely handled in the asp.net core request handler.

To ignore it just untick it so it won't break debugging image

gordon-matt commented 4 years ago

Whoops! It appears I was mistaken. The error was happening due to a missing folder: \WebApplication\wwwroot\Media\Uploads. Once I created that, everything was working. So my apologies for that.

Regarding the exceptions on exit though.. I am not concerned with the developer environment. I was concerned there would be a problem in production. Anyway, nevermind.. like you said: it is there by design.

Thank you for your time.

And FYI: I have also updated it to .NET Core 3.1 and PeachPie 0.9.900. I will commit the code soon and deploy a new NuGet package.

jakubmisek commented 4 years ago

Good! if PHP behaves differently and creates the Upload folder, we should fix that in PeachPie. But I think PHP does not create the folder as well.

Yep, the ScriptDiedException is handled and does not cause any troubles in production. I understand it is confusing, but it was the only way to terminate the program on die; instantly :)