Advertisement
Guest User

Untitled

a guest
Apr 14th, 2022
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.64 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.1
  8. * @ Author : DeZender
  9. * @ Release on : 29.08.2020
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. class CI_Config
  15. {
  16. public $config = [];
  17. public $is_loaded = [];
  18. public $_config_paths = [APPPATH];
  19.  
  20. public function __construct()
  21. {
  22. $this->config = &get_config();
  23.  
  24. if (empty($this->config['base_url'])) {
  25. if (isset($_SERVER['SERVER_ADDR'])) {
  26. if (strpos($_SERVER['SERVER_ADDR'], ':') !== false) {
  27. $server_addr = '[' . $_SERVER['SERVER_ADDR'] . ']';
  28. }
  29. else {
  30. $server_addr = $_SERVER['SERVER_ADDR'];
  31. }
  32.  
  33. $base_url = (is_https() ? 'https' : 'http') . '://' . $server_addr . substr($_SERVER['SCRIPT_NAME'], 0, strpos($_SERVER['SCRIPT_NAME'], basename($_SERVER['SCRIPT_FILENAME'])));
  34. }
  35. else {
  36. $base_url = 'http://localhost/';
  37. }
  38.  
  39. $this->set_item('base_url', $base_url);
  40. }
  41.  
  42. log_message('info', 'Config Class Initialized');
  43. }
  44.  
  45. public function load($file = '', $use_sections = false, $fail_gracefully = false)
  46. {
  47. $file = ($file === '' ? 'config' : str_replace('.php', '', $file));
  48. $loaded = false;
  49.  
  50. foreach ($this->_config_paths as $path) {
  51. foreach ([$file, ENVIRONMENT . DIRECTORY_SEPARATOR . $file] as $location) {
  52. $file_path = $path . 'config/' . $location . '.php';
  53.  
  54. if (in_array($file_path, $this->is_loaded, true)) {
  55. return true;
  56. }
  57.  
  58. if (!file_exists($file_path)) {
  59. continue;
  60. .................................................................
  61. .....................................
  62. .................
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement