PHP 7.4.33
Preview: PodioConfig.php Size: 1.77 KB
/var/www/penneotest.bitkit.dk/httpdocs/app/Modules/PodioConfig.php
<?php

namespace App\Modules;

use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\Log;
use Monolog\Formatter\LineFormatter;
use Monolog\Handler\StreamHandler;

class PodioConfig
{
    //staging
    public static $clientId;
    public static $clientSecret;

    public static $app_name_student = 'ELEVER';
    public static $app_name_contract = 'KONTRAKTER';
    public static $app_name_settings = 'SETTINGS';

    public static $running = "PRODUCTION";
//    public static $running = "DEVELOPMENT";
    public static $podio;
    public static $podio_field_id;

    public static $appId;
    public static $appToken;

    /**
     * Initialising client id, secret , app and field ids
     */
    public static function initialise()
    {
        self::$podio_field_id = Config::get('constants.podio_field_id.' . self::$running);
        self::$podio = Config::get('constants.podio.' . self::$running);
        self::$clientId = self::$podio['API']['CLIENT_ID'];
        self::$clientSecret = self::$podio['API']['CLIENT_SECRET'];
    }


    /* Setup App id and App Secret
     * @param $app_name - Name of the App to setup
     */
    public static function setupApp($app_name)
    {
        self::$appId = self::$podio['APPS'][$app_name]['APP_ID'];
        self::$appToken = self::$podio['APPS'][$app_name]['APP_TOKEN'];
    }

    public static function logConfig($item_id = NULL)
    {
        $logFileName = $item_id ? $item_id . "-laravel.log" : 'Anonymous - laravel.log';
        $logFileName = storage_path() . '/logs/PenneoLogs/' . $logFileName;
        $log = Log::getMonoLog();
        $log->pushHandler($handler = new StreamHandler($logFileName));
        $handler->setFormatter(new LineFormatter(NULL, NULL, TRUE, TRUE));
    }
}

Directory Contents

Dirs: 0 × Files: 2
Name Size Perms Modified Actions
1.49 KB lrw-rw-r-- 2023-07-25 05:59:08
Edit Download
1.77 KB lrw-rw-r-- 2023-07-21 09:51:23
Edit Download
If ZipArchive is unavailable, a .tar will be created (no compression).