In January I wrote about Using php2Bluesky without Composer for those that wanted to take this approach. Since then I have updated the code so that it conforms to PSR-4 for loading with Composer. This in turn has a knock-on effect for those loading manually. The rest of this article explains how loading now needs to take place.
Multiple Files
Prior to v2.0.14 all the code was contained within a single file called functions.php. The naming reflected the history of the library which was originally developed to be included as part of a larger project. When I spun it out from that the name remained.
An Evolving Approach
To comply with PSR-4 the code needed to undergo a couple of changes:
- all classes had to be separated out into their own files; and
- the filenames had to reflect the class names.
This has led to there now being not one but four files (sorry!) which all need to be downloaded and referenced. The easiest way to achieve this is to go here and download a zip of all the code.

Once downloaded the four files (along with those for BlueskyApi) should be put in the same place as your code. Next add the following to the header of your project and you are good to go.
<?php
include __DIR__ . '/BlueskyApi.php';
include __DIR__ . '/BlueskyConsts.php';
include __DIR__ . '/php2BlueskyException.php';
include __DIR__ . '/RegexPatterns.php';
include __DIR__ . '/Version.php';
include __DIR__ . '/php2Bluesky.php';
use williamsdb\php2bluesky\php2Bluesky;
$php2Bluesky = new php2Bluesky();
Conclusion
I hope that the code will now remain stable going forward as all the necessary changes for PSR-4 have been made and this will be the last change to your project.