Finaly one extension that deserves the right to be added to the core. ? ? ?

Good job @Kyrne , an option to clear cache is very usefull.

Thanks.

Potential Issue?

When I clear the cache, then go to enable an extension, a 200 OK error is thrown. The output is:

POST http://localhost/api/extensions/antoinefr-online

<br />
<b>Warning</b>:  file_get_contents(C:\xampp\htdocs\assets\rev-manifest.json): failed to open stream: No such file or directory in <b>C:\xampp\htdocs\vendor\reflar\uncache\src\Jobs\ClearCache.php</b> on line <b>87</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>C:\xampp\htdocs\vendor\reflar\uncache\src\Jobs\ClearCache.php</b> on line <b>89</b><br />
<br />
<b>Warning</b>:  array_values() expects parameter 1 to be array, null given in <b>C:\xampp\htdocs\vendor\reflar\uncache\src\Jobs\ClearCache.php</b> on line <b>97</b><br />
<br />
<b>Fatal error</b>:  Uncaught RuntimeException: Output has been emitted previously; cannot emit response in C:\xampp\htdocs\vendor\zendframework\zend-diactoros\src\Response\SapiEmitterTrait.php:31
Stack trace:
#0 C:\xampp\htdocs\vendor\zendframework\zend-diactoros\src\Response\SapiEmitter.php(27): Zend\Diactoros\Response\SapiEmitter-&gt;assertNoPreviousOutput()
#1 C:\xampp\htdocs\vendor\zendframework\zend-diactoros\src\Server.php(162): Zend\Diactoros\Response\SapiEmitter-&gt;emit(Object(Zend\Stratigility\Http\Response))
#2 C:\xampp\htdocs\vendor\flarum\core\src\Http\AbstractServer.php(36): Zend\Diactoros\Server-&gt;listen(Object(Zend\Stratigility\NoopFinalHandler))
#3 C:\xampp\htdocs\api.php(16): Flarum\Http\AbstractServer-&gt;listen()
#4 {main}
  thrown in <b>C:\xampp\htdocs\vendor\zendframework\zend-diactoros\src\Response\SapiEmitterTrait.php</b> on line <b>31</b><br />

Any ideas? When you refresh the page, the extension has been enabled, but the error makes the user think it hasn't

    Frink You can't clear the cache twice. I'll add another catch for this so it's a more friendly message.

    This sounds so good that it might become a standard feature in Flarum. I would strongly suggest it, at any rate!

    EDIT: I do not see it available for download on Bazaar. Weird.

      Hifihedgehog I believe that this has been fixed for beta8, so this extension will be for beta7. They may transfer it over, because the cloudflare integration is a brilliant idea

      Kyrne I did. Nothing under “Reflar” or “Uncache.” There are, of course, the other Reflar extensions besides Uncache when I search for Reflar in Bazaar’s main listing.

        Ralkage Sorry for the slow reply, but I only see the plug-in in Flagrow’s listing and it is still not in Bazaar.

          This isn't a big deal. It's all an elephant anyway. But, I think this extension may not always work. What I am finding is, the more extensions I install, I just have to clear Chrome's cache and cookies, after I install something for it to 100% work. I can click the clear cache option that comes with this extension, but, that will not make the text/language appear correctly. In order to get things like this.is.coding.type.text to change to Menu Item, for example, (hope this makes sense), clearing Chrome's cache AND cookies, is all that works for me.

          At least doing that works, which is why I say this isn't a big deal.

          19 days later
          2 months later

          0.1.0-beta.3

          • Added Polish language
          • Lowered flarum/core requirement from beta 7.1 to beta 7 so Bazaar doesn't mark it as incompatible

          Updating ⬆

          1. Click the "Clear Cache" button then refresh (This is so much easier than commands right?)

          Please allow Bazaar 60 minutes to pull the update

          2 months later

          When I click clear cache with the cloudflare enabled I get this error in debug:

          POST https://forums.tcpb.com/api/uncache/invalidate

          <br />
          <b>Fatal error</b>: Uncaught Error: Call to undefined method stdClass::toArray() in /ssd/www/tcpb.com/html/flarum/vendor/reflar/uncache/src/Api/Serializers/CloudflareSerializer.php:28
          Stack trace:
          #0 /ssd/www/tcpb.com/html/flarum/vendor/flarum/core/src/Api/Serializer/AbstractSerializer.php(71): Reflar\UnCache\Api\Serializers\CloudflareSerializer-&gt;getDefaultAttributes(Object(stdClass))
          #1 /ssd/www/tcpb.com/html/flarum/vendor/tobscure/json-api/src/Resource.php(169): Flarum\Api\Serializer\AbstractSerializer-&gt;getAttributes(Object(stdClass), NULL)
          #2 /ssd/www/tcpb.com/html/flarum/vendor/tobscure/json-api/src/Resource.php(75): Tobscure\JsonApi\Resource-&gt;getAttributes()
          #3 /ssd/www/tcpb.com/html/flarum/vendor/tobscure/json-api/src/Document.php(181): Tobscure\JsonApi\Resource-&gt;toArray()
          #4 /ssd/www/tcpb.com/html/flarum/vendor/tobscure/json-api/src/Document.php(224): Tobscure\JsonApi\Document-&gt;toArray()
          #5 /ssd/www/tcpb.com/htm in <b>/ssd/www/tcpb.com/html/flarum/vendor/reflar/uncache/src/Api/Serializers/CloudflareSerializer.php</b> on line <b>28</b><br />

          a month later

          Its probably the best flarum extension. Thanks for the beautiful code.

          9 days later

          With the imminent release of beta 8, this extension is in a limbo state. Beta 8 will fix the cache issues caused when enabling a new extension.

          Keeping that in mind, please vote on the following poll:

          Thanks guys!

            MikeJones the main things would be the cloudflare cache clearing, the force cache invalidating for users, and the ability to clear the cache without ssh

            @Kyrne release of beta 8 was inminent since 2017, so... imminent is a dangerous word when we speak about flarum development. With this I do not want to criticize anyone, just use it to highlight the need for one of the best plugins that have been made.

            From your last answer I also read enough features not included in Beta 8 and that are perfect for a plugin.