PHPackages                             rnr1721/le7-static-snippets - 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. [Framework](/categories/framework)
4. /
5. rnr1721/le7-static-snippets

ActiveLibrary[Framework](/categories/framework)

rnr1721/le7-static-snippets
===========================

Static code parts for le7 PHP MVC framework or ant PHP project

1.0.1(2y ago)0591MITPHPPHP &gt;=8.1

Since Apr 1Pushed 2y ago1 watchersCompare

[ Source](https://github.com/rnr1721/le7-static-snippets)[ Packagist](https://packagist.org/packages/rnr1721/le7-static-snippets)[ RSS](/packages/rnr1721-le7-static-snippets/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (4)Versions (3)Used By (1)

le7-static-snippets
===================

[](#le7-static-snippets)

Static code parts for le7 PHP MVC framework or ant PHP project

It is often necessary to display static code on a web page, such as Google Analytics codes or other metrics. This class allows you to register one or more elements and get them by key. In this case, the code will be displayed only in production mode, and stubs will be shown in development mode.

Requirements
------------

[](#requirements)

- PHP 8.1 or higher.
- Composer 2.0 or higher.

What it can?
------------

[](#what-it-can)

- read static code from text files for example for web pages only in production mode
- use PSR cache (optional), for read one file or cache item and not many
- The cache only works if the cache element is injected in the class when the class is created.

Installation
------------

[](#installation)

```
composer require rnr1721/le7-static-snippets
```

Testing
-------

[](#testing)

```
composer test
```

How it works?
-------------

[](#how-it-works)

```
use Core\CodeParts\CodeSnippetsDefault;

    $codeSnippets = new CodeSnippetsDefault();

    // Here we register file
    // File must be exists!
    // If file not exists there are no error, only stub will be displayed
    $file1 = '/home/www/mysite.com/mydomain/snippet_top.txt';
    $file2 = '/home/www/mysite.com/mydomain/snippet_bottom.txt';
    $file3 = '/home/www/mysite.com/mydomain/snippet_middle.txt';
    // third parameter ts production or none
    $codeSnippets->register('snippets_top', $file1, true);
    $codeSnippets->register('snippets_bottom', $file2, true);
    $codeSnippets->register('snippets_middle', $file2, false);

    // Now we can read file contents to display it on web page
    // Second parameter is a defaults that will be displayed if file not exists or when it not production
    $result1 = $codeSnippets->get('snippets_top', '');
    $result2 = $codeSnippets->get('snippets_bottom', '');
    $result3 = $codeSnippets->get('snippets_middle', '');
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~48 days

Total

2

Last Release

1088d ago

### Community

Maintainers

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

---

Top Contributors

[![rnr1721](https://avatars.githubusercontent.com/u/122087344?v=4)](https://github.com/rnr1721 "rnr1721 (1 commits)")

---

Tags

frameworkcomponentsnippetsle7le7-framework

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/rnr1721-le7-static-snippets/health.svg)

```
[![Health](https://phpackages.com/badges/rnr1721-le7-static-snippets/health.svg)](https://phpackages.com/packages/rnr1721-le7-static-snippets)
```

PHPackages © 2026

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