PHP Classes

File: src/Config.php

Recommend this page to a friend!
  Classes of Joseluis Laso   PHP Telegram CLI Wrapper   src/Config.php   Download  
File: src/Config.php
Role: Class source
Content type: text/plain
Description: Class source
Class: PHP Telegram CLI Wrapper
Send messages and other commands to Telegram users
Author: By
Last change:
Date: 8 years ago
Size: 640 bytes
 

Contents

Class file image Download
<?php

namespace TelegramCliWrapper;

class
Config
{
   
/** @var Config */
   
protected static $instance = null;
   
/** @var array */
   
protected $config;

   
/**
     * @return Config
     */
   
public static function getInstance()
    {
        if (!
self::$instance) {
           
self::$instance = new static();
        }

        return
self::$instance;
    }

    protected function
__construct()
    {
       
$this->config = parse_ini_file(__DIR__ . '/../config/config.ini', true);
    }

   
/**
     * @param $key
     * @return array
     */
   
public function get($key)
    {
        return
$this->config[$key];
    }
}