jakubmisek on v1.0.0-preview6
jakubmisek on master
runtime: phpstring fixes (compare)
jakubmisek on master
runtime: ArrayUtils runtime: phpstring glues single… (compare)
jakubmisek on master
StructBox`1 IEquatable ref htt… (compare)
jakubmisek on master
dynamic: StructBox`1 handled in… (compare)
__destruct
is not called deterministically. I think the destruct is called after laravel resets itself for the next test and then fails because its not in the state the original test expected, I'll keep looking into this to see if this is actually the case though (I can't really reproduce this easily, I'll probably disable the __destruct
for now)
The following psuedo-code is what happens as far as I can tell:
SetupLaravelApplication();
{ // create new scope
$obj = new Command();
}
DestroyLaravelApplication();
In PHP $obj is destroyed at the end of the scope, in C# its destroyed whenever (and from another thread (the finalizer thread)?) so that causes some problems
SetupLaravelApplication();
try { obj = new Command(); }
finally { obj?.Dispose(); }
DestroyLaravelApplication();
BTW sadly, PHP does not have code scopes, only local and global. So it destroys its local variables on the very end of the function block (as I remember)
seems to be correct. It only calls destruct at the end of the function (or when I dereference the last value, for example $obj = new TestClass(); $obj = new TestClass2();
, TestClass destruct will be called here)
Request-Context
header because AppInsights adds one to every response before wpdotnet then adds the one from the original caching request
if (header.Key != "Request-Context") {}
around the re-adding mechanism when serving a cached response
async Task WriteResponse(HttpContext context, CachedPage page)
{
foreach (var header in page.Headers)
{
if (header.Key != "Request-Context")
{
context.Response.Headers.Add(header);
}
}
await context.Response.Body.WriteAsync(page.Content, 0, page.Content.Length);
}
^^^^ From my edited copy of PeachPied.WordPress.AspNetCore/Internal/WpResponseCaching.cs
Hi Guys,
first of all, it's a really great project and I'm already able to build wordpress with some plugins :-) Just some questions (i hope this is OK in this chatroom):
Is there any option to compile wordpress plugins directly from the wordpress folder (like themes, without create a separate plugin and reference it), the idea here is that I want to be able to create a compiled assembly from a "normal" Wordpress installation and check if plugins will work) ? I've tried to simply copy some plugins to that folder, it also seems to get compiled but I dont see them in installed plugins.
You write in the Wiki that e.g. elementor is supported, I've also get it compiled but it dont run in debug mode (throw exceptions because of Logging) and in release mode it runs but I'm not able to use it (type error on save) - Did you manage this plugin differently (in terms of compiling), and if so, is there any repository for it ?
@_LORDofDOOM__twitter
/wp-content/plugins/your-plugins/your-plugin.php
file. If it's not there, it won't list the plugin in the dashboard. We're workarouding it by copying this plugin source file into the content. (see https://github.com/iolevel/wpdotnet-sdk/blob/a8c0e9cdccf2e229b8dd1da6bd195b68396f5934/wordpress/PeachPied.WordPress.msbuildproj#L16 where we do it for all .jpg, .css, .js, ..etc.)BTW that's why we have prepared https://github.com/iolevel/peachpie-wordpress where you use already compiled wordpress and just add your plugins and themes. The project is ready for that.
@jakubmisek Thanks you for your fast answer :-)
My question was more like if I'm able to compile a already prepared wordpress installation.
So if I recompile and have plugins into https://github.com/iolevel/wpdotnet-sdk/tree/master/wordpress/wp-content/plugins folder netcore will compile this files. Possibly I'm wrong, but if I copy files to the https://github.com/iolevel/wpdotnet-sdk/tree/master/wordpress/wp-content/themes folder the functions of the theme are working as expected, so in it's base thats the same thing as for a plugin, but the plugins dont get recognized (but they are getting compiled and also copy as content in output folder, so they should work). This would be pretty helpful to just try out some plugins without the creation of a external assembly and even to resolve references between plugins, so this is my next question :-)
I'm also not really sure how cross references are currently handled. If for example a plugin check if woocommerce exists and want to include it to show different options, is this handled ? Because on compile time it should not know about the existence of woocommerce. Or do I need to add additional reference into the plugin to woocommerce ?
Yes, I've read the Wiki and I've tried to compile elementor in release and debug mode (multiple versions, also the newest one 2.7.3), in debug mode it compile but throw exceptions because of missing classes (seems to be something in Logger class) and in release mode it loads normally but I cant add e.g. a image (type error on aspnetcore side on save)
@_LORDofDOOM__twitter regarding the bugs with Elementor - that's totally possible, lots of things have changed in PeachPie since we last tested it and who knows what changed in Elementor itself. I definitely didn't get an exception back when I tried about missing classes, so they might have added something. It would be really great if you could submit these exceptions in issues with some detailed info (stack trace, how to reproduce or something like that) and we'll take a look at them. The adding an image definitely sounds like a bug on our side.
Regarding the first part of your question, I'll leave that up to @jakubmisek .