Skip to content

Commit

Permalink
Merge pull request #189 from arhimede/master
Browse files Browse the repository at this point in the history
Added blog article related to maintenance status of packages
  • Loading branch information
arhimede authored Jul 31, 2024
2 parents 7124fc1 + 59b4ea2 commit fe1be8a
Show file tree
Hide file tree
Showing 10 changed files with 136 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ coveralls-upload.json
phpunit.xml
public/css/*
public/js/*
public/share/properties.json
public/share/*
var/
vendor/
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
id: 2024-07-29-current-maintenance-status-of-laminas-mezzio-packages
author: julian
title: 'Current Maintenance Status of Laminas & Mezzio Packages'
draft: false
public: true
created: '2024-07-29T11:00:00-01:00'
updated: '2024-07-29T11:00:00-01:00'
tags:
- maintenance status
---

The Laminas Project has created a large number of packages to serve the needs of the PHP community.
But what happens when you need to make sure that the package you want to use in your application is being actively
maintained?
Sure, you can check each package manually, but the most useful thing would be a full overview of this vital
information.

<!--- EXTENDED -->

### Laminas and Mezzio packages maintenance status at a glance

The page below intends to provide exactly that - a fast, accessible way to examine every package at a glance. It
contains columns for each subproject: Mezzio, Laminas Components, Laminas MVC and API Tools. The page automatically
refreshes the package status daily, is sorted alphabetically and is publicly available.

[**Current Maintenance Status of Laminas & Mezzio Packages**](https://getlaminas.org/packages-maintenance-status/)

### The best way to stay up-to-date

Laminas and Mezzio packages are constantly in motion.
This page allows you to regularly check the packages you chose for your project and make sure they are still reliable.
If the status of a package changes from `active` to `maintenance-only`, `security-only` or is discontinued, you can
quickly see it and take action.
The handy link to the relevant Technical Steering Committee minute file details the reason for the status change and a
recommended solution for moving forward.
5 changes: 0 additions & 5 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -303,9 +303,4 @@
<code><![CDATA[$first]]></code>
</MixedAssignment>
</file>
<file src="vendor/symfony/console/Command/Command.php">
<PossiblyNullArgument>
<code><![CDATA[$name]]></code>
</PossiblyNullArgument>
</file>
</files>
18 changes: 10 additions & 8 deletions src/App/ConfigProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,14 @@ public function getDependencies(): array
],
],
'factories' => [
EventDispatcherInterface::class => EventDispatcherFactory::class,
Handler\CommercialVendorsHandler::class => Handler\CommercialVendorsHandlerFactory::class,
Handler\CustomPropertiesHandler::class => Handler\CustomPropertiesHandlerFactory::class,
Handler\HomePageHandler::class => Handler\HomePageHandlerFactory::class,
Handler\StaticPageHandler::class => Handler\StaticPageHandlerFactory::class,
LoggerInterface::class => AccessLoggerFactory::class,
PlatesEngine::class => PlatesEngineFactory::class,
EventDispatcherInterface::class => EventDispatcherFactory::class,
Handler\CommercialVendorsHandler::class => Handler\CommercialVendorsHandlerFactory::class,
Handler\MaintenanceOverviewHandler::class => Handler\MaintenanceOverviewHandlerFactory::class,
Handler\MaintenanceStatusHandler::class => Handler\MaintenanceStatusHandlerFactory::class,
Handler\HomePageHandler::class => Handler\HomePageHandlerFactory::class,
Handler\StaticPageHandler::class => Handler\StaticPageHandlerFactory::class,
LoggerInterface::class => AccessLoggerFactory::class,
PlatesEngine::class => PlatesEngineFactory::class,
],
];
}
Expand Down Expand Up @@ -108,7 +109,8 @@ public function registerRoutes(Application $app, string $basePath = '/'): void
$app->get($basePath . 'participate[/]', Handler\StaticPageHandler::class, 'community.participate');
$app->get($basePath . 'support[/]', Handler\StaticPageHandler::class, 'app.support');
$app->get($basePath . 'commercial-vendor-program[/]', Handler\CommercialVendorsHandler::class, 'app.commercial-vendor-program');
$app->get($basePath . 'packages-maintenance-status[/]', Handler\CustomPropertiesHandler::class, 'app.packages-maintenance-status');
$app->get($basePath . 'packages-maintenance-status[/]', Handler\MaintenanceOverviewHandler::class, 'app.packages-maintenance-status');
$app->get($basePath . 'maintenance-status', Handler\MaintenanceStatusHandler::class, 'app.maintenance-status');
// phpcs:enable Generic.Files.LineLength.TooLong
}
}
13 changes: 6 additions & 7 deletions src/App/Console/WriteRepositoryData.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace App\Console;

use App\Handler\MaintenanceOverviewHandler;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
Expand Down Expand Up @@ -41,9 +42,6 @@ class WriteRepositoryData extends Command
private const ARGUMENT_USER_AGENT = 'userAgent';
private const ARGUMENT_TOKEN = 'token';

private string $propsFile;
private string $cachePath;

private array $orgs = [
'laminas',
'mezzio',
Expand All @@ -53,9 +51,6 @@ class WriteRepositoryData extends Command
public function __construct()
{
parent::__construct();

$this->propsFile = 'properties.json';
$this->cachePath = getcwd() . "/public/share";
}

protected function configure(): void
Expand Down Expand Up @@ -163,7 +158,11 @@ private function generateDataFile(string $userAgent, string $token): void
curl_close($curl);

file_put_contents(
sprintf('%s/%s', $this->cachePath, $this->propsFile),
sprintf(
'%s/%s',
getcwd() . MaintenanceOverviewHandler::CUSTOM_PROPERTIES_DIRECTORY,
MaintenanceOverviewHandler::CUSTOM_PROPERTIES_FILE
),
json_encode($singleResult, JSON_PRETTY_PRINT),
FILE_USE_INCLUDE_PATH
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\RequestHandlerInterface;

class CustomPropertiesHandler implements RequestHandlerInterface
class MaintenanceOverviewHandler implements RequestHandlerInterface
{
public const string CUSTOM_PROPERTIES_FILE = 'maintenance-status.json';
public const string CUSTOM_PROPERTIES_DIRECTORY = '/public/share';

public function __construct(
private array $repositoryData,
private string $lastUpdated,
Expand All @@ -22,7 +25,7 @@ public function __construct(
public function handle(ServerRequestInterface $request): ResponseInterface
{
return new HtmlResponse($this->renderer->render(
'app::packages-custom-properties',
'app::maintenance-overview',
[
'repositoryData' => $this->repositoryData,
'lastUpdated' => $this->lastUpdated,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,21 @@
use function json_decode;
use function sprintf;

class CustomPropertiesHandlerFactory
class MaintenanceOverviewHandlerFactory
{
/**
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
public function __invoke(ContainerInterface $container): CustomPropertiesHandler
public function __invoke(ContainerInterface $container): MaintenanceOverviewHandler
{
$rawData = file_get_contents(sprintf('%s/%s', getcwd() . "/public/share", 'properties.json'));
$rawData = file_get_contents(
sprintf(
'%s/%s',
getcwd() . MaintenanceOverviewHandler::CUSTOM_PROPERTIES_DIRECTORY,
MaintenanceOverviewHandler::CUSTOM_PROPERTIES_FILE
)
);
$repositoryData = json_decode($rawData, true);
assert(is_array($repositoryData));

Expand All @@ -36,6 +42,6 @@ public function __invoke(ContainerInterface $container): CustomPropertiesHandler
assert(is_string($lastUpdated));
unset($repositoryData['last_updated']);

return new CustomPropertiesHandler($repositoryData, $lastUpdated, $renderer);
return new MaintenanceOverviewHandler($repositoryData, $lastUpdated, $renderer);
}
}
27 changes: 27 additions & 0 deletions src/App/Handler/MaintenanceStatusHandler.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

declare(strict_types=1);

namespace App\Handler;

use Laminas\Diactoros\Response\JsonResponse;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\RequestHandlerInterface;

use const JSON_PRETTY_PRINT;

class MaintenanceStatusHandler implements RequestHandlerInterface
{
public function __construct(private array $repositoryData)
{
}

public function handle(ServerRequestInterface $request): ResponseInterface
{
return new JsonResponse(
data: $this->repositoryData,
encodingOptions: JsonResponse::DEFAULT_JSON_FLAGS | JSON_PRETTY_PRINT
);
}
}
33 changes: 33 additions & 0 deletions src/App/Handler/MaintenanceStatusHandlerFactory.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

declare(strict_types=1);

namespace App\Handler;

use Psr\Container\ContainerInterface;

use function assert;
use function file_get_contents;
use function getcwd;
use function is_array;
use function json_decode;
use function sprintf;

class MaintenanceStatusHandlerFactory
{
public function __invoke(ContainerInterface $container): MaintenanceStatusHandler
{
$rawData = file_get_contents(
sprintf(
'%s/%s',
getcwd() . MaintenanceOverviewHandler::CUSTOM_PROPERTIES_DIRECTORY,
MaintenanceOverviewHandler::CUSTOM_PROPERTIES_FILE
)
);

$repositoryData = json_decode($rawData, true);
assert(is_array($repositoryData));

return new MaintenanceStatusHandler($repositoryData);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ declare(strict_types=1);
* @var array $repositoryData
*/

use App\Handler\MaintenanceOverviewHandler;

$this->layout('layout::default', ['title' => 'Current Maintenance Status of Laminas & Mezzio Packages']);

const GITHUB_URL = 'https://github.com/';
Expand All @@ -31,12 +33,9 @@ $this->end();
<div>
<p>
The page below intends to provide a fast, accessible way to examine every package at a glance.
It provides a column for each of the three organizations: Laminas, Api Tools and Mezzio.
It provides a column for each subproject: Mezzio, Laminas Components, Laminas MVC and API Tools.
The page is automatically refreshed daily and is publicly available.
</p>
<p>
There is also a JSON version <a href="/share/properties.json" target="_blank">here</a>. It contains the full list of properties for each package. Note that the properties differ between organizations.
</p>
<p>
Below is the meaning of each status. The non-active statuses also include the date when they were set and the TSC md file where they were discussed
</p>
Expand Down Expand Up @@ -149,4 +148,9 @@ $this->end();
<?php endforeach ?>
</div>
<p id="repository-last-updated">Last update: <?= $lastUpdated ?></p>
<p>
There is also a JSON version
<a href="<?= $this->url('app.maintenance-status') ?>" target="_blank">here</a>.
It contains the full list of properties for each package. Note that the properties differ between organizations.
</p>
</div>

0 comments on commit fe1be8a

Please sign in to comment.