Pili\Config::getInstance PHP Method

getInstance() public static method

public static getInstance ( )
    public static function getInstance()
    {
        if (!self::$_instance instanceof self) {
            self::$_instance = new self();
        }
        return self::$_instance;
    }

Usage Example

Example #1
0
 private static function _getApiBaseUrl()
 {
     $cfg = Config::getInstance();
     $protocal = $cfg->USE_HTTPS === true ? "https" : "http";
     $url = sprintf("%s://%s/%s/", $protocal, $cfg->API_HOST, $cfg->API_VERSION);
     return $url;
 }