| Server IP : 121.121.20.254 / Your IP : 216.73.216.202 Web Server : Microsoft-IIS/10.0 System : Windows NT WEB-SERVER 10.0 build 20348 (Windows Server 2022) AMD64 User : IUSR ( 0) PHP Version : 8.3.28 Disable Function : NONE MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/inetpub/wwwroot/KnowledgeBase/wp-content/plugins/filebird-pro/includes/Classes/ |
Upload File : |
<?php
namespace FileBird\Classes;
class Config {
private static $loaded_configs = array();
/**
* Set config
*
* Eg: Config::setConfig('PostType', $data);
* or: Config::setConfig('PostType.name', 'foo');
*/
public static function setConfig( $name, $data ) {
$ex = explode( '.', $name );
if ( count( $ex ) == 1 ) {
self::$loaded_configs[ $name ] = $data;
} elseif ( count( $ex ) == 2 ) {
if ( ! isset( self::$loaded_configs[ $ex[0] ] ) ) {
self::$loaded_configs[ $ex[0] ] = array();
}
self::$loaded_configs[ $ex[0] ][ $ex[1] ] = $data;
}
}
/**
* Get loaded config
*
* Eg: Config::getConfig('PostType.name');
*/
public static function getConfig( $name ) {
$ex = explode( '.', $name );
if ( count( $ex ) == 2 ) {
if ( isset( self::$loaded_configs[ $ex[0] ] ) && isset( self::$loaded_configs[ $ex[0] ][ $ex[1] ] ) ) {
return self::$loaded_configs[ $ex[0] ][ $ex[1] ];
}
}
}
}