Advertisement
Guest User

Untitled

a guest
Dec 27th, 2018
594
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.30 KB | None | 0 0
  1. <?php
  2. /*
  3. *
  4. * @ This file is created by http://DeZender.Net
  5. * @ deZender (PHP5 Decoder for ionCube Encoder)
  6. *
  7. * @ Version : 3.5.0.0
  8. * @ Author : DeZender
  9. * @ Release on : 22.06.2018
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. namespace App;
  15.  
  16. class Bootstrap extends \Cube\Application\Bootstrap
  17. {
  18. protected $_settings = array();
  19. protected $_sitePath = null;
  20. protected $_acl = null;
  21. protected $_role = 'Guest';
  22. protected $_storage = null;
  23. protected $_connected = false;
  24.  
  25. protected function _initConnected()
  26. {
  27. $this->bootstrap('db');
  28. $db = $this->getResource('db');
  29.  
  30. if ($db instanceof \Cube\Db\Adapter\AbstractAdapter) {
  31. try {
  32. $this->_connected = $db->canConnect();
  33. } catch (\Exception $e) {
  34. $config = $db->getConfig();
  35.  
  36. if (array_key_exists('host', $config) && strcmp($config['host'], '%DB_HOST%') !== 0) {
  37. exit('Error establishing a database connection.');
  38. }
  39.  
  40. $this->_redirect('no-config');
  41. }
  42. }
  43.  
  44. return $this->_connected;
  45. }
  46.  
  47. protected function _initSettings()
  48. {
  49. $this->bootstrap('connected');
  50. $_obfuscated_0D1632153D190E260B3104152917192802221502350211_ = new \Ppb\Service\Settings();
  51.  
  52. try {
  53. $this->_settings = $_obfuscated_0D1632153D190E260B3104152917192802221502350211_->get();
  54. date_default_timezone_set($this->_settings['timezone']);
  55. $timeZone = $this->_getTimeOffset(new \DateTimeZone($this->_settings['timezone']));
  56.  
  57. if (!empty($this->_settings['site_path'])) {
  58. $this->_sitePath = $this->_settings['site_path'];
  59. }
  60.  
  61. $_obfuscated_0D1632153D190E260B3104152917192802221502350211_->getTable()->getAdapter()->query("SET time_zone='" . $timeZone . "'");
  62. } catch (\Exception $e) {
  63. }
  64.  
  65. return $this->_settings;
  66. }
  67.  
  68. protected function _initSitePath()
  69. {
  70. if (isset($_SERVER['PHP_SELF']) && isset($_SERVER['HTTP_HOST']) && strcmp($this->_sitePath, '%SITE_PATH%') !== 0) {
  71. $httpHost = rtrim(sprintf('%s://%s%s', (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' ? 'https' : 'http'), $_SERVER['HTTP_HOST'], $_SERVER['PHP_SELF']));
  72. $request = $this->getResource('FrontController')->getRequest();
  73.  
  74. if (!stristr($httpHost, $this->_sitePath)) {
  75. ......................................................................
  76. .......................................
  77. ............
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement