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 1w 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

[league/glide-symfony

Glide adapter for Symfony

1025.7M27](/packages/league-glide-symfony)[codercat/jwk-to-pem

Convert JWK to PEM format.

1004.5M20](/packages/codercat-jwk-to-pem)[typisttech/imposter

Wrapping all composer vendor packages inside your own namespace. Intended for WordPress plugins.

111286.6k1](/packages/typisttech-imposter)[whitecube/laravel-timezones

Store UTC dates in the database and work with custom timezones in the application.

106106.2k](/packages/whitecube-laravel-timezones)[mkraemer/react-pcntl

PCNTL bindings for ReactPHP

57289.0k9](/packages/mkraemer-react-pcntl)

PHPackages © 2026

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