Sorry, we don't support your browser.  Install a modern browser
This post is closed.

Option to disable Kirby's helper functions#369

Laravel Forge & Laravel Homestead (potentially other hosted panels for VPS, for instance Ploi on some servers) started installing & configuring Swoole as a reactive PHP module. Swoole uses a function called go() as one of their main called functions, and this makes Kirby fail on these servers.

It would be nice to:

  • note this down in the docs: “If you can’t run with error about redeclaring function go(), disable swoole here and here…”
  • potentially making another alias to go - redirect() makes sense, and wrapping both in a function_exists check, and let the developers to make the choice.
2 years ago

i created a issue at github similar to this idea-ticket once but it seemed to got “lost” or moved. afaik the go helper is used internally by kirby only once.

i also think it would be a plus if kirby would play nice with these setups instead of insisting it owns “go()” and just crash and burn if not.

2 years ago

Well any of the https://getkirby.com/docs/reference/templates/helpers helpers could potentionaly clash. I think they should be only used in userspace right? And thus should be possible to not load them if user doesn’t want to.

2 years ago

@bnomei We have moved your issue to our internal backlog repo. We also have this issue with some ideas for a plan forward: https://github.com/getkirby/kirby/issues/3062
Feedback is well appreciated. :)

2 years ago

@Lukas Bestle that issue seems to have moved to a private repo, but if I remember correctly, there was an issue with two possible pain points:

  • internal use of the helpers
  • problems if users have a collision between Kirby helpers and other global functions

Imo: core should not use the global helpers at all, but rather the class functions those helpers wrap, always. As for user space collisions: I think the onus of knowing what global functions belong to where is on users, specifically those “advanced” enough to pull other stuff in.

I have no view into support tickets, so maybe that generates a problem for you at the intersection of “knows how to composer require” and “doesn’t fully understand what that means in regards to global functions”, but I imagine it’s quite a small intersection 🤔

2 years ago

That’s the plan. :)

2 years ago
Changed the status to
In progress
2 years ago
Changed the status to
In upcoming releases
2 years ago
Changed the title from "Aliasing `go()` to `redirect()` and making both optional" to "Option to disable Kirby's helper functions"
2 years ago
Changed the status to
Completed
2 years ago