ProcessWire Weekly #228

In the 228th issue of ProcessWire Weekly we'll walk you through the latest ProcessWire core updates, introduce LibLocalisation and RestApi modules, and of course showcase a splendid new site of the week. Read on!

Welcome to the latest issue of ProcessWire Weekly! Hope you've had a great week so far, and remember to take some time off during the weekend to charge up your batteries.

Now, for our weekly updates. In this issue we're going to check out the latest dev release of ProcessWire, 3.0.114, which is a relatively minor release but still includes a couple of pretty interesting new additions. We've also got two new third party modules this week – LibLocalisation by netcarver and RestApi from Thomas Aull – and we'll be diving into those in just a bit.

Finally, our latest site of the week belongs to a non-profit organization providing all-important support for local initiatives based in the city of Upper Arlington, Ohio. Skillfully crafted by Process Interactive, this is a really beautiful site with a lot going on in terms of both features and content.

As always, a big thank you to all of you for being here with us, and please don't hesitate to drop us a note if there's anything in your mind that you'd like to share. Your feedback helps us focus on the things that you folks want to hear more about.

Latest core updates: ProcessWire 3.0.114

This week's core updates, as Ryan explains in this support forum post, are relatively minor. That being said, there are a couple of brand new features in the core this week:

  • $database->supportsTransaction() can be used to check if the database you're working on has transaction support. Additionally you can provide a table name as a param, and it will check if said table supports transactions.
  • importFiles() and replaceFiles() methods have been added to the core FilesManager class. While ou may find these useful for certain types of mass operations, they're most likely not what you need during site development.
  • The autoload getModuleInfo() property now supports developer-defined autoload order: if you set autoload to an integer >= 2, ProcessWire will consider it the autoload priority of said module. The module with largest autoload priority number will load first, etc.

So, for a minor core update we've actually got quite a few interesting changes in the core. As Ryan also states in his forum post, the one that probably makes the biggest difference is the autoload priority feature, because this enables modules like TracyDebugger to be initiated consistently – and without any modifications to site or core files – before other modules.

If you have any comments or questions related to this week's core updates, feel free to post them to the support forum thread. Thanks!

New module: LibLocalisation by netcarver

LibLocalisation is a newly released third party localisation helper module by netcarver. This module provides API level methods for quickly and effortlessly localising country, language, and currency names for any given locale:

$de_DE = $modules->LibLocalisation->setLocale('de_DE');

echo $de_DE->country('CH');
// "Schweiz" - the German for Switzerland.

echo $de_DE->currency('GBP');
/*
[
    digits => 2,
    number => "826",
    symbol => "£",
    name => "Britisches Pfund Sterling"
]
*/

echo $de_DE->language('fr');
// "Französisch" - the German for French.

You can request as many instances of the LibLocalisation module via the $modules API variable as you need, and each instance can use a different locale. Behind the scenes this module makes use of a local dataset gathered from Umpirsky's country-list project.

Thanks to netcarver for sharing this module with us! It's a useful tool to have at hand for anyone working on multi-language sites – an area where ProcessWire has always been strong, and now even stronger thanks to this easy to use localisation library.

New module: RestApi by Thomas Aull

RestApi is a new third party ProcessWire module by Thomas Aull. RestApi started out as the REST API site profile, but has now been refactored and packaged into an easy to use third party module. In other words: if you need to implement a REST API for a site you're working on, you no longer need a specific, full-blown site profile just for that purpose.

The way the RestApi module works, as Thomas explains in great detail at the RestApi GitHub repository, is that it creates a /site/api/Routes.php file, in which you can define any custom routes and point them to their respective handler classes. The routing part is powered by the FastRoute library by Nikita Popov, and currently ties itself to a hard-coded endpoint at https://www.your-site.test/api/.

RestApi comes with built-in support for JWT authentication powered by the PHP-JWT library, and includes an option of auto-generating JWT tokens.

For more details on how to install, enable, and use this module, check out the RestApi GitHub repository. If you have any questions for the author or require additional help getting started, feel free to drop by at the RestApi support forum thread.

Big thanks to Thomas Aull for your work on this module! It's a wonderful helper module, and makes setting up a full-blown REST API for a ProcessWire site a truly trivial task.

Site of the week: Upper Arlington Community Foundation

Our latest site of the week belongs to Upper Arlington Community Foundation – an organization with the sole purpose of enhancing the quality of life in Upper Arlington, Ohio. UACF takes part in and provides monetary support for different types of local initiatives and programs.

The website of UACF was crafted by Process Interactive, and boasts a truly beautiful, fully responsive design and layout. Pages of the site consist of different types of content blocks (or units), and although there's no way to be sure just by looking from the outside, it seems likely that there's some sort of a block builder implementation behind the scenes.

The front-end of the site is based on the Bootstrap front-end framework, and the third party ProcessWire modules that we were able to spot here would be ProCache and FormBuilder – both of which are commercial "pro-modules" developed by Ryan Cramer.

Big thanks to the folks at Process Interactive for sharing this project with us and trusting ProcessWire for your client work. Also our congratulations to Upper Arlington Community Foundation for their fantastic new website – they're clearly doing great work, and we hope them all the best in their future endeavors!

Stay tuned for our next issue

That's it for the 228th issue of ProcessWire Weekly. We'll be back with more news, updates, and content Saturday, 29th of September. As always, ProcessWire newsletter subscribers will get our updates a few days later.

Thanks for staying with us, once again. Hope you've had a great and productive week, and don't forget to check out the ProcessWire forums for more interesting topics. Until next week, happy hacking with ProcessWire!

Post a comment