PHPackages                             copperforest/snapshot - 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. copperforest/snapshot

ActiveComposer-plugin[Utility &amp; Helpers](/categories/utility)

copperforest/snapshot
=====================

A composer plugin that let you choose differents code snapshots for differents users

00PHP

Since Dec 21Pushed 7y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

snapshot
========

[](#snapshot)

This composer plugin let you choose differents code snapshots for differents users.

implements the SessionInterface
-------------------------------

[](#implements-the-sessioninterface)

The first step to use the snashots system is ensure that you **SessionHandler** class implements the interface **copperforest\\snapshot\\authentication\\SessionHandlerInterface**. For this you must create the next five methods:

- **getUserId()**: must return the ID of the current user.
- **setPreviousUserId( $id )**: must store the parameter $id in session, for example:

```
$_SESSION[ 'PreviousUserId' ] = $id;
```

- **getPreviousUserId()**: return the value stored in the previous method, for example:

```
return $_SESSION[ 'PreviousUserId' ];
```

- **setPreviousSnapshot( $snapshot )**: must store the parameter $snapshot in session, for example:

```
$_SESSION[ 'PreviousSnapshot' ] = $snapshot;
```

- **getPreviousSnapshot()**: return the value stored in the previous method, for example:

```
return $_SESSION[ 'PreviousSnapshot' ];
```

new composer command
--------------------

[](#new-composer-command)

This plugin define a new composer comand: **create-snapshot**. You must run this command each time you update you code to create a new code snapshot.

```
php composer.phar create-snapshot
```

choose the snapshot
-------------------

[](#choose-the-snapshot)

You must edit the file **./snapshots/snapshot.json** and choose the :

```
{
    "snapshot":{
        "1": [ "default", "cli" ],
        "2":[ "122", "123" ]
    }
}
```

warning
-------

[](#warning)

The SessionHandler class (and all the classes used in its \_\_construct() method) allways loads from default snapshot because previously we don't know the user ID.

### That's all

[](#thats-all)

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 Bus Factor1

Top contributor holds 78.6% 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/7427956?v=4)[CopperForest](/maintainers/copperforest)[@CopperForest](https://github.com/CopperForest)

---

Top Contributors

[![AlejandroGama](https://avatars.githubusercontent.com/u/7498937?v=4)](https://github.com/AlejandroGama "AlejandroGama (11 commits)")[![krowork](https://avatars.githubusercontent.com/u/7427946?v=4)](https://github.com/krowork "krowork (3 commits)")

### Embed Badge

![Health badge](/badges/copperforest-snapshot/health.svg)

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

###  Alternatives

[optimistdigital/nova-menu-builder

This Laravel Nova package allows you to create and manage menus and menu items.

243374.7k](/packages/optimistdigital-nova-menu-builder)[ademarre/binary-to-text-php

Collection of binary-to-text encoding utilities for PHP. Includes Base32 support and much more.

39170.2k](/packages/ademarre-binary-to-text-php)[experius/module-addresslines

Add labels to address lines and configuration for each address line.

44114.3k](/packages/experius-module-addresslines)[bazo/geotools

Geo Tools for PHP 5.4

1386.2k](/packages/bazo-geotools)[codingfreaks/cf-cookiemanager

Manage cookies, scripts, and GDPR compliance on your Typo3 website with CodingFreaks Typo3 Cookie Manager. Customize cookie banners, streamline workflow, and enhance user experience. Ensure GDPR compliance and take control of cookie management with our Typo3 cookie management extension. Visit the official Typo3 Documentation page to learn more.

1829.2k](/packages/codingfreaks-cf-cookiemanager)[alliedhealthmedia/icing

CakePHP Icing Plugin - Portable Package of Handy Utilities for CakePHP

218.0k](/packages/alliedhealthmedia-icing)

PHPackages © 2026

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