Advertisement
Guest User

Untitled

a guest
Jul 25th, 2020
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.92 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by http://DeZender.Net
  5. * @ deZender (PHP7 Decoder for ionCube Encoder)
  6. *
  7. * @ Version : 4.1.0.0
  8. * @ Author : DeZender
  9. * @ Release on : 15.05.2020
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. function get_base_url()
  15. {
  16. static $url = null;
  17.  
  18. if ($url) {
  19. return $url;
  20. }
  21.  
  22. if ($url = get_config('app', 'base', 'url')) {
  23. return $url = rtrim($url, '/');
  24. }
  25.  
  26. return $url = ($_SERVER['HTTPS'] ? 'https' : 'http') . '://' . ($_SERVER['HTTP_HOST'] ? $_SERVER['HTTP_HOST'] : $_SERVER['SERVER_ADDR']) . rtrim('/' . ltrim(str_replace('\\', '/', dirname(str_replace($_SERVER['DOCUMENT_ROOT'], '', __INDEX__))), '/'), '/');
  27. }
  28.  
  29. function get_config($name = NULL, $group = NULL, $key = NULL, $default = NULL)
  30. {
  31. static $config = null;
  32.  
  33. if (function_exists('custom_get_config')) {
  34. $get = custom_get_config($name, $group, $key);
  35.  
  36. if (!is_null($get)) {
  37. return $get;
  38. }
  39. }
  40.  
  41. if ($name) {
  42. if ($config[$name]) {
  43. if ($group) {
  44. if ($config[$name][$group]) {
  45. if ($key) {
  46. if (is_array($key)) {
  47. $values = [];
  48.  
  49. foreach ($key as $k) {
  50. if (array_key_exists($k, $config[$name][$group])) {
  51. $values[$k] = $config[$name][$group][$k];
  52. }
  53. }
  54.  
  55. if (!empty($values)) {
  56. return $values;
  57. }
  58. }
  59. else if (array_key_exists($key, $config[$name][$group])) {
  60. return $config[$name][$group][$key];
  61. }
  62.  
  63. return $default;
  64. }
  65. else {
  66. return $config[$name][$group];
  67. }
  68. }
  69.  
  70. return $default;
  71. }
  72. else {
  73. return $config[$name];
  74. }
  75. }
  76. else {
  77. if (($config[$name] = parse_ini_file(get_ini_file($name), true)) === false) {
  78. echo 'Invalid ' . $name . ' config file';
  79. exit();
  80. }
  81. else {
  82. foreach ($config[$name] as $k => $v) {
  83. if (is_array($v) && empty($v)) {
  84. if ($section = get_ini_file($name, $k)) {
  85. if (($config[$name][$k] = parse_ini_file($section, true)) === false) {
  86. echo 'Invalid ' . $name . ' ' . $k . ' config file';
  87. exit();
  88. }
  89. }
  90. }
  91. }
  92. }
  93.  
  94. return get_config($name, $group, $key, $default);
  95. }
  96. }
  97. else {
  98. return $config;
  99. }
  100. }
  101.  
  102. function get_config_enables($name)
  103. {
  104. if ($config = get_config($name)) {
  105. $enables = [];
  106.  
  107. foreach ($config as $k => $v) {
  108. if (array_key_exists('enabled', $v)) {
  109. $enables[$k] = (is_array($v['enabled']) ? $v['enabled'] : ($v['enabled'] == 1 ? true : ($v['enabled'] == 0 ? false : $v['enabled'])));
  110. }
  111. }
  112.  
  113. return $enables;
  114. }
  115. }
  116.  
  117. function get_platform_options($config, $platform)
  118. {
  119. return get_config($config, 'platform.' . $platform);
  120. }
  121.  
  122. function get_ini_file($name, $group = NULL)
  123. {
  124. if (function_exists('get_custom_ini_file')) {
  125. if ($ini = get_custom_ini_file($name, $group)) {
  126. ............................................................
  127. ..................................
  128. .............
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement