PHPackages                             safronik/globals - 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. [DevOps &amp; Deployment](/categories/devops)
4. /
5. safronik/globals

ActiveLibrary[DevOps &amp; Deployment](/categories/devops)

safronik/globals
================

Helper to receive global variables

0.2.0(2mo ago)0321MITPHPPHP &gt;=8.2

Since Apr 19Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/safronik/project-globals)[ Packagist](https://packagist.org/packages/safronik/globals)[ Docs](https://github.com/Safronik/project-globals)[ RSS](/packages/safronik-globals/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (1)Versions (5)Used By (1)

safronik/globals
================

[](#safronikglobals)

 **A PHP library to ease gaining of PHP global variables**

About
=====

[](#about)

This package is about convenient way to operate global variables. It's include few classes to achieve that:

- Server
- Request
- Cookie
- Get
- Post

Installation
============

[](#installation)

The preferred method of installation is via Composer. Run the following command to install the package and add it as a requirement to your project's `composer.json`:

```
composer require safronik/globals
```

or just download files or clone repository (in this case you should bother about autoloader)

Usage
=====

[](#usage)

This class caches the values in its own Multiton storage, to prevent multiple filtration.

Gain variable value
-------------------

[](#gain-variable-value)

You can get any of those by simply call:

```
$get_variable = Get::get('some_Get_variable');
$get_variable = Post::get('some_Post_variable');
$get_variable = Cookie::get('some_Cookie_variable');
$get_variable = Server::get('some_Server_variable');
$get_variable = Request::get('some_Request_variable');
```

Server
------

[](#server)

Server class has the method `getHTTPHeaders()`. It will return all the variables in SERVER starts with 'http\_' (case insensitive).

```
$http_headers = Server::getHTTPHeaders();
```

Cookie
------

[](#cookie)

`Cookie` class can also helpful to set a cookie header, unless the headers are sent.

```
$expires   = 0;
$path      = '';
$domain    = 'some.domain';
$secure    = true;
$http_only = true;
$same_site = 'Lax';

$http_headers = Cookie::set(
    'cookie_name',
    'cookie_value',
    $expires,
    $path,
    $domain,
    $secure,
    $http_only,
    $same_site,
);
```

###  Health Score

40

—

FairBetter than 87% of packages

Maintenance91

Actively maintained with recent releases

Popularity7

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity46

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 ~225 days

Total

4

Last Release

73d ago

### Community

Maintainers

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

---

Top Contributors

[![safronik](https://avatars.githubusercontent.com/u/16255344?v=4)](https://github.com/safronik "safronik (9 commits)")

---

Tags

requestservercookiegetpostglobals

### Embed Badge

![Health badge](/badges/safronik-globals/health.svg)

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

###  Alternatives

[spatie/laravel-webhook-server

Send webhooks in Laravel apps

1.1k8.8M22](/packages/spatie-laravel-webhook-server)[felixfbecker/language-server-protocol

PHP classes for the Language Server Protocol

22476.7M6](/packages/felixfbecker-language-server-protocol)[laminas/laminas-server

Create Reflection-based RPC servers

2423.1M23](/packages/laminas-laminas-server)[elementaryframework/water-pipe

URL routing framework and requests/responses handler for PHP

254.6k4](/packages/elementaryframework-water-pipe)

PHPackages © 2026

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