PHPackages                             citfact/uservars - 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. citfact/uservars

ActiveBitrix-module[Utility &amp; Helpers](/categories/utility)

citfact/uservars
================

User vars module

1124PHP

Since Jul 6Pushed 11y ago3 watchersCompare

[ Source](https://github.com/studiofact/citfact.uservars)[ Packagist](https://packagist.org/packages/citfact/uservars)[ RSS](/packages/citfact-uservars/feed)WikiDiscussions master Synced 6d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Пользовательские переменные
===========================

[](#пользовательские-переменные)

Необходимы в случае, если требуется добавить несколько простых настроек для сайта с возможностью редактирования из административной части, например для возможности изменения клиентом. Для удобства есть возможность группировки переменных.

Библиотека находятся в пространстве имен `Citfact\UserVars`

Установка
=========

[](#установка)

Создайте или обновите `composer.json` файл и запустите `php composer.phar install`

```
  {
      "require": {
          "citfact/uservars": "dev-master"
      }
  }
```

Пример использования
====================

[](#пример-использования)

Для быстрого доступа к переменным и группам, служат классы `Citfact\UserVars\Vars` и `Citfact\UserVars\VarsGroup`

```
  use Citfact\UserVars;

  $varsGroup = new UserVars\VarsGroup();

  // Предопределены два метода findBy* и findOneBy*
  $varsGroup->findById(1);
  $varsGroup->findByCode('TEST');

  $vars = new UserVars\Vars();
  $vars->findById(1);
  $vars->findByCode('TEST');
  $vars->findByGroup(1);

  // Получаем все переменные по символьному коду
  $varsResult = $vars->findByCode('FIND_CODE');
  while ($var = $varsResult->fetch()) {
    print_r($var);
  }

  // Получаем одну переменную из группы
  $var = $vars->findOneByGroup(1)->fetch();
```

Для более гибкой выборки переменных или групп, работайте на прямую через модели:

- `Citfact\UserVars\Model\VarsTable`
- `Citfact\UserVars\Model\VarsGroupTable`

```
  use Bitrix\Main\Entity;
  use Citfact\UserVars\Model;

  $queryBuilder = new Entity\Query(Model\VarsGroupTable::getEntity());
  $queryBuilder
    ->setSelect(array('ID', 'NAME', 'CODE'))
    ->setOrder(array('ID', 'asc'))
    ->setFilter(array('CODE' => 'TEST_CODE'))
    ->setLimit(1);

  $result = $queryBuilder->exec()->fetch();
```

Удаление и обновление, также выполняется через модель

```
  use Citfact\UserVars\Model;

  // Удаляем переменную с ID = 1
  Model\VarsTable::delete(1);

  // Обновляем наименование у группы
  Model\VarsGroupTable::update(1, array('NAME' => 'New name'));
```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3332033?v=4)[Denis Kulichkin](/maintainers/onEXHovia)[@onEXHovia](https://github.com/onEXHovia)

---

Top Contributors

[![onEXHovia](https://avatars.githubusercontent.com/u/3332033?v=4)](https://github.com/onEXHovia "onEXHovia (6 commits)")

### Embed Badge

![Health badge](/badges/citfact-uservars/health.svg)

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

###  Alternatives

[symfony/flex

Composer plugin for Symfony

4.2k182.7M875](/packages/symfony-flex)[phpcompatibility/phpcompatibility-paragonie

A set of rulesets for PHP\_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by the Paragonie polyfill libraries.

1031.3M10](/packages/phpcompatibility-phpcompatibility-paragonie)[lifo/php-ipc

Simple PHP Inter Process Communication (IPC) library

285.5k](/packages/lifo-php-ipc)[lamoda/enum-bundle

Utility wrapper around PHP-enum

101.6k](/packages/lamoda-enum-bundle)

PHPackages © 2026

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