Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2017-02-16 06:33:05

bici
Member
From: vancouver
Registered: 2004-02-24
Posts: 1,032
Website

Vendors Folder

I can’t find any mention of the new Vendors Folders that is now part of the latest download of TEXTPATTERN 4.6.2

what is it all about?


…. texted postive

Offline

#2 2017-02-16 09:18:05

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 7,580
Website

Re: Vendors Folder

It’s a place for PHP classes to live and be autoloaded. So instead of having a tonne of include commands at the top of each major file, or introducing more global functions, we’re migrating our code there.

Along with third party libraries (like Textile from Netcarver, and jquery) Textpattern itself is a ‘vendor’ where we put our own library code, separated into folders by its functionality.

If you take a look through some of our functions in files such as txplib_misc.php, you’ll see that many of them are deprecated or have only one line in them now: a call to Txp::get('\Textpattern\Folder\Class')->Function();

Longer term I suspect most of our code will move there — even Admin panel code because we can make a base ‘admin panel’ class and then extend it to make specific instances such as ‘admin side table’ type panels or ‘admin side grid’ panels, etc and benefit from code reuse. As it stands, there’s a lot of duplication in the panels that we could design out.


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