PHPackages                             netglue/zf2-akismet-module - 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. netglue/zf2-akismet-module

Abandoned → [gsteel/akismet](/?search=gsteel%2Fakismet)ArchivedModule

netglue/zf2-akismet-module
==========================

ZF2 module that provides an Akismet service and validator

0.1.1(11y ago)115.3k1BSD-3-ClausePHPPHP &gt;=5.3.3

Since Mar 13Pushed 4y ago1 watchersCompare

[ Source](https://github.com/netglue/ZF2-Akismet-Module)[ Packagist](https://packagist.org/packages/netglue/zf2-akismet-module)[ Docs](https://github.com/netglue/ZF2-Akismet-Module)[ RSS](/packages/netglue-zf2-akismet-module/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (2)Versions (4)Used By (0)

ZF2 Akismet Service Module
==========================

[](#zf2-akismet-service-module)

Abandoned
---------

[](#abandoned)

If you're still using ZF and need this, it's not going anywhere, but it's also not going to receive any maintenance either. Akismet is still useful - you might want to check out [gsteel/akismet](https://github.com/gsteel/akismet) which is a pretty easy to use standalone client that's well tested… That way you can implement your own validators and just consume the api client!

Intro
-----

[](#intro)

A straightforward ZF2 module that provides a service for using the Akismet API and a handy validator you can attach to your form elements.

Current Status
--------------

[](#current-status)

Mostly tested with exception of submitting ham and spam, though there's no reason why these wouldn't work fine as far as I can see.

Install
-------

[](#install)

Install via composer with `netglue/zf2-akismet-module` then enable in your `application.config.php` with the module name `NetglueAkismet`

Add your Akismet ApiKey to local autoloaded config like this:

```
return array(
	'netglue_akismet' => array(
		'apiKey' => 'YourApiKey',
	),
);

```

There are more options to setup defaults. Look at `config/module.config.php` for a full list.

Akismet Service
---------------

[](#akismet-service)

The Akismet service, once the module is loaded should be accessible from the main service locator with the name `'NetglueAkismet\Service\AkismetService'`. It also has a shorter alias `'AkismetService'`

Basic usage of the service goes like this:

```
$service = $this->getServiceLocator()->get('AkismetService');
$result = $service->isSpam($contentToCheck, $authorEmail, $commentType, $additionalParams);

```

Not all of the parameters are required and all of them can be passed into the `$additionalParams` array making sure that the keys match up with whatever is expected by the API. You can find docs for it here: [comment-check docs](https://akismet.com/development/api/#comment-check)

Validator
---------

[](#validator)

The validator is registered through the `ValidatorManager` by the Module as it depends on a service instance. Providing your form elements are created using the form element manager/factory stuff the validator should be ready to go - this is important. You must be intialising your form with `$formElementManager->get('My\Form\Name');` in order for the validator to be properly initialised.

For example, set up your input filter config like this:

```
public function getInputFilterSpecification() {
	return array(
		'myNameFormElement' => array(
			'required' => true,
			'filters' => array(
				array('name' => 'Zend\Filter\StringTrim'),
			),
		),
		'emailFormElement' => array(
			'required' => true,
			'filters' => array(
				array('name' => 'Zend\Filter\StringToLower'),
				array('name' => 'Zend\Filter\StringTrim'),
			),
		),
		'comment' => array(
			'required' => true,
			'filters' => array(
				array('name' => 'Zend\Filter\StringTrim'),
			),
			'validators' => array(
				array(
					'name' => 'AkismetValidator', // Or 'NetglueAkismet\Validator\Akismet'
					'options' => array(
						'comment_type' => 'comment', // Or 'contact-form' or something else, or leave it to the service configured default
						'context_map' => array(
							'emailFormElement' => 'comment_author_email',
							'myNameFormElement' => 'comment_author',
						),
					),
				),
			),
		),
	);
}

```

Tests
-----

[](#tests)

The tests are pretty good I think, but `submitHam` and `submitSpam` aren't tested yet.

To run the tests, CD to the module directory and issue `php composer.phar install` to download all the dependencies; copy `phpunit.xml.dist` to `phpunit.xml`. By default the network tests are disabled. To run those too, comment out or delete the exclude directive in the `phpunit.xml` and make sure you setup a valid api key in `test/config/local.php`.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 95.2% 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 ~95 days

Total

2

Last Release

4347d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a6c21b0de8cc9938916a186f5f2ed0bee90a4e23e0b29cf7b9c18bfe99067f9b?d=identicon)[netglue](/maintainers/netglue)

---

Top Contributors

[![gsteel](https://avatars.githubusercontent.com/u/2803720?v=4)](https://github.com/gsteel "gsteel (20 commits)")[![hickeroar](https://avatars.githubusercontent.com/u/2441838?v=4)](https://github.com/hickeroar "hickeroar (1 commits)")

---

Tags

modulezf2Akismetnetglue

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/netglue-zf2-akismet-module/health.svg)

```
[![Health](https://phpackages.com/badges/netglue-zf2-akismet-module/health.svg)](https://phpackages.com/packages/netglue-zf2-akismet-module)
```

PHPackages © 2026

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