PHPackages                             stopsopa/annotations - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. stopsopa/annotations

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

stopsopa/annotations
====================

Complete annotations parser with flexible cache system

016PHP

Since Sep 2Pushed 2y ago1 watchersCompare

[ Source](https://github.com/stopsopa/stopsopa-annotations)[ Packagist](https://packagist.org/packages/stopsopa/annotations)[ RSS](/packages/stopsopa-annotations/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependenciesVersions (1)Used By (0)

DEPRECATED
==========

[](#deprecated)

Created in 2014 - quite old now and not maintained.

C'mon, I was young. Don't judge me ;P

stopsopa/annotations
====================

[](#stopsopaannotations)

Standalone, lightweight annotation parser for php with build in cache system based on:

- filesystem
- Memcached
- Apc (Deprecated technology)

---

Instalation
-----------

[](#instalation)

Library is available in composer through packagist.org ()

```
{
    "require" : {
        "stopsopa/annotations": "dev-master"
    }
}

```

Using:
------

[](#using)

```
use Stopsopa\Annotations\AnnotationParser;
use Stopsopa\Annotations\Example\TestClass;

// creating main object of parser
$parser = new AnnotationParser();
print_r($parser->getAnnotations(new TestClass()));

```

Cache
-----

[](#cache)

### Filesystem cache

[](#filesystem-cache)

```
use Stopsopa\Annotations\AnnotationParser;
use Stopsopa\Annotations\Cache\AnnotationFileCache;
use Stopsopa\Annotations\Example\TestClass;

// creating main object of parser
$parser = new AnnotationParser();

$cache = new AnnotationFileCache(dirname(__FILE__).'/cachedir');
//    $cache->clear();  // you can clear all cache
$parser->setCache($cache);

print_r($parser->getAnnotations(new TestClass()));

```

### Apc cache

[](#apc-cache)

```
use Stopsopa\Annotations\AnnotationParser;
use Stopsopa\Annotations\Cache\AnnotationApcCache;
use Stopsopa\Annotations\Example\TestClass;

// creating main object of parser
$parser = new AnnotationParser();

$salt = 'kdjdjdjk'; // project salt
$key  = 'stopsopaannotationcache';
$apccache = md5($salt).'-'.$key;
/* @var $data Test */
$cache = apc_fetch($apccache) ?: new AnnotationApcCache($apccache);
//    $cache->clear(); // you can clear all cache
$parser->setCache($cache);

print_r($parser->getAnnotations(new TestClass()));

```

### Memcached cache

[](#memcached-cache)

```
use Stopsopa\Annotations\AnnotationParser;
use Stopsopa\Annotations\Cache\MemcacheService;
use Stopsopa\Annotations\Cache\AnnotationMemcachedCache;
use Stopsopa\Annotations\Example\TestClass;

// creating main object of parser
$parser = new AnnotationParser();

$salt = 'kdjdjdjk'; // project salt
$key  = 'stopsopaannotationcache';
$mkey = md5($salt).'-'.$key;
MemcacheService::addServer('localhost', 11211);

$cache = MemcacheService::getInstance()->get($mkey);

if (!$cache)
    MemcacheService::getInstance()->set($mkey, $cache = new AnnotationMemcachedCache($mkey));

//    $cache->clear(); // you can clear all cache
$parser->setCache($cache);

print_r($parser->getAnnotations(new TestClass()));

```

### License

[](#license)

The MIT License (MIT) Copyright (c) 2014 Szymon Działowski Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

###  Health Score

14

—

LowBetter than 1% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity21

Early-stage or recently created project

 Bus Factor1

Top contributor holds 62.5% 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3743506?v=4)[Szymon Dzialowski](/maintainers/stopsopa)[@stopsopa](https://github.com/stopsopa)

---

Top Contributors

[![grytysek](https://avatars.githubusercontent.com/u/875810?v=4)](https://github.com/grytysek "grytysek (5 commits)")[![stopsopa](https://avatars.githubusercontent.com/u/3743506?v=4)](https://github.com/stopsopa "stopsopa (3 commits)")

### Embed Badge

![Health badge](/badges/stopsopa-annotations/health.svg)

```
[![Health](https://phpackages.com/badges/stopsopa-annotations/health.svg)](https://phpackages.com/packages/stopsopa-annotations)
```

###  Alternatives

[mck89/peast

Peast is PHP library that generates AST for JavaScript code

19037.7M41](/packages/mck89-peast)[karriere/json-decoder

JsonDecoder implementation that allows you to convert your JSON data into PHP class objects

140439.4k12](/packages/karriere-json-decoder)[sauladam/shipment-tracker

Parses tracking information for several carriers, like UPS, USPS, DHL and GLS by simply scraping the data. No need for any kind of API access.

9642.0k](/packages/sauladam-shipment-tracker)[jstewmc/rtf

Read and write Rich Text Format (RTF) documents with PHP

46143.1k6](/packages/jstewmc-rtf)[json-mapper/laravel-package

The JsonMapper package for Laravel

25188.9k3](/packages/json-mapper-laravel-package)[moonshine/layouts-field

Field for repeating groups of fields for MoonShine

107.9k](/packages/moonshine-layouts-field)

PHPackages © 2026

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