Giter Site home page Giter Site logo

config's Introduction

Config

Latest Stable Version Total Downloads Latest Unstable Version License

Установка

Установка через composer:

$ composer require slexx/config

Документация

Config->__construct([$file])

Аргументы:

Имя Тип Описание
[$file] string, array Имя файла имя массив данных

Пример:

new Config('config.json');
new Config('config.ini');
new Config();
new Config(['foo' => 'bar']);

Config->setFile($file)

Установка пути к файлу

Аргументы:

Имя Тип Описание
$file null, string Путь к файлу

Возвращает: $this

Config->getFile()

Получение пути к файлу

Возвращает: null, string

Config->save()

Сохранение конфигурайии

Возвращает: $this

Пример:

$config = new Config('config.json')
$config->set('foo', 'bar');
$config->save();

Config->toArray()

Преобразование в массив

Возвращает: array

Config->all()

Возвращает: array

Config->count()

Возвращает: int

Config->getIterator()

Возвращает: \ArrayIterator

Config->set($key, $value)

Установка переменной конфигурации

Аргументы:

Имя Тип Описание
$key string Имя переменной
$value mixed Значение переменной

Возвращает: $this

Config->has($key)

Проверка существования переменной конфигурации

Аргументы:

Имя Тип Описание
$key string Имя переменной

Возвращает: bool

Config->get($key)

Получение значение переменной конфигурации

Аргументы:

Имя Тип Описание
$key string Имя переменной

Возвращает: mixed, null - Значение переменной или null в случае её отсуцтвия

Config->remove($key)

Удаление переменной конфигурации

Аргументы:

Имя Тип Описание
$key string Имя переменной

Возвращает: $this

config's People

Contributors

slexx1234 avatar

Stargazers

André Philip avatar Alexei Petrovich avatar  avatar

Watchers

André Philip avatar James Cloos avatar

Forkers

mishanikodev

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.