Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *
- * @ This file is created by http://DeZender.Net
- * @ deZender (PHP5 Decoder for ionCube Encoder)
- *
- * @ Version : 3.0.7.0
- * @ Author : DeZender
- * @ Release on : 22.06.2017
- * @ Official site : http://DeZender.Net
- *
- */
- namespace App;
- class Bootstrap extends \Cube\Application\Bootstrap
- {
- protected $_settings = array( );
- protected $_sitePath = null;
- protected $_acl = null;
- protected $_role = 'Guest';
- protected $_user = null;
- protected $_connected = false;
- protected function _initConnected()
- {
- $this->bootstrap( 'db' );
- $db = $this->getResource( 'db' );
- if ($db instanceof \Cube\Db\Adapter\AbstractAdapter) {
- try {
- $this->_connected = $db->canConnect( );
- }
- catch (Exception $e) {
- $config = $db->getConfig( );
- if (array_key_exists( 'host', $config )) {
- if (strcmp( $config['host'], '%DB_HOST%' ) !== 0) {
- exit( 'Error establishing a database connection.' );
- }
- }
- $this->_redirect( 'no-config' );
- }
- }
- return $this->_connected;
- }
- protected function _initSettings()
- {
- $this->bootstrap( 'connected' );
- $settingsService = new \Ppb\Service\Settings( );
- try {
- $this->_settings = $settingsService->get( );
- date_default_timezone_set( $this->_settings['timezone'] );
- $timeZone = $this->_getTimeOffset( new DateTimeZone( $this->_settings['timezone'] ) );
- if (!(empty( $this->_settings['site_path'] ))) {
- $this->_sitePath = $this->_settings['site_path'];
- }
- $settingsService->getTable( )->getAdapter( )->query( 'SET time_zone=\'' . $timeZone . '\'' );
- }
- catch (Exception $e) {
- }
- return $this->_settings;
- }
- protected function _initSitePath()
- {
- if (strcmp( $this->_sitePath, '%SITE_PATH%' ) !== 0) {
- $httpHost = rtrim( sprintf( '%s://%s%s', (isset( $_SERVER['HTTPS'] ) && ($_SERVER['HTTPS'] != 'off') ? 'https' : 'http'), $_SERVER['HTTP_HOST'], $_SERVER['PHP_SELF'] ) );
- $request = $this->getResource( 'FrontController' )->getRequest( );
- if (!(stristr( $httpHost, $this->_sitePath ))) {
- $baseUrl = $request->getBaseUrl( );
- $redirectUri = $this->_sitePath . str_replace( $baseUrl, '', $_SERVER['REQUEST_URI'] );
- $this->getResource( 'FrontController' )->getResponse( )->setRedirect( $redirectUri, 301 )->sendHeaders( );
- exit( );
- }
- }
- }
- protected final function _initLicensing()
- {
- $serverName = filter_input( INPUT_SERVER, 'SERVER_NAME', FILTER_UNSAFE_RAW );
- if (empty( $serverName ) && empty( $_SERVER['SERVER_NAME'] )) {
- $serverName = '';
- if (!(empty( $this->_sitePath ))) {
- ..........................................................
- .................................
- ............
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement