Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#37 2020-07-04 15:46:13

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,271
Website GitHub

Re: Feedback to: Textpattern CMS 4.8.1 Released

gaekwad wrote #324279:

we should prepare a boilerplate page/single-pager to approach hosting orgs that have finicky problems and ask for a gratis testing account

If they’re amenable to that, bring it on.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#38 2020-07-04 16:06:39

DragonBard
Member
Registered: 2014-07-01
Posts: 16

Re: Feedback to: Textpattern CMS 4.8.1 Released

gaekwad wrote #324279:

Nagging thought – we should prepare a boilerplate page/single-pager to approach hosting orgs that have finicky problems and ask for a gratis testing account: we can perhaps find a solution, they have happier customers, everyone wins.

You want a testing account on DreamHost? I can give you one. I have unlimited hosting with “resell” rights. The only difference is I would be the one with the god account. I can set up a separate user for you and you would have full SSH and SFTP access. I can even provide limited access to their control panel, though that will require some coordination as I would have to set up the database first.

Last edited by DragonBard (2020-07-04 16:15:14)

Offline

#39 2020-07-04 20:04:56

bici
Member
From: vancouver
Registered: 2004-02-24
Posts: 2,075
Website Mastodon

Re: Feedback to: Textpattern CMS 4.8.1 Released

I have asked OS teach Support about this issue. Perhaps they have a valid reasons to keep allow_url_fopen off, or they may have other suggestions.

EDIT: their quick response:
Yes, just let me know the name of the application and I’ll enable that feature for you.

Such great service!

Last edited by bici (2020-07-04 20:23:21)


…. texted postive

Offline

#40 2020-07-04 20:58:01

bici
Member
From: vancouver
Registered: 2004-02-24
Posts: 2,075
Website Mastodon

Re: Feedback to: Textpattern CMS 4.8.1 Released

Diagnostics
Pre-flight check
All checks passed.

allow_url_fopen On On

A-OK on OpalStack!


…. texted postive

Offline

#41 2020-07-04 22:09:31

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,271
Website GitHub

Re: Feedback to: Textpattern CMS 4.8.1 Released

bici wrote #324290:

Diagnostics
Pre-flight check
All checks passed.
allow_url_fopen On On

Excellent! That means this pesky issue is definitely related to allow_url_fopen(). No idea why I didn’t spot that before, it’s kind of obvious now I look at it with this fresh perspective, thank you for the confirmation.

/BEGIN TECH SPEAK

What we could do with is a nice, succinct Http/Curl wrapper in our library. I took a look around today but all the ones out there, while fully featured, are super bloaty for our needs.

shuber/curl was the minimalest approach I could find. We could probably rip some or all of that for our own purposes. But with my Object Oriented hat on, I kind of think we should adopt the ‘Adapter’ model, e.g. have an Http/Client class that accepts an Adapter to communicate over Sockets, Curl, or plain file_get/put_contents().

Perhaps when we construct a client it automagically tries:

  • file_get_contents() as an adapter first if allow_url_fopen is on.
  • Curl if(in_array ('curl', get_loaded_extensions()) is available.
  • File sockets otherwise.

That means instead of file_get_contents($some_file_or_url) in core, we’d use something like:

Txp::get('\Textpattern\Http\Client')->get($some_file_or_url);

And it would then pick the most appropriate communication method based on what was available/compiled. Bonus points: a setAdapter(\Textpattern\Http\Adapter\Some-adapter) method would allow someone to override it or provide their own transport mechanism (e.g. FTP, File, local Test, …). Plus we could expose a few configuration methods to set transport parameters, SSL stuff, yahde yahde if needed.

It’s similar to the approach that Zend (now Laminas) have taken, but man their implementation has every bell and whistle imaginable. Full exception stacks, ability to set every individual parameter through hundreds of methods in almost half a MB of code, plus extra support libraries and URL objects, the list goes on. Yes, it’s the “right” way to do it but sooooo overkill for what we need it for.

I’d rather start small with the correct methodologies and expand as and when we need anything extra. I’m comfy having a go at coding this one day, but if anyone wants to jump start the process of distilling the above down into usable class(es), please be my guest.

/END TECH SPEAK

EDIT: issue opened to track this

Last edited by Bloke (2020-07-05 10:34:46)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

Board footer

Powered by FluxBB