PHPackages                             forikal-uk/xml-authoring-library - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. forikal-uk/xml-authoring-library

Abandoned → [https://github.com/xmlsquad/xml-authoring-library](/?search=https%3A%2F%2Fgithub.com%2Fxmlsquad%2Fxml-authoring-library)Library[Utility &amp; Helpers](/categories/utility)

forikal-uk/xml-authoring-library
================================

Holding code that is reused by more than one component of the xmlsquad xml authoring suite of projects.

v0.3.3(7y ago)074[3 issues](https://github.com/forikal-uk/xml-authoring-library/issues)Apache-2.0PHPPHP &gt;=7.1CI failing

Since May 30Pushed 6y ago1 watchersCompare

[ Source](https://github.com/forikal-uk/xml-authoring-library)[ Packagist](https://packagist.org/packages/forikal-uk/xml-authoring-library)[ RSS](/packages/forikal-uk-xml-authoring-library/feed)WikiDiscussions master Synced today

READMEChangelog (7)Dependencies (6)Versions (15)Used By (0)

xml-authoring-library
=====================

[](#xml-authoring-library)

This is a place to put code that is reused by many commands which are part of the [xml-authoring-tools suite](https://github.com/xmlsquad/xml-authoring-tools).

Created as a place to put code which is re-used by two or more projects in the xmlsquad xml-authoring suite.

See the related [Issue that triggered the creation of this project](https://github.com/xmlsquad/xml-authoring-tools/issues/3).

Common Documentation
--------------------

[](#common-documentation)

A library of help pages. I.e Information that is relevant to more than one project in this suite of projects.

- [How To: Google API Setup](https://github.com/xmlsquad/xml-authoring-library/blob/master/HowTo-GoogleAPISetup.md)

This project can be added to your project via composer
------------------------------------------------------

[](#this-project-can-be-added-to-your-project-via-composer)

```
$ composer require xmlsquad/xml-authoring-library --prefer-source

```

If you would like to develop both the library and, say a command that uses it in tandem. I beleive that composer allows you to grab the library as *source*

See : [composer require](https://getcomposer.org/doc/03-cli.md#require)

Quote:

> The option: --prefer-source: Install packages from source when available.

and see [Composer Repositories &gt; Packages](https://getcomposer.org/doc/05-repositories.md#package)

Quote:

> *Source*: The source is used for development. This will usually originate from a source code repository, such as git. You can fetch this when you want to modify the downloaded package.

Code Reference
--------------

[](#code-reference)

### Google API helper

[](#google-api-helper)

An abstraction over [Google API SDK](https://github.com/google/google-api-php-client). It helps to mock Google API in tests and authenticate users in console commands.

You need to install Google SDK to your project to use this helper:

```
composer require google/apiclient:^2.0
```

Usage example:

```
use XmlSquad\Library\GoogleAPI\GoogleAPIClient;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

class MyCommand extends Command
{
    execute(InputInterface $input, OutputInterface $output)
    {
        $googleClient = new GoogleAPIClient(); // You can pass a \Google_Client mock to the constructor. It will be used in the Google services.

        if (!$googleClient->authenticateFromCommand(
            $input,
            $output
            'google-client-secret.json', // A path to a Google API client secret file
            'google-access-token.json', // A path to a file where to store a Google API access token so the helper won't prompt to authenticate next time
            [\Google_Service_Drive::DRIVE_READONLY, \Google_Service_Sheets::SPREADSHEETS_READONLY] // A list of required permissions
        )) {
            return 1;
        }

        // $googleAPIClient->driveService is a \Google_Service_Drive instance. All the other services are available.
        $file = $googleAPIClient->driveService->files->get('87ad6fg90gr0m91c84');

        return 0;
    }
}
```

You can learn how to get the Google API client secret file from [this instruction](HowTo-GoogleAPISetup.md). If you need to customize the console messages and behaviour, use the `authenticate` method. You can find more information in the source code.

### Console logger

[](#console-logger)

A [PSR-3](https://github.com/php-fig/log) compatible logger which writes messages to a Symfony console output. In contrast to the [built-in Synfony Console logger](https://symfony.com/doc/3.4/components/console/logger.html), this doesn't print log level labels and is customizable (we can edit the source code).

Usage example:

```
use XmlSquad\Library\Console\ConsoleLogger;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\ConsoleOutputInterface;
use Psr\Log\LogLevel;

// ...

protected function execute(InputInterface $input, OutputInterface $output)
{
    $consoleLogger = new ConsoleLogger($output, [
        LogLevel::DEBUG  => OutputInterface::VERBOSITY_VERY_VERBOSE,
        LogLevel::INFO   => OutputInterface::VERBOSITY_VERBOSE,
        LogLevel::NOTICE => OutputInterface::VERBOSITY_NORMAL
    ], [
        LogLevel::DEBUG  => '',
        LogLevel::INFO   => '',
        LogLevel::NOTICE => 'info'
    ]);

    $service = new MyService($consoleLogger);
}
```

The constructor arguments are the same as in the [Synfony Console logger](https://symfony.com/doc/3.4/components/console/logger.html).

Contribution
------------

[](#contribution)

1. Clone the repository.
2. Install the dependencies by running `composer install` in a console.
3. Make a change. Make sure the code follows the [PSR-2 standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md).
4. Test the code by running `composer test`. If the test fails, fix the code.
5. Commit and push the changes.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 54.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~10 days

Recently: every ~28 days

Total

14

Last Release

2766d ago

PHP version history (2 changes)v0.0.3PHP &gt;=5.5.9

v0.2.0PHP &gt;=7.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/b3f30d378f09a6e60c2bc0344743b0a0ac47a039940ca322042d94f11016c306?d=identicon)[forikal-uk](/maintainers/forikal-uk)

---

Top Contributors

[![john-arcus](https://avatars.githubusercontent.com/u/32770045?v=4)](https://github.com/john-arcus "john-arcus (44 commits)")[![Finesse](https://avatars.githubusercontent.com/u/9006227?v=4)](https://github.com/Finesse "Finesse (23 commits)")[![forikal-uk](https://avatars.githubusercontent.com/u/39656410?v=4)](https://github.com/forikal-uk "forikal-uk (13 commits)")[![igormukhingmailcom](https://avatars.githubusercontent.com/u/6544038?v=4)](https://github.com/igormukhingmailcom "igormukhingmailcom (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/forikal-uk-xml-authoring-library/health.svg)

```
[![Health](https://phpackages.com/badges/forikal-uk-xml-authoring-library/health.svg)](https://phpackages.com/packages/forikal-uk-xml-authoring-library)
```

###  Alternatives

[phpro/soap-client

A general purpose SoapClient library

8885.6M46](/packages/phpro-soap-client)[simplesamlphp/simplesamlphp

A PHP implementation of a SAML 2.0 service provider and identity provider.

1.1k12.4M193](/packages/simplesamlphp-simplesamlphp)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[cognesy/instructor-php

The complete AI toolkit for PHP: unified LLM API, structured outputs, agents, and coding agent control

310107.9k1](/packages/cognesy-instructor-php)[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

19462.3M1.3k](/packages/drupal-core)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
